]> git.mxchange.org Git - flightgear.git/commitdiff
The latest updates from John Wojnaroski.
authorcurt <curt>
Sat, 15 Dec 2001 03:30:45 +0000 (03:30 +0000)
committercurt <curt>
Sat, 15 Dec 2001 03:30:45 +0000 (03:30 +0000)
src/Network/native_fdm.cxx
src/Network/opengc.cxx
src/Network/opengc.hxx
src/Network/opengc_data.hxx

index 1ffe850c1cb4df65a62ec0efe4d2a2ebedfa5d64..7d5ac289e84d9946f7fda24554e4f3992100699c 100644 (file)
@@ -80,9 +80,9 @@ static void raw2global( const FGRawFDM *raw, FGInterface *global ) {
        // 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 );
index c2524b49abf4070dfd6da7aaeb0848197e1655cb..bd3714f2480d9e4be8e45a6554dfb5acc5e4f257 100644 (file)
@@ -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,25 +80,23 @@ 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
 // 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(); 
@@ -150,3 +155,4 @@ bool FGOpenGC::close() {
 
     return true;
 }
+
index 33266cc6dbb70cf001402009acc70581546cfeae..fc065394f083b242d9c002a9586aa411799b98a7 100644 (file)
@@ -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
 
 
+
index f057139acc96bfa0764331fce600dc589c33238b..397c03b28224b2007ef4e5fbf9bd9216da87f1ec 100644 (file)
@@ -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
 // 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];