]> git.mxchange.org Git - flightgear.git/commitdiff
David Megginson made a few (mostly minor) mods to the LaRCsim files, and
authorcurt <curt>
Mon, 10 Apr 2000 20:09:40 +0000 (20:09 +0000)
committercurt <curt>
Mon, 10 Apr 2000 20:09:40 +0000 (20:09 +0000)
it's now possible to choose the LaRCsim model at runtime, as in

  fgfs --aircraft=c172

or

  fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747

I did this so that I could play with the UIUC stuff without losing
Tony's C172 with its flaps, etc.  I did my best to respect the design
of the LaRCsim code by staying in C, making only minimal changes, and
not introducing any dependencies on the rest of FlightGear.  The
modified files are attached.

23 files changed:
src/FDM/LaRCsim.cxx
src/FDM/LaRCsim/Makefile.am
src/FDM/LaRCsim/c172_aero.c
src/FDM/LaRCsim/c172_engine.c
src/FDM/LaRCsim/c172_gear.c
src/FDM/LaRCsim/c172_init.c
src/FDM/LaRCsim/c172_init.h
src/FDM/LaRCsim/cherokee_aero.c
src/FDM/LaRCsim/cherokee_engine.c
src/FDM/LaRCsim/cherokee_gear.c
src/FDM/LaRCsim/cherokee_init.c
src/FDM/LaRCsim/ls_init.c
src/FDM/LaRCsim/ls_init.h
src/FDM/LaRCsim/ls_interface.c
src/FDM/LaRCsim/ls_interface.h
src/FDM/LaRCsim/ls_model.c
src/FDM/LaRCsim/ls_model.h
src/FDM/LaRCsim/navion_aero.c
src/FDM/LaRCsim/navion_engine.c
src/FDM/LaRCsim/navion_gear.c
src/FDM/LaRCsim/navion_init.c
src/FDM/LaRCsim/navion_init.h
src/FDM/LaRCsim/uiuc_aero.c

