]> git.mxchange.org Git - flightgear.git/commitdiff
Remove current_aircraft global, fgAIRCRAFT struct, and dead code for reading aircraft...
authorJames Turner <zakalawe@mac.com>
Thu, 1 Jul 2010 21:33:51 +0000 (22:33 +0100)
committerJames Turner <zakalawe@mac.com>
Thu, 1 Jul 2010 21:33:51 +0000 (22:33 +0100)
23 files changed:
src/Aircraft/aircraft.cxx
src/Aircraft/aircraft.hxx
src/Cockpit/cockpit.cxx
src/Cockpit/cockpit.hxx
src/Cockpit/hud.cxx
src/Cockpit/hud.hxx
src/Cockpit/hud_rwy.cxx
src/Environment/environment_mgr.cxx
src/FDM/JSBSim/JSBSim.cxx
src/FDM/JSBSim/JSBSim.hxx
src/FDM/LaRCsim/LaRCsim.cxx
src/FDM/SP/BalloonSim.cpp
src/FDM/UIUCModel/uiuc_gear.cpp
src/FDM/UIUCModel/uiuc_recorder.cpp
src/FDM/UIUCModel/uiuc_wrapper.cpp
src/Instrumentation/HUD/HUD_runway.cxx
src/Instrumentation/kr_87.cxx
src/Instrumentation/kt_70.cxx
src/Main/fg_commands.cxx
src/Main/fg_init.cxx
src/Main/main.cxx
src/Main/renderer.cxx
src/Network/jsclient.cxx

index 91e93b276ba44de7105bfd356dc58572d5b24955..26b3502fe62d447c32d0a2ff8aaaec38c3137405 100644 (file)
 
 #include "aircraft.hxx"
 
