]> git.mxchange.org Git - flightgear.git/blobdiff - Aircraft/aircraft.cxx
Modifications to incorporate Jon S. Berndts flight model code.
[flightgear.git] / Aircraft / aircraft.cxx
index d2ff48cae782ea546976631acd328100cc42b65c..ac4b067b08de0c18e3b36e85c4d54ba978ee4224 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 
 #include "aircraft.hxx"
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
 #include <Include/fg_constants.h>
 
 // This is a record containing all the info for the aircraft currently
@@ -35,33 +35,56 @@ fgAIRCRAFT current_aircraft;
 
 // Initialize an Aircraft structure
 void fgAircraftInit( void ) {
-    fgPrintf( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure\n" );
+    FG_LOG( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure" );
 
-    current_aircraft.flight   = &cur_flight_params;
-    current_aircraft.controls = &cur_control_params;
+    current_aircraft.fdm_state   = &cur_fdm_state;
+    current_aircraft.controls = &controls;
 }
 
 
 // Display various parameters to stdout
 void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
-    fgFLIGHT *f;
-    fgCONTROLS *c;
+    FGInterface *f;
 
-    f = a->flight;
-    c = a->controls;
+    f = a->fdm_state;
 
-    fgPrintf( FG_FLIGHT, FG_DEBUG,
-             "Pos = (%.2f,%.2f,%.2f)  (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
-             FG_Longitude * 3600.0 * RAD_TO_DEG, 
-             FG_Latitude  * 3600.0 * RAD_TO_DEG,
-             FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
-    fgPrintf( FG_FLIGHT, FG_DEBUG,
-             "Kts = %.0f  Elev = %.2f, Aileron = %.2f, Rudder = %.2f  Power = %.2f\n", 
-             FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
+    FG_LOG( FG_FLIGHT, FG_DEBUG,
+           "Pos = ("
+           << (f->get_Longitude() * 3600.0 * RAD_TO_DEG) << "," 
+           << (f->get_Latitude()  * 3600.0 * RAD_TO_DEG) << ","
+           << f->get_Altitude() 
+           << ")  (Phi,Theta,Psi)=("
+           << f->get_Phi() << "," 
+           << f->get_Theta() << "," 
+           << f->get_Psi() << ")" );
+
+    FG_LOG( FG_FLIGHT, FG_DEBUG,
+           "Kts = " << f->get_V_equiv_kts() 
+           << "  Elev = " << controls.get_elevator() 
+           << "  Aileron = " << controls.get_aileron() 
+           << "  Rudder = " << controls.get_rudder() 
+           << "  Power = " << controls.get_throttle( 0 ) );
 }
 
 
 // $Log$
+// Revision 1.7  1999/02/05 21:28:09  curt
+// Modifications to incorporate Jon S. Berndts flight model code.
+//
+// Revision 1.6  1998/12/05 15:53:59  curt
+// Renamed class fgFLIGHT to class FGState as per request by JSB.
+//
+// Revision 1.5  1998/12/03 01:14:58  curt
+// Converted fgFLIGHT to a class.
+//
+// Revision 1.4  1998/11/06 21:17:31  curt
+// Converted to new logstream debugging facility.  This allows release
+// builds with no messages at all (and no performance impact) by using
+// the -DFG_NDEBUG flag.
+//
+// Revision 1.3  1998/10/25 14:08:37  curt
+// Turned "struct fgCONTROLS" into a class, with inlined accessor functions.
+//
 // Revision 1.2  1998/10/17 01:33:52  curt
 // C++ ifying ...
 //