]> git.mxchange.org Git - flightgear.git/blob - src/Network/opengc.hxx
Merge branch 'work4' into next
[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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
23 //
24
25
26 #ifndef _FG_OPENGC_HXX
27 #define _FG_OPENGC_HXX
28
29 #include <simgear/compiler.h>
30
31 #include <string>
32
33 #include <Main/fg_props.hxx>
34
35 #include "protocol.hxx"
36 #include "opengc_data.hxx"
37
38 class FlightProperties;
39
40 class FGOpenGC : public FGProtocol
41 {
42
43     ogcFGData buf;
44     FlightProperties* fdm;
45     
46     // Environment
47     SGPropertyNode_ptr press_node;
48     SGPropertyNode_ptr temp_node;
49     SGPropertyNode_ptr wind_dir_node;
50     SGPropertyNode_ptr wind_speed_node;
51     SGPropertyNode_ptr magvar_node;
52     
53     // Position on the Geod
54     SGPropertyNode_ptr p_latitude;
55     SGPropertyNode_ptr p_longitude;
56     SGPropertyNode_ptr p_elev_node;
57     //SGPropertyNode_ptr p_altitude;
58     SGPropertyNode_ptr p_altitude_agl;
59     
60     // Orientation
61     SGPropertyNode_ptr p_pitch;
62     SGPropertyNode_ptr p_bank;
63     SGPropertyNode_ptr p_heading;
64     SGPropertyNode_ptr p_yaw;
65     SGPropertyNode_ptr p_yaw_rate;
66     
67     // Flight Parameters
68     SGPropertyNode_ptr vel_kcas;
69     SGPropertyNode_ptr p_vvi;
70     SGPropertyNode_ptr p_mach;
71     
72     // Control surfaces
73     SGPropertyNode_ptr p_left_aileron;
74     SGPropertyNode_ptr p_right_aileron;
75     SGPropertyNode_ptr p_elevator;
76     SGPropertyNode_ptr p_elevator_trim;
77     SGPropertyNode_ptr p_rudder;
78     SGPropertyNode_ptr p_flaps;
79     SGPropertyNode_ptr p_flaps_cmd;
80     
81     // GEAR System
82     SGPropertyNode_ptr p_park_brake;
83     
84     // Engines
85     SGPropertyNode_ptr egt0_node;
86     SGPropertyNode_ptr egt1_node;
87     SGPropertyNode_ptr egt2_node;
88     SGPropertyNode_ptr egt3_node;
89     
90     SGPropertyNode_ptr epr0_node;
91     SGPropertyNode_ptr epr1_node;
92     SGPropertyNode_ptr epr2_node;
93     SGPropertyNode_ptr epr3_node;
94     
95     SGPropertyNode_ptr n10_node;
96     SGPropertyNode_ptr n11_node;
97     SGPropertyNode_ptr n12_node;
98     SGPropertyNode_ptr n13_node;
99     
100     SGPropertyNode_ptr n20_node;
101     SGPropertyNode_ptr n21_node;
102     SGPropertyNode_ptr n22_node;
103     SGPropertyNode_ptr n23_node;
104     
105     SGPropertyNode_ptr oil_temp0;
106     SGPropertyNode_ptr oil_temp1;
107     SGPropertyNode_ptr oil_temp2;
108     SGPropertyNode_ptr oil_temp3;
109    
110     // Fuel System
111     SGPropertyNode_ptr tank0_node;
112     SGPropertyNode_ptr tank1_node;
113     SGPropertyNode_ptr tank2_node;
114     SGPropertyNode_ptr tank3_node;
115     SGPropertyNode_ptr tank4_node;
116     SGPropertyNode_ptr tank5_node;
117     SGPropertyNode_ptr tank6_node;
118     SGPropertyNode_ptr tank7_node;
119     // Boost pumps; Center tank has only override pumps; boosts are in the
120     // four main wing tanks 1->4
121 //    SGPropertyNode_ptr boost1_node;
122 //    SGPropertyNode_ptr boost2_node;
123 //    SGPropertyNode_ptr boost3_node;
124 //    SGPropertyNode_ptr boost4_node;
125 //    SGPropertyNode_ptr boost5_node;
126 //    SGPropertyNode_ptr boost6_node;
127 //    SGPropertyNode_ptr boost7_node;
128 //    SGPropertyNode_ptr boost8_node;
129     // Override pumps
130 //    SGPropertyNode_ptr ovride0_node;
131 //    SGPropertyNode_ptr ovride1_node;
132 //    SGPropertyNode_ptr ovride2_node;
133 //    SGPropertyNode_ptr ovride3_node;
134 //    SGPropertyNode_ptr ovride4_node;
135 //    SGPropertyNode_ptr ovride5_node;
136     // X_Feed valves
137 //    SGPropertyNode_ptr x_feed0_node;
138 //    SGPropertyNode_ptr x_feed1_node;
139 //    SGPropertyNode_ptr x_feed2_node;
140 //    SGPropertyNode_ptr x_feed3_node;
141     
142     // Aero numbers
143     SGPropertyNode_ptr p_alphadot;
144     SGPropertyNode_ptr p_betadot;
145
146 public:
147
148     FGOpenGC();
149     ~FGOpenGC();
150
151     // open hailing frequencies
152     bool open();
153
154     // process work for this port
155     bool process();
156
157     // close the channel
158     bool close();
159
160     void collect_data(ogcFGData *data );
161 };
162
163 #endif // _FG_OPENGC_HXX
164
165
166