-
-// This is a record containing all the info for the aircraft currently
-// being operated
-fgAIRCRAFT current_aircraft;
-
-
-// Initialize an Aircraft structure
-void fgAircraftInit( void ) {
-    SG_LOG( SG_AIRCRAFT, SG_INFO, "Initializing Aircraft structure" );
-
-    current_aircraft.controls = globals->get_controls();
-}
-
-
-// Display various parameters to stdout
-void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
-    FlightProperties f;
-
-    SG_LOG( SG_FLIGHT, SG_DEBUG,
-            "Pos = ("
-           << (f.get_Longitude() * 3600.0 * SGD_RADIANS_TO_DEGREES) << "," 
-           << (f.get_Latitude()  * 3600.0 * SGD_RADIANS_TO_DEGREES) << ","
-           << f.get_Altitude() 
-           << ")  (Phi,Theta,Psi)=("
-           << f.get_Phi() << "," 
-           << f.get_Theta() << "," 
-           << f.get_Psi() << ")" );
-
-    SG_LOG( SG_FLIGHT, SG_DEBUG,
-           "Kts = " << f.get_V_equiv_kts() 
-           << "  Elev = " << globals->get_controls()->get_elevator() 
-           << "  Aileron = " << globals->get_controls()->get_aileron() 
-           << "  Rudder = " << globals->get_controls()->get_rudder() 
-           << "  Power = " << globals->get_controls()->get_throttle( 0 ) );
-}
-
-
 // Show available aircraft types
 void fgReadAircraft(void) {
 
@@ -137,7 +100,7 @@ void fgReadAircraft(void) {
 
    ulCloseDir(dirp);
 
-   globals->get_commands()->addCommand("load-aircraft", fgLoadAircraft);
+   
 }
 
 bool
@@ -212,7 +175,7 @@ fgLoadAircraft (const SGPropertyNode * arg)
     fgInitPosition();
 
     // Update the HUD
-    fgHUDInit(&current_aircraft);
+    fgHUDInit();
 
     SGTime *t = globals->get_time_params();
     delete t;
index f28bb4c22275b19008eaebb39423c4b8c9a08b5c..6c06c0cfb9e23a385302fad502f47d1992d38dca 100644 (file)
 #ifndef _AIRCRAFT_HXX
 #define _AIRCRAFT_HXX
                                  
-class FGControls;
 class SGPropertyNode;
 
-// Define a structure containing all the parameters for an aircraft
-typedef struct{
-    FGControls *controls;
-} fgAIRCRAFT ;
-
-
-// current_aircraft contains all the parameters of the aircraft
-// currently being operated.
-extern fgAIRCRAFT current_aircraft;
-
-
-// Initialize an Aircraft structure
-void fgAircraftInit( void );
-
-
-// Display various parameters to stdout
-void fgAircraftOutputCurrent(fgAIRCRAFT *a);
-
-
-// Read the list of available aircraft into to property tree
-void fgReadAircraft(void);
 bool fgLoadAircraft (const SGPropertyNode * arg);
 
 #endif // _AIRCRAFT_HXX
index a959978fcc22f3f210fcd9e328155ae1dcec3d25..54ccd2a232706f45fe8f8fa8d7a25a1e86f718f2 100644 (file)
@@ -36,7 +36,6 @@
 #include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
 
-#include <Aircraft/aircraft.hxx>
 #include <Include/general.hxx>
 
 #include <Main/globals.hxx>
@@ -360,7 +359,7 @@ float get_aux18 (void)
 #endif
 
 
-bool fgCockpitInit( fgAIRCRAFT *cur_aircraft )
+bool fgCockpitInit()
 {
     SG_LOG( SG_COCKPIT, SG_INFO, "Initializing cockpit subsystem" );
 
@@ -376,7 +375,7 @@ bool fgCockpitInit( fgAIRCRAFT *cur_aircraft )
     // HI_Head is now a null pointer so we can generate a new list from the
     // current aircraft.
 
-    fgHUDInit( cur_aircraft );
+    fgHUDInit();
 
     return true;
 }
index 9c7a5c9d279bc1a93a35b5b3679a6e49cbde7543..91c4155142ccb412ba3408e6c0f2e348e0dcf484 100644 (file)
 
 #include <osg/State>
 
-#include <Aircraft/aircraft.hxx>
-#include "panel.hxx"
-
-bool fgCockpitInit( fgAIRCRAFT *cur_aircraft );
+bool fgCockpitInit();
 void fgCockpitUpdate( osg::State* );
 
 #endif /* _COCKPIT_HXX */
index b06a1917bb68e8a4e97a31ada1be75e2d103f75a..57c2264e81527c9702b157825269b79735e5a274 100644 (file)
@@ -42,8 +42,6 @@
 
 #include <osg/GLU>
 
-#include <Aircraft/aircraft.hxx>
-//#include <Autopilot/xmlauto.hxx>
 #include <GUI/new_gui.hxx>           // FGFontCache
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
@@ -230,7 +228,7 @@ int readHud( istream &input )
 // display for a Piper Cub doesn't show the speed range of a North American
 // mustange and the engine readouts of a B36!
 //
-int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
+int fgHUDInit()
 {
 
     HUD_style = 1;
@@ -282,7 +280,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
 }
 
 
-int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
+int fgHUDInit2()
 {
 
     HUD_style = 2;
index 0d727ccd3c7625ebdefe752241d3cd142d13c1ab..bec30f5539a6c570ca185b1c4efc3906bc3e3eb1 100644 (file)
@@ -54,7 +54,6 @@ namespace osg {
 #include <simgear/constants.h>
 
 #include <Include/fg_typedefs.h>
-#include <Aircraft/aircraft.hxx>
 #include <Aircraft/controls.hxx>
 #include <FDM/flight.hxx>
 #include <GUI/gui.h>
@@ -694,8 +693,8 @@ public:
 };
 
 
-extern int  fgHUDInit( fgAIRCRAFT * /* current_aircraft */ );
-extern int  fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ );
+extern int  fgHUDInit();
+extern int  fgHUDInit2();
 extern void fgUpdateHUD( osg::State* );
 extern void fgUpdateHUD( osg::State*, GLfloat x_start, GLfloat y_start,
                          GLfloat x_end, GLfloat y_end );
index b920bcfc8ebb999fca2658d2e433ce8743961a88..2be1525238ed305f108362535a501862316f8476 100644 (file)
@@ -27,7 +27,6 @@
 #include <math.h>
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Environment/environment.hxx>
 #include <Environment/environment_mgr.hxx>
 #include <ATCDCL/ATCutils.hxx>
index a5d76ecfcbe89b4473ecca2b1cf09a5fffab9067..15268f93e02d02e84c2c7d84848242dc34117d56 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <Main/main.hxx>
 #include <Main/fg_props.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <FDM/flight.hxx>
 
 #include "environment.hxx"
index e9732f772a6c7e66940de058e435adc6d412e5f9..6409004fcbe193f4ddb3dddc1666d01a9b018a41 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <FDM/flight.hxx>
 
-#include <Aircraft/aircraft.hxx>
 #include <Aircraft/controls.hxx>
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
index 8eb05feaec16df5f802b83cbbe8d5a3670790191..beb33e87b9f115c5ff82d4d2330dc8c0800fad76 100644 (file)
@@ -38,7 +38,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #undef MAX_ENGINES
-#include <Aircraft/aircraft.hxx>
 #include "math/FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 611849dff2d2379ce7053f20fad48b0b886b2a76..850532f34532e698e28c3bbb84cca0899f846377 100644 (file)
@@ -31,7 +31,6 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/model/placement.hxx>
 
-#include <Aircraft/aircraft.hxx>
 #include <Aircraft/controls.hxx>
 #include <FDM/flight.hxx>
 #include <FDM/UIUCModel/uiuc_aircraft.h>
index 264d49b373ac564356512577df414c5f3729961e..add046caca860317a79ff5d554bd668a03f3bc77 100644 (file)
@@ -48,8 +48,6 @@ HISTORY
 
 #include <simgear/constants.h>
 
-#include <Aircraft/aircraft.hxx>
-
 #include "BalloonSim.h"
 
 /****************************************************************************/
index da120d29f5eadfd6c09daeee18bd28ff263e1cb6..31a87d0b98493960bba9e929fa683f3901c26fbf 100644 (file)
@@ -67,7 +67,6 @@
 
 #include <simgear/compiler.h>
 #include <simgear/misc/sg_path.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Main/fg_props.hxx>
 
 #include "uiuc_gear.h"
index 97e93b59c2da98b81ebb35107ade12951c932ab0..3264ad184af86601dc755d01f133f39276b2ab3b 100644 (file)
@@ -94,7 +94,6 @@
 
 #include <simgear/compiler.h>
 #include <simgear/misc/sg_path.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Main/fg_props.hxx>
 
 #include "uiuc_recorder.h"
index c11cbc97e5fbc6157be4d398f87ed45cd05119e2..79bbe74c388cc91599ce249d2ed38df08319167c 100644 (file)
@@ -86,7 +86,6 @@
 
 #include <simgear/compiler.h>
 #include <simgear/misc/sg_path.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Main/fg_props.hxx>
 
 #include "uiuc_aircraft.h"
index 3e3d5170117f3477dd408c88c82ea47c40f27f02..450f118a3cc4b1998b685c41e3fcb27dd9ebabb6 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Aircraft/controls.hxx>
 #include <FDM/flight.hxx>
 #include <Environment/environment.hxx>
index 41928a097f486c223b6cc224c0bac09c7ff9480c..30c0cbe6694270b0a6fa6ffc034672b4c7d79435 100644 (file)
@@ -32,7 +32,6 @@
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/sg_time.hxx>
 
-#include <Aircraft/aircraft.hxx>
 #include <Navaids/navlist.hxx>
 
 #include "kr_87.hxx"
index 99787b71fde2674f9362ec1ebf13e9e3da301fad..ec48bf84d946aebdc870b24b0680536d84f4664e 100644 (file)
@@ -32,8 +32,6 @@
 #include <simgear/compiler.h>
 #include <simgear/math/sg_random.h>
 
-#include <Aircraft/aircraft.hxx>
-
 #include "kt_70.hxx"
 
 
index 5e90575dcdda7daa6159c43be3e43a8d846f0bd0..1a85d9b8ab8743c79382b04de85c2504f1c24cbe 100644 (file)
@@ -1315,14 +1315,14 @@ do_increase_visibility (const SGPropertyNode * arg)
 static bool
 do_hud_init(const SGPropertyNode *)
 {
-    fgHUDInit(0); // minimal HUD
+    fgHUDInit(); // minimal HUD
     return true;
 }
 
 static bool
 do_hud_init2(const SGPropertyNode *)
 {
-    fgHUDInit2(0);  // normal HUD
+    fgHUDInit2();  // normal HUD
     return true;
 }
 
index 72f6849e9be1e5b63e9b34be2d2d68332b018f23..27cc0866b5cccd034d2f3f480f3b15167d8bf11a 100644 (file)
@@ -64,7 +64,6 @@
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/timing/lowleveltime.h>
 
-#include <Aircraft/aircraft.hxx>
 #include <Aircraft/controls.hxx>
 #include <Aircraft/replay.hxx>
 #include <Airports/apt_loader.hxx>
@@ -1407,11 +1406,6 @@ bool fgInitSubsystems() {
     ////////////////////////////////////////////////////////////////////
 
     globals->add_subsystem("flight", new FDMShell, SGSubsystemMgr::FDM);
-        
-    // allocates structures so must happen before any of the flight
-    // model or control parameters are set
-    fgAircraftInit();   // In the future this might not be the case.
-
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the weather subsystem.
@@ -1525,10 +1519,7 @@ bool fgInitSubsystems() {
     globals->add_subsystem("Traffic Manager", new FGTrafficManager);
 
 
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the cockpit subsystem
-    ////////////////////////////////////////////////////////////////////
-    if( fgCockpitInit( &current_aircraft )) {
+    if( fgCockpitInit()) {
         // Cockpit initialized ok.
     } else {
         SG_LOG( SG_GENERAL, SG_ALERT, "Error in Cockpit initialization!" );
@@ -1641,10 +1632,6 @@ void fgReInitSubsystems()
 
     // Initialize the FDM
     globals->get_subsystem("flight")->reinit();
-    
-    // allocates structures so must happen before any of the flight
-    // model or control parameters are set
-    fgAircraftInit();   // In the future this might not be the case.
 
     // reload offsets from config defaults
     globals->get_viewmgr()->reinit();
index c02006a0186dc7681591eb5577fe5357aa759d37..5d88ab30b13bd39250c0516c27765261d6ae8428 100644 (file)
@@ -54,6 +54,7 @@
 #include <Time/light.hxx>
 #include <Include/general.hxx>
 #include <Aircraft/replay.hxx>
+#include <Aircraft/aircraft.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <Cockpit/hud.hxx>
 #include <Model/panelnode.hxx>
@@ -535,8 +536,9 @@ static void fgIdleFunction ( void ) {
 
     } else if ( idle_state == 2 ) {
         idle_state++;
-        // Read the list of available aircraft
-        fgReadAircraft();
+        
+        globals->get_commands()->addCommand("load-aircraft", fgLoadAircraft);
+        
         fgSplashProgress("reading airport & navigation data");
 
 
@@ -725,7 +727,6 @@ static void fgIdleFunction ( void ) {
         // setup OpenGL view parameters
         globals->get_renderer()->init();
 
-        SG_LOG( SG_GENERAL, SG_INFO, "Panel visible = " << fgPanelVisible() );
         globals->get_renderer()->resize( fgGetInt("/sim/startup/xsize"),
                                          fgGetInt("/sim/startup/ysize") );
 
index d7258df88afa8fe010619a8c08be97c56d3cc2e4..05c1032a1da439663846001232433777ae0057f0 100644 (file)
@@ -80,7 +80,6 @@
 
 #include <Time/light.hxx>
 #include <Time/light.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Cockpit/panel.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <Cockpit/hud.hxx>
index 33c80d24bfecd4d2845cd97f0103ba3da88d046c..2ee35320daefd605f23a6a95cb93eebce4b4e90d 100644 (file)
@@ -29,7 +29,6 @@
 #include <simgear/io/iochannel.hxx>
 #include <simgear/misc/stdint.hxx>
 
-#include <Aircraft/aircraft.hxx>
 #include <Main/fg_props.hxx>
 
 #include "jsclient.hxx"