From 5fdede6f75f61cef7673bdffbb5dd68c1610e4ab Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 19 Nov 1999 02:12:46 +0000 Subject: [PATCH] Revamped the "External" flight model. --- src/FDM/External.cxx | 49 ++++++++++++++++++++ src/FDM/External.hxx | 42 +++++++++++++++++ src/FDM/Makefile.am | 3 +- src/FDM/flight.cxx | 106 +------------------------------------------ 4 files changed, 94 insertions(+), 106 deletions(-) create mode 100644 src/FDM/External.cxx create mode 100644 src/FDM/External.hxx diff --git a/src/FDM/External.cxx b/src/FDM/External.cxx new file mode 100644 index 000000000..9284c9a46 --- /dev/null +++ b/src/FDM/External.cxx @@ -0,0 +1,49 @@ +// External.cxx -- interface to the "External"-ly driven flight model +// +// Written by Curtis Olson, started November 1999. +// +// Copyright (C) 1999 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 "External.hxx" + + +// Initialize the External flight model, dt is the time increment +// for each subsequent iteration through the EOM +int FGExternal::init( double dt ) { + // cout << "FGExternal::init()" << endl; + + // set valid time for this record + stamp_time(); + + return 1; +} + + +// Run an iteration of the EOM. This is essentially a NOP here +// because these values are getting filled in elsewhere based on +// external input. +int FGExternal::update( int multiloop ) { + // cout << "FGExternal::update()" << endl; + + // double time_step = (1.0 / current_options.get_model_hz()) * multiloop; + + + return 1; +} diff --git a/src/FDM/External.hxx b/src/FDM/External.hxx new file mode 100644 index 000000000..159615907 --- /dev/null +++ b/src/FDM/External.hxx @@ -0,0 +1,42 @@ +// External.hxx -- interface to the "External"-ly driven flight model +// +// Written by Curtis Olson, started November 1999. +// +// Copyright (C) 1999 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 _EXTERNAL_HXX +#define _EXTERNAL_HXX + + +#include "flight.hxx" + + +class FGExternal: public FGInterface { + +public: + // reset flight params to a specific position + int init( double dt ); + + // update position based on inputs, positions, velocities, etc. + int update( int multiloop ); +}; + + +#endif // _EXTERNAL_HXX diff --git a/src/FDM/Makefile.am b/src/FDM/Makefile.am index 597e43669..a70cf69ef 100644 --- a/src/FDM/Makefile.am +++ b/src/FDM/Makefile.am @@ -1,9 +1,10 @@ -SUBDIRS = Balloon External JSBsim LaRCsim +SUBDIRS = Balloon JSBsim LaRCsim noinst_LIBRARIES = libFlight.a libFlight_a_SOURCES = \ Balloon.cxx Balloon.h \ + External.cxx External.hxx \ flight.cxx flight.hxx \ JSBsim.cxx JSBsim.hxx \ LaRCsim.cxx LaRCsim.hxx \ diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index 57f73d937..2f33024b9 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -24,13 +24,13 @@ #include #include -#include #include #include #include
#include #include