]> git.mxchange.org Git - flightgear.git/commitdiff
Make more output honour debug_lvl.
authordavid <david>
Mon, 24 Nov 2003 17:59:41 +0000 (17:59 +0000)
committerdavid <david>
Mon, 24 Nov 2003 17:59:41 +0000 (17:59 +0000)
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGJSBBase.cpp
src/FDM/JSBSim/FGJSBBase.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGTrim.cpp
src/FDM/JSBSim/FGTrimAxis.cpp

index ee6386705eab9641124d7dcfd75005a6f8af0548..401645d0fcca129013f74cd4017b0c6865775744 100644 (file)
@@ -140,8 +140,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
 
   try {
     char* num = getenv("JSBSIM_DEBUG");
-    if (!num) debug_lvl = 1;
-    else debug_lvl = atoi(num); // set debug level
+    if (num) debug_lvl = atoi(num); // set debug level
   } catch (...) {               // if error set to 1
     debug_lvl = 1;
   }
index ecd8da25d37d0114fa0d6bab4ca716299f860d9a..fa2da135907fc277e9496a7af64852fd3e28c87b 100644 (file)
@@ -76,7 +76,7 @@ FGJSBBase::Message FGJSBBase::localMsg;
 unsigned int FGJSBBase::messageId = 0; 
 unsigned int FGJSBBase::frame = 0;
 
-short FGJSBBase::debug_lvl  = 0;
+short FGJSBBase::debug_lvl  = 1;
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
index b255738382520011504e05f445a8ba6c9ddfdc97..9c29ab0ebdea85220c1089d8eb199c6a7e5539fb 100644 (file)
@@ -215,6 +215,8 @@ public:
   
   void disableHighLighting(void);
 
+  static short debug_lvl;
+
 protected:
   static Message localMsg;
   
@@ -222,7 +224,6 @@ protected:
 
   virtual void Debug(int from) {};
 
-  static short debug_lvl;
   static unsigned int frame;
   static unsigned int messageId;
   
index 405882a8af282cd7e94c1ddc8ddff18735289a66..41f49e02b569b89cd79786c049d64e33d05489db 100644 (file)
@@ -226,7 +226,6 @@ bool FGPropulsion::Load(FGConfigFile* AC_cfg)
       if (Eng_cfg.IsOpen()) {
         Eng_cfg.GetNextConfigLine();
         engType = Eng_cfg.GetValue();
-        cout << engType << endl;
 
         FCS->AddThrottle();
         ThrottleAdded = true;
index 1de2344201e83c2347e910d5f65b6129c9f04715..5c7e37e0a22eeeaab8f794d97c8b6bff5cceeac0 100644 (file)
@@ -341,10 +341,12 @@ bool FGTrim::DoTrim(void) {
   } while((axis_count < TrimAxes.size()) && (!trim_failed));
   if((!trim_failed) && (axis_count >= TrimAxes.size())) {
     total_its=N;
-    cout << endl << "  Trim successful" << endl;
+    if (debug_lvl > 0)
+        cout << endl << "  Trim successful" << endl;
   } else {
     total_its=N;
-    cout << endl << "  Trim failed" << endl;
+    if (debug_lvl > 0)
+        cout << endl << "  Trim failed" << endl;
   }
   for(i=0;i < fdmex->GetGroundReactions()->GetNumGearUnits();i++){
     fdmex->GetGroundReactions()->GetGearUnit(i)->SetReport(true);
@@ -620,7 +622,8 @@ void FGTrim::SetMode(TrimMode tt) {
     mode=tt;
     switch(tt) {
       case tFull:
-        cout << "  Full Trim" << endl;
+        if (debug_lvl > 0)          
+          cout << "  Full Trim" << endl;
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha ));
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle ));
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim ));
@@ -630,13 +633,15 @@ void FGTrim::SetMode(TrimMode tt) {
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tRdot,tRudder ));
         break;
       case tLongitudinal:
-        cout << "  Longitudinal Trim" << endl;
+        if (debug_lvl > 0)          
+          cout << "  Longitudinal Trim" << endl;
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha ));
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle ));
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim ));
         break;
       case tGround:
-        cout << "  Ground Trim" << endl;
+        if (debug_lvl > 0)          
+          cout << "  Ground Trim" << endl;
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAltAGL ));
         TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tTheta ));
         //TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tPhi ));
index e41f7af3c3c59e42cd392f3e2f91c7dff8503ec3..e95d1c54bfc0e564f268172178d6e592be3d2643 100644 (file)
@@ -337,8 +337,10 @@ bool FGTrimAxis::initTheta(void) {
          i++;   
   }                    
   //cout << i << endl;
-  cout << "    Initial Theta: " << fdmex->GetRotation()->Gettht()*radtodeg << endl;
-  cout << "    Used gear unit " << iAft << " as aft and " << iForward << " as forward" << endl;
+  if (debug_lvl > 0) {
+      cout << "    Initial Theta: " << fdmex->GetRotation()->Gettht()*radtodeg << endl;
+      cout << "    Used gear unit " << iAft << " as aft and " << iForward << " as forward" << endl;
+  }
   control_min=(theta+5)*degtorad;
   control_max=(theta-5)*degtorad;
   fgic->SetAltitudeAGLFtIC(saveAlt);