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