2001-12-15 03:30:45 +00:00
|
|
|
|
2002-01-31 20:17:33 +00:00
|
|
|
//// opengc.hxx - Network interface program to send sim data onto a LAN
|
2001-12-15 03:30:45 +00:00
|
|
|
//
|
|
|
|
// Created by: J. Wojnaroski -- castle@mminternet.com
|
|
|
|
// Date: 21 Nov 2001
|
2001-11-30 23:56:28 +00:00
|
|
|
//
|
2002-01-31 20:17:33 +00:00
|
|
|
//
|
|
|
|
// Adapted from original network code developed by C. Olson
|
|
|
|
//
|
2001-11-30 23:56:28 +00:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2001-11-30 23:56:28 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _FG_OPENGC_HXX
|
|
|
|
#define _FG_OPENGC_HXX
|
|
|
|
|
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
|
|
|
#include STL_STRING
|
|
|
|
|
|
|
|
#include <FDM/flight.hxx>
|
2002-06-27 22:26:47 +00:00
|
|
|
#include <Main/fg_props.hxx>
|
2001-11-30 23:56:28 +00:00
|
|
|
|
|
|
|
#include "protocol.hxx"
|
|
|
|
#include "opengc_data.hxx"
|
|
|
|
|
2002-01-19 05:34:03 +00:00
|
|
|
class FGOpenGC : public FGProtocol, public FGInterface {
|
2001-11-30 23:56:28 +00:00
|
|
|
|
|
|
|
ogcFGData buf;
|
|
|
|
int length;
|
2002-06-27 22:26:47 +00:00
|
|
|
|
2004-01-23 21:02:09 +00:00
|
|
|
// Environment
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr press_node;
|
|
|
|
SGPropertyNode_ptr temp_node;
|
|
|
|
SGPropertyNode_ptr wind_dir_node;
|
|
|
|
SGPropertyNode_ptr wind_speed_node;
|
|
|
|
SGPropertyNode_ptr magvar_node;
|
2002-06-27 22:26:47 +00:00
|
|
|
|
2006-01-20 17:19:01 +00:00
|
|
|
// Position on the Geod
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr p_latitude;
|
|
|
|
SGPropertyNode_ptr p_longitude;
|
|
|
|
SGPropertyNode_ptr p_elev_node;
|
|
|
|
//SGPropertyNode_ptr p_altitude;
|
|
|
|
SGPropertyNode_ptr p_altitude_agl;
|
2004-01-23 21:02:09 +00:00
|
|
|
|
2006-01-20 17:19:01 +00:00
|
|
|
// Orientation
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr p_pitch;
|
|
|
|
SGPropertyNode_ptr p_bank;
|
|
|
|
SGPropertyNode_ptr p_heading;
|
|
|
|
SGPropertyNode_ptr p_yaw;
|
|
|
|
SGPropertyNode_ptr p_yaw_rate;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
|
|
|
// Flight Parameters
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr vel_kcas;
|
|
|
|
SGPropertyNode_ptr p_vvi;
|
|
|
|
SGPropertyNode_ptr p_mach;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
2002-06-27 22:26:47 +00:00
|
|
|
// Control surfaces
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr p_left_aileron;
|
|
|
|
SGPropertyNode_ptr p_right_aileron;
|
|
|
|
SGPropertyNode_ptr p_elevator;
|
|
|
|
SGPropertyNode_ptr p_elevator_trim;
|
|
|
|
SGPropertyNode_ptr p_rudder;
|
|
|
|
SGPropertyNode_ptr p_flaps;
|
|
|
|
SGPropertyNode_ptr p_flaps_cmd;
|
2002-06-27 22:26:47 +00:00
|
|
|
|
2006-01-20 17:19:01 +00:00
|
|
|
// GEAR System
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr p_park_brake;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
|
|
|
// Engines
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr egt0_node;
|
|
|
|
SGPropertyNode_ptr egt1_node;
|
|
|
|
SGPropertyNode_ptr egt2_node;
|
|
|
|
SGPropertyNode_ptr egt3_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr epr0_node;
|
|
|
|
SGPropertyNode_ptr epr1_node;
|
|
|
|
SGPropertyNode_ptr epr2_node;
|
|
|
|
SGPropertyNode_ptr epr3_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr n10_node;
|
|
|
|
SGPropertyNode_ptr n11_node;
|
|
|
|
SGPropertyNode_ptr n12_node;
|
|
|
|
SGPropertyNode_ptr n13_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr n20_node;
|
|
|
|
SGPropertyNode_ptr n21_node;
|
|
|
|
SGPropertyNode_ptr n22_node;
|
|
|
|
SGPropertyNode_ptr n23_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr oil_temp0;
|
|
|
|
SGPropertyNode_ptr oil_temp1;
|
|
|
|
SGPropertyNode_ptr oil_temp2;
|
|
|
|
SGPropertyNode_ptr oil_temp3;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
|
|
|
// Fuel System
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr tank0_node;
|
|
|
|
SGPropertyNode_ptr tank1_node;
|
|
|
|
SGPropertyNode_ptr tank2_node;
|
|
|
|
SGPropertyNode_ptr tank3_node;
|
|
|
|
SGPropertyNode_ptr tank4_node;
|
|
|
|
SGPropertyNode_ptr tank5_node;
|
|
|
|
SGPropertyNode_ptr tank6_node;
|
|
|
|
SGPropertyNode_ptr tank7_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
// Boost pumps; Center tank has only override pumps; boosts are in the
|
|
|
|
// four main wing tanks 1->4
|
2006-06-11 10:21:10 +00:00
|
|
|
// SGPropertyNode_ptr boost1_node;
|
|
|
|
// SGPropertyNode_ptr boost2_node;
|
|
|
|
// SGPropertyNode_ptr boost3_node;
|
|
|
|
// SGPropertyNode_ptr boost4_node;
|
|
|
|
// SGPropertyNode_ptr boost5_node;
|
|
|
|
// SGPropertyNode_ptr boost6_node;
|
|
|
|
// SGPropertyNode_ptr boost7_node;
|
|
|
|
// SGPropertyNode_ptr boost8_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
// Override pumps
|
2006-06-11 10:21:10 +00:00
|
|
|
// SGPropertyNode_ptr ovride0_node;
|
|
|
|
// SGPropertyNode_ptr ovride1_node;
|
|
|
|
// SGPropertyNode_ptr ovride2_node;
|
|
|
|
// SGPropertyNode_ptr ovride3_node;
|
|
|
|
// SGPropertyNode_ptr ovride4_node;
|
|
|
|
// SGPropertyNode_ptr ovride5_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
// X_Feed valves
|
2006-06-11 10:21:10 +00:00
|
|
|
// SGPropertyNode_ptr x_feed0_node;
|
|
|
|
// SGPropertyNode_ptr x_feed1_node;
|
|
|
|
// SGPropertyNode_ptr x_feed2_node;
|
|
|
|
// SGPropertyNode_ptr x_feed3_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
|
2002-06-27 22:26:47 +00:00
|
|
|
// Aero numbers
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr p_alphadot;
|
|
|
|
SGPropertyNode_ptr p_betadot;
|
2001-11-30 23:56:28 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
FGOpenGC();
|
|
|
|
~FGOpenGC();
|
|
|
|
|
|
|
|
// open hailing frequencies
|
|
|
|
bool open();
|
|
|
|
|
|
|
|
// process work for this port
|
|
|
|
bool process();
|
|
|
|
|
|
|
|
// close the channel
|
|
|
|
bool close();
|
|
|
|
|
2002-06-27 22:26:47 +00:00
|
|
|
void collect_data( const FGInterface *fdm, ogcFGData *data );
|
2001-11-30 23:56:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FG_OPENGC_HXX
|
|
|
|
|
|
|
|
|
2001-12-15 03:30:45 +00:00
|
|
|
|