]> git.mxchange.org Git - flightgear.git/commitdiff
Add the "null" flight model which is a better name for what the "external"
authorcurt <curt>
Mon, 12 Nov 2001 04:49:06 +0000 (04:49 +0000)
committercurt <curt>
Mon, 12 Nov 2001 04:49:06 +0000 (04:49 +0000)
flightmodel used to be called.
Fixed wind (it was 180 degrees off).

src/FDM/Makefile.am
src/FDM/NullFDM.cxx [new file with mode: 0644]
src/FDM/NullFDM.hxx [new file with mode: 0644]
src/Include/config.h.in
src/Main/fg_init.cxx
src/Main/options.cxx

index 5a3bc036c1356cb8163077faf7d1082871c785fa..485dbf5d801862b245906b114400176b291df8a1 100644 (file)
@@ -11,7 +11,8 @@ libFlight_a_SOURCES = \
        JSBSim.cxx JSBSim.hxx \
        LaRCsim.cxx LaRCsim.hxx \
        LaRCsimIC.cxx LaRCsimIC.hxx \
-       MagicCarpet.cxx MagicCarpet.hxx
+       MagicCarpet.cxx MagicCarpet.hxx \
+       NullFDM.cxx NullFDM.hxx
 
 bin_PROGRAMS = pstest
 
diff --git a/src/FDM/NullFDM.cxx b/src/FDM/NullFDM.cxx
new file mode 100644 (file)
index 0000000..54b4102
--- /dev/null
@@ -0,0 +1,50 @@
+// NullFDM.hxx -- a do-nothing flight model, used as a placeholder if the
+//                action is externally driven.
+// Written by Curtis Olson, started November 1999.
+//
+// Copyright (C) 1999 - 2001  Curtis L. Olson  - curt@flightgear.org
+//
+// 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
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
+
+
+#include "NullFDM.hxx"
+
+
+FGNullFDM::FGNullFDM( double dt ) {
+    set_delta_t( dt );
+}
+
+
+FGNullFDM::~FGNullFDM() {
+}
+
+
+// Initialize the NullFDM flight model, dt is the time increment
+// for each subsequent iteration through the EOM
+void FGNullFDM::init() {
+    // cout << "FGNullFDM::init()" << endl;
+}
+
+
+// Run an iteration of the EOM.  This is a NOP here because the flight
+// model values are getting filled in elsewhere (most likely from some
+// external source.)
+bool FGNullFDM::update( int multiloop ) {
+    // cout << "FGNullFDM::update()" << endl;
+
+    return true;
+}
diff --git a/src/FDM/NullFDM.hxx b/src/FDM/NullFDM.hxx
new file mode 100644 (file)
index 0000000..94dd328
--- /dev/null
@@ -0,0 +1,46 @@
+// NullFDM.hxx -- a do-nothing flight model, used as a placeholder if the
+//                action is externally driven.
+//
+// Written by Curtis Olson, started November 1999.
+//
+// Copyright (C) 1999 - 2001  Curtis L. Olson  - curt@flightgear.org
+//
+// 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
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
+
+
+#ifndef _NULLFDM_HXX
+#define _NULLFDM_HXX
+
+
+#include "flight.hxx"
+
+
+class FGNullFDM: public FGInterface {
+
+public:
+    FGNullFDM::FGNullFDM( double dt );
+    FGNullFDM::~FGNullFDM();
+
+    // reset flight params to a specific position 
+    void init();
+
+    // update position based on inputs, positions, velocities, etc.
+    bool update( int multiloop );
+};
+
+
+#endif // _NULLFDM_HXX
index 3c18956c748fa862c84648c611c235b2e4acbc17..553a55a5ab56b72ca2443667ba237352e6cec159 100644 (file)
@@ -1,4 +1,4 @@
-/* src/Include/config.h.in.  Generated automatically from configure.in by autoheader.  */
+/* src/Include/config.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
 
 /* Define to empty if the keyword does not work.  */
 #undef const
index d39a224573d1f872b6a48898a9cea4f11f6105bd..4632eb3133ec3372f5a3686b7022c776bebc3b2a 100644 (file)
@@ -81,6 +81,7 @@
 #include <FDM/JSBSim.hxx>
 #include <FDM/LaRCsim.hxx>
 #include <FDM/MagicCarpet.hxx>
+#include <FDM/NullFDM.hxx>
 #include <Include/general.hxx>
 #include <Input/input.hxx>
 // #include <Joystick/joystick.hxx>
@@ -557,6 +558,8 @@ bool fgInitSubsystems( void ) {
            cur_fdm_state = new FGMagicCarpet( dt );
        } else if (model == "external") {
            cur_fdm_state = new FGExternal( dt );
+       } else if (model == "null") {
+           cur_fdm_state = new FGNullFDM( dt );
        } else {
            SG_LOG(SG_GENERAL, SG_ALERT,
                   "Unrecognized flight model '" << model
@@ -929,6 +932,8 @@ void fgReInitSubsystems( void )
            cur_fdm_state = new FGMagicCarpet( dt );
        } else if (model == "external") {
            cur_fdm_state = new FGExternal( dt );
+       } else if (model == "null") {
+           cur_fdm_state = new FGNullFDM( dt );
        } else {
            SG_LOG(SG_GENERAL, SG_ALERT,
                   "Unrecognized flight model '" << model
index 0662cf67699b6a603d7678ed99e86ac75f1be65c..1796c8cc0854c0070462c62bffd0252d67a43e4d 100644 (file)
@@ -876,7 +876,7 @@ parse_option (const string& arg)
 
         // convert to fps
        speed *= SG_NM_TO_METER * SG_METER_TO_FEET * (1.0/3600);
-       dir += 180;
+       // dir += 180;
        if (dir >= 360)
          dir -= 360;
        dir *= SGD_DEGREES_TO_RADIANS;
@@ -1086,7 +1086,7 @@ fgUsage ()
  
     cout << "Flight Model:" << endl;
     cout << "\t--fdm=abcd:  selects the core flight model code." << endl;
-    cout << "\t\tcan be one of jsb, larcsim, magic, external, balloon, or ada"
+    cout << "\t\tcan be one of jsb, larcsim, magic, null, external, balloon, or ada"
         << endl;
     cout << "\t--aircraft=abcd:  aircraft model to load" << endl;
     cout << "\t--model-hz=n:  run the FDM this rate (iterations per second)"