index 2b8a250237af75c85ea8ba1a63c334c8ba58a57e..58fe14004f0c8ddab309e73cc0163214882e3cef 100644 (file)
@@ -50,7 +50,7 @@ int FGLaRCsim::init( double dt ) {
     copy_to_LaRCsim();
 
     // actual LaRCsim top level init
-    ls_toplevel_init( dt );
+    ls_toplevel_init( dt, (char *)current_options.get_aircraft().c_str() );
 
     FG_LOG( FG_FLIGHT, FG_INFO, "FG pos = " << 
            get_Latitude() );
index 255042dc4c0d1f78b0055ab525745cc9d9eaf430..8f5ba663ede3f172fd47d98324eb3b22bcef436f 100644 (file)
@@ -6,26 +6,11 @@ EXTRA_DIST = \
        navion_init.h \
        uiuc_aero.c
 
-if ENABLE_NAVION
-NAVION_MODEL = \
-       navion_aero.c navion_engine.c navion_gear.c navion_init.c navion_init.h
-else
-NAVION_MODEL =
-endif
-
-if ENABLE_C172
-C172_MODEL = c172_aero.c c172_engine.c c172_gear.c c172_init.c navion_init.h
-else
-C172_MODEL =
-endif
-
-if ENABLE_UIUC
-UIUC_MODEL = uiuc_aero.c c172_init.c navion_init.h
-else
-UIUC_MODEL =
-endif
-
-# AIRCRAFT_MODEL = cherokee_aero.c cherokee_engine.c cherokee_gear.c cherokee_init.c navion_init.h
+AIRCRAFT_MODEL =  c172_aero.c c172_engine.c c172_gear.c c172_init.c \
+                  navion_init.h  navion_aero.c navion_engine.c \
+                  navion_gear.c navion_init.c uiuc_aero.c \
+                  cherokee_aero.c cherokee_engine.c cherokee_gear.c \
+                  cherokee_init.c
 
 noinst_LIBRARIES = libLaRCsim.a
 
@@ -43,7 +28,7 @@ libLaRCsim_a_SOURCES = \
        ls_sim_control.h \
         ls_step.c ls_step.h \
        ls_sym.h ls_types.h \
-       $(NAVION_MODEL) $(C172_MODEL) $(UIUC_MODEL) \
+       $(AIRCRAFT_MODEL) \
        ls_interface.c ls_interface.h
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/src
index 04da35502faaeea5b0fd310b59ab2173d8048f5b..9ce8a54ea38a7320e399c86286ac35d6c7b4339c 100644 (file)
 extern COCKPIT cockpit_;
 
 
-SCALAR interp(SCALAR *y_table, SCALAR *x_table, int Ntable, SCALAR x)
+static SCALAR interp(SCALAR *y_table, SCALAR *x_table, int Ntable, SCALAR x)
 {
        SCALAR slope;
        int i=1;
@@ -141,7 +141,7 @@ SCALAR interp(SCALAR *y_table, SCALAR *x_table, int Ntable, SCALAR x)
 }      
                                
 
-void aero( SCALAR dt, int Initialize ) {
+void c172_aero( SCALAR dt, int Initialize ) {
   
   
   static int init = 0;
index 261395c75ab29db0a318bf8e76bf5759ae851412..8ab7b4502d70658d7ad8e4ba8d5939118e19b8a0 100644 (file)
@@ -69,7 +69,7 @@ $Header$
 
 extern SIM_CONTROL     sim_control_;
 
-void engine( SCALAR dt, int init ) {
+void c172_engine( SCALAR dt, int init ) {
     
        float v,h,pa;
        float bhp=160;
index 9bb23952da56ef3ddef1d74ae903ebd4a0edf9e5..1ea4cc6cc213e86f92473a4a6efed4d81a70b476 100644 (file)
 
 $Header$
 $Log$
+Revision 1.14  2000/04/10 18:09:41  curt
+David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+it's now possible to choose the LaRCsim model at runtime, as in
+
+  fgfs --aircraft=c172
+
+or
+
+  fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+
+I did this so that I could play with the UIUC stuff without losing
+Tony's C172 with its flaps, etc.  I did my best to respect the design
+of the LaRCsim code by staying in C, making only minimal changes, and
+not introducing any dependencies on the rest of FlightGear.  The
+modified files are attached.
+
 Revision 1.13  1999/12/13 20:43:41  curt
 Updates from Tony.
 
@@ -70,47 +86,47 @@ Updates from Tony.
 #define HEIGHT_AGL_WHEEL d_wheel_rwy_local_v[2]
 
 
-sub3( DATA v1[],  DATA v2[], DATA result[] )
+static sub3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] - v2[0];
     result[1] = v1[1] - v2[1];
     result[2] = v1[2] - v2[2];
 }
 
-add3( DATA v1[],  DATA v2[], DATA result[] )
+static add3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] + v2[0];
     result[1] = v1[1] + v2[1];
     result[2] = v1[2] + v2[2];
 }
 
-cross3( DATA v1[],  DATA v2[], DATA result[] )
+static cross3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[1]*v2[2] - v1[2]*v2[1];
     result[1] = v1[2]*v2[0] - v1[0]*v2[2];
     result[2] = v1[0]*v2[1] - v1[1]*v2[0];
 }
 
-multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
     result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
     result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
 }
 
-mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
     result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
     result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
 }
 
-clear3( DATA v[] )
+static clear3( DATA v[] )
 {
     v[0] = 0.; v[1] = 0.; v[2] = 0.;
 }
 
