// cout << "pos = " << raw->longitude << " " << raw->latitude << endl;
// cout << "sea level rad = " << cur_fdm_state->get_Sea_level_radius() << endl;
cur_fdm_state->_updateGeodeticPosition( raw->latitude,
- raw->longitude,
- raw->altitude
- * SG_METER_TO_FEET );
+ raw->longitude,
+ raw->altitude
+ * SG_METER_TO_FEET );
cur_fdm_state->_set_Euler_Angles( raw->phi,
raw->theta,
raw->psi );
-// opengc.cxx --
+// opengc.cxx - Network interface program to send sim data onto a LAN
+//
+// Created by: J. Wojnaroski -- castle@mminternet.com
+// Date: 21 Nov 2001
+//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
FGEngInterface *p_engine[4]; // four is enough unless you're a BUF
p_engine[0] = cur_fdm_state->get_engine(0);
+ p_engine[1] = cur_fdm_state->get_engine(1);
+
+ data->version_id = 0x0011;
data->latitude = fdm->get_Longitude_deg();
data->longitude = cur_fdm_state->get_Latitude_deg();
data->magvar = globals->get_mag()->get_magvar();
-// engine data, for now set the 2nd engine equal to the first
-
data->rpm[0] = p_engine[0]->get_RPM();
- data->rpm[1] = p_engine[0]->get_RPM();
+ data->rpm[1] = p_engine[1]->get_RPM();
data->epr[0] = p_engine[0]->get_Manifold_Pressure();
- data->epr[1] = p_engine[0]->get_Manifold_Pressure();
+ data->epr[1] = p_engine[1]->get_Manifold_Pressure();
data->egt[0] = p_engine[0]->get_EGT();
- data->egt[1] = p_engine[0]->get_EGT();
+ data->egt[1] = p_engine[1]->get_EGT();
data->oil_pressure[0] = p_engine[0]->get_Oil_Pressure();
- data->oil_pressure[1] = p_engine[0]->get_Oil_Pressure();
+ data->oil_pressure[1] = p_engine[1]->get_Oil_Pressure();
// navigation data
// Once OPenGC develops a comparable navaids database some of this will not be required
-//data->nav1_ident = current_radiostack->get_nav1_ident();
+ //data->nav1_ident = current_radiostack->get_nav1_ident();
data->nav1_freq = current_radiostack->get_nav1_freq();
data->nav1_radial = current_radiostack->get_nav1_sel_radial();
data->nav1_course_dev = current_radiostack->get_nav1_heading_needle_deflection();
return true;
}
+
-// opengc.hxx --
+
+//// opengc.cxx - Network interface program to send sim data onto a LAN
+//
+// Created by: J. Wojnaroski -- castle@mminternet.com
+// Date: 21 Nov 2001
//
+
// 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
#endif // _FG_OPENGC_HXX
+
-// opengc.hxx -- define shared flight model parameters
+// opengc.hxx -- Define structure of OpenGC/FG interface parameters
+//
+// Version by J. Wojnaroski for interface to Open Glass Displays
+//
+// Modified 02/12/01 - Update engine structure for multi-engine models
+// - Added data preamble to id msg types
+//
+// This file defines the class/structure of the UDP packet that sends
+// the simulation data created by FlightGear to the glass displays. It
+// is required to "sync" the data types contained in the packet
//
-// Version 1.0 by J. Wojnaroski for interface to Open Glass Displays
-// Date: Nov 18,2001
-
// 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
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
-#ifndef _OPENGC_HXX
-#define _OPENGC_HXX
+#ifndef _OPENGC_DATA_HXX
+#define _OPENGC_DATA_HXX
#ifndef __cplusplus
# error This library requires C++
#endif
+#include <string>
+
class ogcFGData {
public:
- // flight parameters
-
- double pitch;
- double bank;
- double heading;
- double altitude;
- double altitude_agl;
- double v_kcas;
- double groundspeed;
- double vvi;
+ // defines msg types and contents. typedefs & classes are TBS
+ unsigned int version_id;
+ unsigned int msg_id;
+ unsigned int msg_content;
+ unsigned short autopilot_mode;
+ unsigned short afds_armed_mode;
- // position
+ // flight parameters
+
+ double pitch;
+ double bank;
+ double heading;
+ double altitude;
+ double altitude_agl; // this can also be the radar altimeter
+ double v_kcas;
+ double groundspeed;
+ double vvi;
+ double mach;
- double latitude;
- double longitude;
- double magvar;
+ // position
- // engine data
+ double latitude;
+ double longitude;
+ double magvar;
- double rpm[4];
- double epr[4];
- double egt[4];
- double fuel_flow[4];
- double oil_pressure[4];
+ // engine data
- // navigation data
+ double rpm[4];
+ double epr[4];
+ double egt[4];
+ double fuel_flow[4];
+ double oil_pressure[4];
- double nav1_freq;
- double nav1_radial;
- double nav1_course_dev;
+ double n1_turbine[4];
+ double n2_turbine[4];
+
+ // navigation data
+ // This will require a lot of related work to build the nav
+ // database for the ND and some msg traffic both ways to display
+ // and configure nav aids, freqs, courses, etc etc. OpenGC will
+ // most likely define an FMC to hold the database and do nav stuff
+ double nav1_freq;
+ double nav1_radial;
+ double nav1_course_dev;
+ double nav1_gs_dev;
+ double nav1_dme;
- double nav2_freq;
- double nav2_radial;
- double nav2_course_dev;
+ double nav2_freq;
+ double nav2_radial;
+ double nav2_course_dev;
+ double nav2_gs_dev;
+ double nav2_dme;
- // some other locations to add stuff in
+ // some other locations serving as place holders for user defined
+ // variables reduces the need to update FG or OpenGC code
+
double d_ogcdata[16];
float f_ogcdata[16];
int i_ogcdata[16];