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
|
2002-06-27 22:26:47 +00:00
|
|
|
SGPropertyNode *press_node;
|
|
|
|
SGPropertyNode *temp_node;
|
|
|
|
SGPropertyNode *wind_dir_node;
|
|
|
|
SGPropertyNode *wind_speed_node;
|
2006-01-20 17:19:01 +00:00
|
|
|
SGPropertyNode *magvar_node;
|
2002-06-27 22:26:47 +00:00
|
|
|
|
2006-01-20 17:19:01 +00:00
|
|
|
// Position on the Geod
|
2004-01-23 21:02:09 +00:00
|
|
|
SGPropertyNode *p_latitude;
|
|
|
|
SGPropertyNode *p_longitude;
|
2006-01-20 17:19:01 +00:00
|
|
|
SGPropertyNode *p_elev_node;
|
|
|
|
//SGPropertyNode *p_altitude;
|
2004-01-23 21:02:09 +00:00
|
|
|
SGPropertyNode *p_altitude_agl;
|
|
|
|
|
2006-01-20 17:19:01 +00:00
|
|
|
// Orientation
|
|
|
|
SGPropertyNode *p_pitch;
|
|
|
|
SGPropertyNode *p_bank;
|
|
|
|
SGPropertyNode *p_heading;
|
|
|
|
SGPropertyNode *p_yaw;
|
|
|
|
SGPropertyNode *p_yaw_rate;
|
|
|
|
|
|
|
|
// Flight Parameters
|
|
|
|
SGPropertyNode *vel_kcas;
|
|
|
|
SGPropertyNode *p_vvi;
|
|
|
|
SGPropertyNode *p_mach;
|
|
|
|
|
2002-06-27 22:26:47 +00:00
|
|
|
// Control surfaces
|
|
|
|
SGPropertyNode *p_left_aileron;
|
|
|
|
SGPropertyNode *p_right_aileron;
|
|
|
|
SGPropertyNode *p_elevator;
|
|
|
|
SGPropertyNode *p_elevator_trim;
|
|
|
|
SGPropertyNode *p_rudder;
|
|
|
|
SGPropertyNode *p_flaps;
|
|
|
|
SGPropertyNode *p_flaps_cmd;
|
|
|
|
|
2006-01-20 17:19:01 +00:00
|
|
|
// GEAR System
|
|
|
|
SGPropertyNode *p_park_brake;
|
|
|
|
|
|
|
|
// Engines
|
|
|
|
SGPropertyNode *egt0_node;
|
|
|
|
SGPropertyNode *egt1_node;
|
|
|
|
SGPropertyNode *egt2_node;
|
|
|
|
SGPropertyNode *egt3_node;
|
|
|
|
|
|
|
|
SGPropertyNode *epr0_node;
|
|
|
|
SGPropertyNode *epr1_node;
|
|
|
|
SGPropertyNode *epr2_node;
|
|
|
|
SGPropertyNode *epr3_node;
|
|
|
|
|
|
|
|
SGPropertyNode *n10_node;
|
|
|
|
SGPropertyNode *n11_node;
|
|
|
|
SGPropertyNode *n12_node;
|
|
|
|
SGPropertyNode *n13_node;
|
|
|
|
|
|
|
|
SGPropertyNode *n20_node;
|
|
|
|
SGPropertyNode *n21_node;
|
|
|
|
SGPropertyNode *n22_node;
|
|
|
|
SGPropertyNode *n23_node;
|
|
|
|
|
|
|
|
SGPropertyNode *oil_temp0;
|
|
|
|
SGPropertyNode *oil_temp1;
|
|
|
|
SGPropertyNode *oil_temp2;
|
|
|
|
SGPropertyNode *oil_temp3;
|
|
|
|
|
|
|
|
// Fuel System
|
|
|
|
SGPropertyNode *tank0_node;
|
|
|
|
SGPropertyNode *tank1_node;
|
|
|
|
SGPropertyNode *tank2_node;
|
|
|
|
SGPropertyNode *tank3_node;
|
|
|
|
SGPropertyNode *tank4_node;
|
|
|
|
SGPropertyNode *tank5_node;
|
|
|
|
SGPropertyNode *tank6_node;
|
|
|
|
SGPropertyNode *tank7_node;
|
|
|
|
// Boost pumps; Center tank has only override pumps; boosts are in the
|
|
|
|
// four main wing tanks 1->4
|
|
|
|
// SGPropertyNode *boost1_node;
|
|
|
|
// SGPropertyNode *boost2_node;
|
|
|
|
// SGPropertyNode *boost3_node;
|
|
|
|
// SGPropertyNode *boost4_node;
|
|
|
|
// SGPropertyNode *boost5_node;
|
|
|
|
// SGPropertyNode *boost6_node;
|
|
|
|
// SGPropertyNode *boost7_node;
|
|
|
|
// SGPropertyNode *boost8_node;
|
|
|
|
// Override pumps
|
|
|
|
// SGPropertyNode *ovride0_node;
|
|
|
|
// SGPropertyNode *ovride1_node;
|
|
|
|
// SGPropertyNode *ovride2_node;
|
|
|
|
// SGPropertyNode *ovride3_node;
|
|
|
|
// SGPropertyNode *ovride4_node;
|
|
|
|
// SGPropertyNode *ovride5_node;
|
|
|
|
// X_Feed valves
|
|
|
|
// SGPropertyNode *x_feed0_node;
|
|
|
|
// SGPropertyNode *x_feed1_node;
|
|
|
|
// SGPropertyNode *x_feed2_node;
|
|
|
|
// SGPropertyNode *x_feed3_node;
|
|
|
|
|
2002-06-27 22:26:47 +00:00
|
|
|
// Aero numbers
|
|
|
|
SGPropertyNode *p_alphadot;
|
|
|
|
SGPropertyNode *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
|
|
|
|