-gear()
+c172_gear()
 {
 char rcsid[] = "$Id$";
 #define NUM_WHEELS 4
index 63cce23087d22aaaf4233f7429446f4ec74654b4..3f3be9d57d2d79dcad2a4d55df2afaf7905a73e0 100644 (file)
@@ -62,7 +62,7 @@
 #include "ls_constants.h"
 #include "c172_aero.h"
 
-void model_init( void ) {
+void c172_init( void ) {
 
   Throttle[3] = 0.2; 
   
index f7d097e14f1ccfea8b68ab00cc663507755ad451..a4867d28be22d1a91198c2e9a139c8b740a37360 100644 (file)
@@ -1,11 +1,11 @@
 /* a quick navion_init.h */
 
 
-#ifndef _NAVION_INIT_H
-#define _NAVION_INIT_H
+#ifndef _C172_INIT_H
+#define _C172_INIT_H
 
 
-void model_init( void );
+void c172_init( void );
 
 
-#endif _NAVION_INIT_H
+#endif _C172_INIT_H
index 665f80cc2f07d9590e8a1360ff14e6cf71d18084..19b9b219b581f0c59f65310462e28c6e693b9d02 100644 (file)
@@ -66,7 +66,7 @@ This source is not checked in this configuration in any way.
 
 
 
-void aero()
+void cherokee_aero()
 /*float ** Cherokee (float t, VectorStanja &X, float *U)*/
 {
        static float
index e67a8b9b95ceceb21bf56dc8c04fe64b1904f770..3b55ca28e30ebb2d3332c15f2aa09011395638bb 100644 (file)
@@ -36,7 +36,7 @@ This source is not checked in this configuration in any way.
 
 
 
-void engine( SCALAR dt, int init )
+void cherokee_engine( SCALAR dt, int init )
 {
 
        static float
index c7fa3ba2961f3bc945d289bceeb3fbabf8079bc7..27cf80cc64c7fd68b83fb36e0a02d98cc3809d8f 100644 (file)
 
 $Header$
 $Log$
-Revision 1.1  1999/06/17 18:07:34  curt
-Initial revision
+Revision 1.2  2000/04/10 18:09:41  curt
+David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+it's now possible to choose the LaRCsim model at runtime, as in
+
+  fgfs --aircraft=c172
+
+or
+
+  fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+
+I did this so that I could play with the UIUC stuff without losing
+Tony's C172 with its flaps, etc.  I did my best to respect the design
+of the LaRCsim code by staying in C, making only minimal changes, and
+not introducing any dependencies on the rest of FlightGear.  The
+modified files are attached.
+
+Revision 1.1.1.1  1999/06/17 18:07:34  curt
+Start of 0.7.x branch
 
 Revision 1.1.1.1  1999/04/05 21:32:45  curt
 Start of 0.6.x branch.
@@ -71,47 +87,47 @@ Start of 0.6.x branch.
 #include "ls_cockpit.h"
 
 
-void sub3( DATA v1[],  DATA v2[], DATA result[] )
+static void sub3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] - v2[0];
     result[1] = v1[1] - v2[1];
     result[2] = v1[2] - v2[2];
 }
 
-void add3( DATA v1[],  DATA v2[], DATA result[] )
+static void add3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] + v2[0];
     result[1] = v1[1] + v2[1];
     result[2] = v1[2] + v2[2];
 }
 
-void cross3( DATA v1[],  DATA v2[], DATA result[] )
+static void cross3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[1]*v2[2] - v1[2]*v2[1];
     result[1] = v1[2]*v2[0] - v1[0]*v2[2];
     result[2] = v1[0]*v2[1] - v1[1]*v2[0];
 }
 
-void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
     result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
     result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
 }
 
-void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
     result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
     result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
 }
 
-void clear3( DATA v[] )
+static void clear3( DATA v[] )
 {
     v[0] = 0.; v[1] = 0.; v[2] = 0.;
 }
 
