1
0
Fork 0

Make more output honour debug_lvl.

This commit is contained in:
david 2003-11-24 17:59:41 +00:00
parent 5fa04adf68
commit 5644f22513
6 changed files with 18 additions and 12 deletions

View 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;
}

View 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;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View 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;

View 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;

View 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 ));

View 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);