]> git.mxchange.org Git - flightgear.git/commitdiff
Stubbed in a new flight model called "External" which is expected to be driven
authorcurt <curt>
Fri, 4 Dec 1998 01:29:37 +0000 (01:29 +0000)
committercurt <curt>
Fri, 4 Dec 1998 01:29:37 +0000 (01:29 +0000)
from some external source.

FDM/Makefile.am
FDM/flight.cxx
FDM/flight.hxx

index 3d8eec007bfc68e9f67043200fcbf48995c47250..015e2bf8a74fb26ff5e7afca08898fc51f47311c 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS        = LaRCsim Slew
+SUBDIRS        = External LaRCsim Slew
 
 noinst_LIBRARIES = libFlight.a
 
index 6a3004840b7723b39a738e7fb74e65825a1777bb..ddaf49615a20150da7d0affc6b0a6436c03c67bf 100644 (file)
@@ -28,6 +28,7 @@
 #include "LaRCsim.hxx"
 
 #include <Debug/logstream.hxx>
+#include <Flight/External/external.hxx>
 #include <Flight/LaRCsim/ls_interface.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_geodesy.hxx>
 fgFLIGHT cur_flight_params;
 
 
-/* Initialize the flight model parameters */
+// Initialize the flight model parameters
 int fgFlightModelInit(int model, fgFLIGHT& f, double dt) {
     double save_alt = 0.0;
     int result;
 
     FG_LOG( FG_FLIGHT ,FG_INFO, "Initializing flight model" );
 
-    if ( model == FG_SLEW ) {
+    if ( model == fgFLIGHT::FG_SLEW ) {
        // fgSlewInit(dt);
-    } else if ( model == FG_LARCSIM ) {
-       /* lets try to avoid really screwing up the LaRCsim model */
+    } else if ( model == fgFLIGHT::FG_LARCSIM ) {
+       // lets try to avoid really screwing up the LaRCsim model
        if ( f.get_Altitude() < -9000.0 ) {
            save_alt = f.get_Altitude();
            f.set_Altitude( 0.0 );
        }
 
-       fgFlight_2_LaRCsim(f);  /* translate FG to LaRCsim structure */
+       fgFlight_2_LaRCsim(f);  // translate FG to LaRCsim structure
        fgLaRCsimInit(dt);
        FG_LOG( FG_FLIGHT, FG_INFO, "FG pos = " << f.get_Latitude() );
-       fgLaRCsim_2_Flight(f);  /* translate LaRCsim back to FG structure */
+       fgLaRCsim_2_Flight(f);  // translate LaRCsim back to FG structure
 
-       /* but lets restore our original bogus altitude when we are done */
+       // but lets restore our original bogus altitude when we are done
        if ( save_alt < -9000.0 ) {
            f.set_Altitude( save_alt );
        }
+    } else if ( model == fgFLIGHT::FG_EXTERNAL ) {
+       fgExternalInit(f, dt);
     } else {
        FG_LOG( FG_FLIGHT, FG_WARN,
                  "Unimplemented flight model == " << model );
@@ -72,7 +75,7 @@ int fgFlightModelInit(int model, fgFLIGHT& f, double dt) {
 }
 
 
-/* Run multiloop iterations of the flight model */
+// Run multiloop iterations of the flight model
 int fgFlightModelUpdate(int model, fgFLIGHT& f, int multiloop) {
     double time_step, start_elev, end_elev;
     int result;
@@ -81,10 +84,12 @@ int fgFlightModelUpdate(int model, fgFLIGHT& f, int multiloop) {
     time_step = (1.0 / DEFAULT_MODEL_HZ) * multiloop;
     start_elev = f.get_Altitude();
 
-    if ( model == FG_SLEW ) {
+    if ( model == fgFLIGHT::FG_SLEW ) {
        // fgSlewUpdate(f, multiloop);
-    } else if ( model == FG_LARCSIM ) {
+    } else if ( model == fgFLIGHT::FG_LARCSIM ) {
        fgLaRCsimUpdate(f, multiloop);
+    } else if ( model == fgFLIGHT::FG_EXTERNAL ) {
+       // fgExternalUpdate(f, multiloop);
     } else {
        FG_LOG( FG_FLIGHT, FG_WARN,
                "Unimplemented flight model == " <<  model );
@@ -101,7 +106,7 @@ int fgFlightModelUpdate(int model, fgFLIGHT& f, int multiloop) {
 }
 
 
-/* Set the altitude (force) */
+// Set the altitude (force)
 void fgFlightModelSetAltitude(int model, fgFLIGHT& f, double alt_meters) {
     double sea_level_radius_meters;
     double lat_geoc;
@@ -113,8 +118,8 @@ void fgFlightModelSetAltitude(int model, fgFLIGHT& f, double alt_meters) {
     f.set_Radius_to_vehicle( f.get_Altitude() + 
                              (sea_level_radius_meters * METER_TO_FEET) );
 
-    /* additional work needed for some flight models */
-    if ( model == FG_LARCSIM ) {
+    // additional work needed for some flight models
+    if ( model == fgFLIGHT::FG_LARCSIM ) {
        ls_ForceAltitude( f.get_Altitude() );
     }
 
@@ -122,6 +127,10 @@ void fgFlightModelSetAltitude(int model, fgFLIGHT& f, double alt_meters) {
 
 
 // $Log$
+// Revision 1.5  1998/12/04 01:29:39  curt
+// Stubbed in a new flight model called "External" which is expected to be driven
+// from some external source.
+//
 // Revision 1.4  1998/12/03 01:16:40  curt
 // Converted fgFLIGHT to a class.
 //
index 24301e71a210aec0a795232a4ac637c1d52719a8..bbedb8940873544069531a398ab9f865f50ffe04 100644 (file)
 #endif                                   
 
 
-// Define the various supported flight models (most not yet implemented)
-
-enum fgFlightModelKind {
-    // Slew (in MS terminology)
-    FG_SLEW = 0,
-
-    // The only "real" model that is currently implemented
-    FG_LARCSIM = 1,
-
-    FG_ACM = 2,
-    FG_SUPER_SONIC = 3,
-    FG_HELICOPTER = 4,
-    FG_AUTOGYRO = 5,
-    FG_BALLOON = 6,
-    FG_PARACHUTE = 7,
-
-    // Driven externally via a serial port, net, file, etc.
-    FG_EXTERN = 8
-};
-
-
 typedef double FG_VECTOR_3[3];
 
 
@@ -63,6 +42,25 @@ class fgFLIGHT {
 
 public:
 
+    // Define the various supported flight models (many not yet implemented)
+    enum {
+       // Slew (in MS terminology)
+       FG_SLEW = 0,
+       
+       // The only "real" model that is currently implemented
+       FG_LARCSIM = 1,
+
+       FG_ACM = 2,
+       FG_SUPER_SONIC = 3,
+       FG_HELICOPTER = 4,
+       FG_AUTOGYRO = 5,
+       FG_BALLOON = 6,
+       FG_PARACHUTE = 7,
+
+       // Driven externally via a serial port, net, file, etc.
+       FG_EXTERNAL = 8
+    };
+
 /*================== Mass properties and geometry values ==================*/
 
     // Inertias
@@ -748,6 +746,10 @@ void fgFlightModelSetAltitude(int model, fgFLIGHT& f, double alt_meters);
 
 
 // $Log$
+// Revision 1.5  1998/12/04 01:29:40  curt
+// Stubbed in a new flight model called "External" which is expected to be driven
+// from some external source.
+//
 // Revision 1.4  1998/12/03 04:25:03  curt
 // Working on fixing up new fgFLIGHT class.
 //