The latest updates from John Wojnaroski.
This commit is contained in:
parent
26c6f3f407
commit
0b5594d50d
4 changed files with 86 additions and 46 deletions
|
@ -1,4 +1,8 @@
|
|||
// 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
|
||||
|
@ -60,6 +64,9 @@ static void collect_data( const FGInterface *fdm, ogcFGData *data ) {
|
|||
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();
|
||||
|
@ -73,19 +80,17 @@ static void collect_data( const FGInterface *fdm, ogcFGData *data ) {
|
|||
|
||||
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
|
||||
|
@ -150,3 +155,4 @@ bool FGOpenGC::close() {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
// 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
|
||||
|
@ -53,3 +58,4 @@ public:
|
|||
#endif // _FG_OPENGC_HXX
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
// 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
|
||||
|
@ -18,27 +24,37 @@
|
|||
// 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:
|
||||
|
||||
// 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;
|
||||
|
||||
// flight parameters
|
||||
|
||||
double pitch;
|
||||
double bank;
|
||||
double heading;
|
||||
double altitude;
|
||||
double altitude_agl;
|
||||
double altitude_agl; // this can also be the radar altimeter
|
||||
double v_kcas;
|
||||
double groundspeed;
|
||||
double vvi;
|
||||
double mach;
|
||||
|
||||
// position
|
||||
|
||||
|
@ -54,17 +70,29 @@ public:
|
|||
double fuel_flow[4];
|
||||
double oil_pressure[4];
|
||||
|
||||
// navigation data
|
||||
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_gs_dev;
|
||||
double nav2_dme;
|
||||
|
||||
// some other locations serving as place holders for user defined
|
||||
// variables reduces the need to update FG or OpenGC code
|
||||
|
||||
// some other locations to add stuff in
|
||||
double d_ogcdata[16];
|
||||
float f_ogcdata[16];
|
||||
int i_ogcdata[16];
|
||||
|
|
Loading…
Reference in a new issue