-void gear()
+void cherokee_gear()
 {
 char rcsid[] = "$Id$";
 
index 23ce529152ebc1c496b6269e523eb06e9717aa7b..8581da87febc44e253fae61ea14282598247b24f 100644 (file)
@@ -48,7 +48,7 @@
 #include "ls_generic.h"
 #include "ls_cockpit.h"
 
-void model_init( void )
+void cherokee_init( void )
 {
 
   Throttle[3] = 0.2; Rudder_pedal = 0; Lat_control = 0; Long_control = 0;
index 9601bc994ee0c7c25c21ad1b4a21fa5adea830e0..22472411803247ed630436871167e54780939bc6 100644 (file)
 
 $Header$
 $Log$
-Revision 1.1  1999/06/17 18:07:34  curt
-Initial revision
+Revision 1.2  2000/04/10 18:09:41  curt
+David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+it's now possible to choose the LaRCsim model at runtime, as in
+
+  fgfs --aircraft=c172
+
+or
+
+  fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+
+I did this so that I could play with the UIUC stuff without losing
+Tony's C172 with its flaps, etc.  I did my best to respect the design
+of the LaRCsim code by staying in C, making only minimal changes, and
+not introducing any dependencies on the rest of FlightGear.  The
+modified files are attached.
+
+Revision 1.1.1.1  1999/06/17 18:07:34  curt
+Start of 0.7.x branch
 
 Revision 1.1.1.1  1999/04/05 21:32:45  curt
 Start of 0.6.x branch.
@@ -112,6 +128,7 @@ static char rcsid[] = "$Id$";
 #include "ls_step.h"
 #include "ls_init.h"
 #include "navion_init.h"
+#include "ls_model.h"
 
 /* temp */
 #include "ls_generic.h"
@@ -200,11 +217,28 @@ void ls_init_init( void ) {
     */
 }
 
-void ls_init( void ) {
+void ls_init( char * aircraft ) {
     /* int i; */
 
     Simtime = 0;
 
+    if (!strcasecmp(aircraft, "c172")) {
+      printf("Initializing LaRCsim for C172\n");
+      current_model = C172;
+    } else if (!strcasecmp(aircraft, "navion")) {
+      printf("Initializing LaRCsim for Navion\n");
+      current_model = NAVION;
+    } else if (!strcasecmp(aircraft, "cherokee")) {
+      printf("Initializing LaRCsim for Cherokee\n");
+      current_model = CHEROKEE;
+    } else if (!strcasecmp(aircraft, "uiuc")) {
+      printf("Initializing LaRCsim for UIUC models\n");
+      current_model = UIUC;
+    } else {
+      printf("Unknown LaRCsim aircraft: %s; defaulting to C172\n", aircraft);
+      current_model = C172;
+    }
+
     /* printf("LS in init() pos = %.2f\n", Latitude); */
 
     ls_init_init();
@@ -224,8 +258,21 @@ void ls_init( void ) {
            ls_set_sym_val( &Discrete_States[i].Symbol, 
                            (double) Discrete_States[i].value );
     */
-  
-    model_init();
+
+    switch (current_model) {
+    case NAVION:
+      navion_init();
+      break;
+    case C172:
+      c172_init();
+      break;
+    case CHEROKEE:
+      cherokee_init();
+      break;
+    case UIUC:
+      c172_init();
+      break;
+    }
 
     /* printf("LS after model_init() pos = %.2f\n", Latitude); */
 
index 06188f432b1d8016949ff8b5d4033cb225f93f58..94991cf90495ade5f4e721796fcb9a0fd8259b75 100644 (file)
@@ -5,7 +5,7 @@
 #define _LS_INIT_H
 
 
-void ls_init( void );
+void ls_init( char * aircraft );
 
 
 #endif /* _LS_INIT_H */
index bf5bc196177255cc94a2b1f8b605b92a5e94760f..f95ff9b4afa6e53d2760cfe147f3b1b7132822e6 100644 (file)
@@ -521,7 +521,7 @@ int ls_cockpit( void ) {
 
 /* Initialize the LaRCsim flight model, dt is the time increment for
    each subsequent iteration through the EOM */
-int ls_toplevel_init(double dt) {
+int ls_toplevel_init(double dt, char * aircraft) {
     model_dt = dt;
 
     ls_setdefopts();           /* set default options */
@@ -535,7 +535,7 @@ int ls_toplevel_init(double dt) {
 
     /* printf("LS pre Init pos = %.2f\n", Latitude); */
 
-    ls_init();
+    ls_init(aircraft);
 
     /* printf("LS post Init pos = %.2f\n", Latitude); */
 
@@ -575,8 +575,24 @@ int ls_ForceAltitude(double alt_feet) {
 /* Flight Gear Modification Log
  *
  * $Log$
- * Revision 1.1  1999/06/17 18:07:33  curt
- * Initial revision
+ * Revision 1.2  2000/04/10 18:09:41  curt
+ * David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+ * it's now possible to choose the LaRCsim model at runtime, as in
+ *
+ *   fgfs --aircraft=c172
+ *
+ * or
+ *
+ *   fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+ *
+ * I did this so that I could play with the UIUC stuff without losing
+ * Tony's C172 with its flaps, etc.  I did my best to respect the design
+ * of the LaRCsim code by staying in C, making only minimal changes, and
+ * not introducing any dependencies on the rest of FlightGear.  The
+ * modified files are attached.
+ *
+ * Revision 1.1.1.1  1999/06/17 18:07:33  curt
+ * Start of 0.7.x branch
  *
  * Revision 1.2  1999/04/27 19:28:04  curt
  * Changes for the MacOS port contributed by Darrell Walisser.
index b5b11055953f60fbd9dad5294d010d56b4e98534..7b1911544c785aa7f0b14ac9e5775f251d3ec860 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
 
 
 /* reset flight params to a specific position */ 
-int ls_toplevel_init(double dt);
+int ls_toplevel_init(double dt, char * aircraft);
 
 /* update position based on inputs, positions, velocities, etc. */
 int ls_update(int multiloop);
@@ -65,8 +65,24 @@ int ls_ForceAltitude(double alt_feet);
 
 
 // $Log$
-// Revision 1.1  1999/06/17 18:07:33  curt
-// Initial revision
+// Revision 1.2  2000/04/10 18:09:41  curt
+// David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+// it's now possible to choose the LaRCsim model at runtime, as in
+//
+//   fgfs --aircraft=c172
+//
+// or
+//
+//   fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+//
+// I did this so that I could play with the UIUC stuff without losing
+// Tony's C172 with its flaps, etc.  I did my best to respect the design
+// of the LaRCsim code by staying in C, making only minimal changes, and
+// not introducing any dependencies on the rest of FlightGear.  The
+// modified files are attached.
+//
+// Revision 1.1.1.1  1999/06/17 18:07:33  curt
+// Start of 0.7.x branch
 //
 // Revision 1.1.1.1  1999/04/05 21:32:45  curt
 // Start of 0.6.x branch.
index a9fcd706ff092c1d3216c3f272244e99ca211c09..0a5da7d1db7f0c56648dc74049cc2838a7f4b593 100644 (file)
        CURRENT RCS HEADER INFO:
 $Header$
 $Log$
-Revision 1.1  1999/06/17 18:07:33  curt
-Initial revision
+Revision 1.2  2000/04/10 18:09:41  curt
+David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+it's now possible to choose the LaRCsim model at runtime, as in
+
+  fgfs --aircraft=c172
+
+or
+
+  fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+
+I did this so that I could play with the UIUC stuff without losing
+Tony's C172 with its flaps, etc.  I did my best to respect the design
+of the LaRCsim code by staying in C, making only minimal changes, and
+not introducing any dependencies on the rest of FlightGear.  The
+modified files are attached.
+
+Revision 1.1.1.1  1999/06/17 18:07:33  curt
+Start of 0.7.x branch
 
 Revision 1.1.1.1  1999/04/05 21:32:45  curt
 Start of 0.6.x branch.
@@ -90,11 +106,38 @@ Initial Flight Gear revision.
 #include "ls_model.h"
 #include "default_model_routines.h"
 
+Model current_model;
+
 
 void ls_model( SCALAR dt, int Initialize ) {
-    inertias( dt, Initialize );
-    subsystems( dt, Initialize );
-    aero( dt, Initialize );
-    engine( dt, Initialize );
-    gear( dt, Initialize );
+    switch (current_model) {
+    case NAVION:
+      inertias( dt, Initialize );
+      subsystems( dt, Initialize );
+      navion_aero( dt, Initialize );
+      navion_engine( dt, Initialize );
+      navion_gear( dt, Initialize );
+      break;
+    case C172:
+      inertias( dt, Initialize );
+      subsystems( dt, Initialize );
+      c172_aero( dt, Initialize );
+      c172_engine( dt, Initialize );
+      c172_gear( dt, Initialize );
+      break;
+    case CHEROKEE:
+      inertias( dt, Initialize );
+      subsystems( dt, Initialize );
+      cherokee_aero( dt, Initialize );
+      cherokee_engine( dt, Initialize );
+      cherokee_gear( dt, Initialize );
+      break;
+    case UIUC:
+      inertias( dt, Initialize );
+      subsystems( dt, Initialize );
+      uiuc_aero( dt, Initialize );
+      uiuc_engine( dt, Initialize );
+      uiuc_gear( dt, Initialize );
+      break;
+    }
 }
index cb0d0321fcad90f2c1ebcefe227425cc22e6ca16..9dfb636043cbff177ed440bf400202f04e70acc9 100644 (file)
@@ -4,6 +4,15 @@
 #ifndef _LS_MODEL_H
 #define _LS_MODEL_H
 
+typedef enum {
+  NAVION,
+  C172,
+  CHEROKEE,
+  UIUC
+} Model;
+
+extern Model current_model;
+
 
 void ls_model( SCALAR dt, int Initialize );
 
index 6839e457c37de4371875bd3bd9c878522ce34a91..9ea3f921a1c682c396a5e85b6606f1a5a615a622 100644 (file)
@@ -112,7 +112,7 @@ ring is given below:
 extern COCKPIT cockpit_;
 
 
-void aero( SCALAR dt, int Initialize ) {
+void navion_aero( SCALAR dt, int Initialize ) {
   static int init = 0;
 
   SCALAR u, w;
index d1ae9018ee8d8337c16ed4ca1f013a92739bdd84..0870a83572150794ed3bd4f23efb2a218d8e09f1 100644 (file)
@@ -66,7 +66,7 @@ $Header$
 
 extern SIM_CONTROL     sim_control_;
 
-void engine( SCALAR dt, int init ) {
+void navion_engine( SCALAR dt, int init ) {
     /* if (init) { */
     Throttle[3] = Throttle_pct;
     /* } */
index 8959fe3ea9707c46df17c48ada9c2cdb08edc45b..91de63c52cfea6bc50069c84b4e61c7697064c30 100644 (file)
 
 $Header$
 $Log$
-Revision 1.1  1999/06/17 18:07:34  curt
-Initial revision
+Revision 1.2  2000/04/10 18:09:41  curt
+David Megginson made a few (mostly minor) mods to the LaRCsim files, and
+it's now possible to choose the LaRCsim model at runtime, as in
+
+  fgfs --aircraft=c172
+
+or
+
+  fgfs --aircraft=uiuc --aircraft-dir=Aircraft-uiuc/Boeing747
+
+I did this so that I could play with the UIUC stuff without losing
+Tony's C172 with its flaps, etc.  I did my best to respect the design
+of the LaRCsim code by staying in C, making only minimal changes, and
+not introducing any dependencies on the rest of FlightGear.  The
+modified files are attached.
+
+Revision 1.1.1.1  1999/06/17 18:07:34  curt
+Start of 0.7.x branch
 
 Revision 1.1.1.1  1999/04/05 21:32:45  curt
 Start of 0.6.x branch.
@@ -93,47 +109,47 @@ Initial Flight Gear revision.
 #include "ls_cockpit.h"
 
 
-void sub3( DATA v1[],  DATA v2[], DATA result[] )
+static void sub3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] - v2[0];
     result[1] = v1[1] - v2[1];
     result[2] = v1[2] - v2[2];
 }
 
-void add3( DATA v1[],  DATA v2[], DATA result[] )
+static void add3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] + v2[0];
     result[1] = v1[1] + v2[1];
     result[2] = v1[2] + v2[2];
 }
 
-void cross3( DATA v1[],  DATA v2[], DATA result[] )
+static void cross3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[1]*v2[2] - v1[2]*v2[1];
     result[1] = v1[2]*v2[0] - v1[0]*v2[2];
     result[2] = v1[0]*v2[1] - v1[1]*v2[0];
 }
 
-void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
     result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
     result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
 }
 
-void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
     result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
     result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
 }
 
-void clear3( DATA v[] )
+static void clear3( DATA v[] )
 {
     v[0] = 0.; v[1] = 0.; v[2] = 0.;
 }
 
-void gear( SCALAR dt, int Initialize ) {
+void navion_gear( SCALAR dt, int Initialize ) {
 char rcsid[] = "$Id$";
 
   /*
index 286c11d1a5ac9ee6af3f92dd3ec16db4cd8e58e3..2f7c6e483e7b31f316032490e086c81a0dc991f0 100644 (file)
@@ -60,7 +60,7 @@
 #include "ls_generic.h"
 #include "ls_cockpit.h"
 
-void model_init( void ) {
+void navion_init( void ) {
 
   Throttle[3] = 0.2; Rudder_pedal = 0; Lat_control = 0; Long_control = 0;
   
index f7d097e14f1ccfea8b68ab00cc663507755ad451..0bb54a8230b9aa59ea44153b7678ce14ff8677cd 100644 (file)
@@ -5,7 +5,7 @@
 #define _NAVION_INIT_H
 
 
-void model_init( void );
+void navion_init( void );
 
 
 #endif _NAVION_INIT_H
index bf6b12c89c8f379c474aa0581ce80eb624815ee3..e33c3b8c1ec67b209791cfa4f457c04474aee895 100644 (file)
@@ -57,7 +57,7 @@
 #include <FDM/UIUCModel/uiuc_wrapper.h>
 
 
-void aero( SCALAR dt, int Initialize ) 
+void uiuc_aero( SCALAR dt, int Initialize ) 
 {
     static int init = 0;
 
@@ -71,7 +71,7 @@ void aero( SCALAR dt, int Initialize )
 }
 
 
-void engine( SCALAR dt, int Initialize ) 
+void uiuc_engine( SCALAR dt, int Initialize ) 
 {
     uiuc_engine_routine();
 }
@@ -81,47 +81,47 @@ void engine( SCALAR dt, int Initialize )
  * added later and the choice of the gear model could be specified at
  * runtime.
  * ***********************************************************************/
-sub3( DATA v1[],  DATA v2[], DATA result[] )
+static sub3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] - v2[0];
     result[1] = v1[1] - v2[1];
     result[2] = v1[2] - v2[2];
 }
 
-add3( DATA v1[],  DATA v2[], DATA result[] )
+static add3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] + v2[0];
     result[1] = v1[1] + v2[1];
     result[2] = v1[2] + v2[2];
 }
 
-cross3( DATA v1[],  DATA v2[], DATA result[] )
+static cross3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[1]*v2[2] - v1[2]*v2[1];
     result[1] = v1[2]*v2[0] - v1[0]*v2[2];
     result[2] = v1[0]*v2[1] - v1[1]*v2[0];
 }
 
-multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
     result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
     result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
 }
 
-mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
+static mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
     result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
     result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
 }
 
-clear3( DATA v[] )
+static clear3( DATA v[] )
 {
     v[0] = 0.; v[1] = 0.; v[2] = 0.;
 }
 
-gear()
+uiuc_gear()
 {
 char rcsid[] = "$Id$";