HISTORY: 01/26/2000 initial release
03/09/2001 (DPM) added support for gear
06/18/2001 (RD) Made uiuc_recorder its own routine.
- 07/19/2001 (RD) Added uiuc_vel_init() to initialize
- the velocities.
- 08/27/2001 (RD) Added uiuc_initial_init() to help
- in starting an A/C at an initial condition
- 02/24/2002 (GD) Added uiuc_network_routine()
- 03/27/2002 (RD) Changed how forces are calculated when
- body-axis is used
+ 07/19/2001 (RD) Added uiuc_vel_init() to initialize
+ the velocities.
+ 08/27/2001 (RD) Added uiuc_initial_init() to help
+ in starting an A/C at an initial condition
+ 02/24/2002 (GD) Added uiuc_network_routine()
+ 03/27/2002 (RD) Changed how forces are calculated when
+ body-axis is used
12/11/2002 (RD) Divided uiuc_network_routine into
uiuc_network_recv_routine and
uiuc_network_send_routine
AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
Robert Deters <rdeters@uiuc.edu>
- Glen Dimock <dimock@uiuc.edu>
+ Glen Dimock <dimock@uiuc.edu>
David Megginson <david@megginson.com>
----------------------------------------------------------------------
# include <config.h>
#endif
+#include <iostream>
+#include <cstring>
+
#include <simgear/compiler.h>
#include <simgear/misc/sg_path.hxx>
-#include <Aircraft/aircraft.hxx>
#include <Main/fg_props.hxx>
#include "uiuc_aircraft.h"
//#include "uiuc_network.h"
#include "uiuc_get_flapper.h"
-SG_USING_STD(cout);
-SG_USING_STD(endl);
-
extern "C" void uiuc_initial_init ();
extern "C" void uiuc_defaults_inits ();
extern "C" void uiuc_vel_init ();
extern "C" void uiuc_network_recv_routine();
extern "C" void uiuc_network_send_routine();
-AIRCRAFT *aircraft_ = new AIRCRAFT;
+AIRCRAFT *aircraft_ = 0;
// SendArray testarray(4950);
void uiuc_defaults_inits ()
{
+ if (aircraft_ == 0)
+ aircraft_ = new AIRCRAFT;
+
// set defaults and initialize (called once from uiuc_init_2_wrapper)
//fog inits
{
// Initializes the UIUC aircraft model.
// Called once from uiuc_init_2_wrapper
- SGPath path(globals->get_fg_root());
- path.append(fgGetString("/sim/aircraft-dir"));
+ SGPath path(fgGetString("/sim/aircraft-dir"));
path.append("aircraft.dat");
- cout << "We are using "<< path.str() << endl;
+ std::cout << "We are using "<< path.str() << std::endl;
uiuc_initializemaps(); // Initialize the <string,int> maps
uiuc_menu(path.str()); // Read the specified aircraft file
}