1
0
Fork 0

Try to coordinate between the different logging idioms of JSBSim and

FlightGear: when FlightGear wants things quiet, make JSBSim quiet as
well.
This commit is contained in:
david 2003-11-24 17:59:10 +00:00
parent 01f8f51614
commit 5fa04adf68

View file

@ -76,8 +76,33 @@ FGJSBsim::FGJSBsim( double dt )
{
bool result;
// Set up the debugging level
// FIXME: this will not respond to
// runtime changes
// if flight is excluded, don't bother
if ((logbuf::get_log_classes() & SG_FLIGHT) != 0) {
// do a rough-and-ready mapping to
// the levels documented in FGFDMExec.h
switch (logbuf::get_log_priority()) {
case SG_BULK:
FGJSBBase::debug_lvl = 0x1f;
break;
case SG_DEBUG:
FGJSBBase::debug_lvl = 0x0f;
case SG_INFO:
FGJSBBase::debug_lvl = 0x01;
break;
case SG_WARN:
case SG_ALERT:
FGJSBBase::debug_lvl = 0x00;
break;
}
}
fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
State = fdmex->GetState();
Atmosphere = fdmex->GetAtmosphere();
FCS = fdmex->GetFCS();
@ -847,7 +872,8 @@ void FGJSBsim::do_trim(void) {
} else {
trimmed->setBoolValue(true);
}
State->ReportState();
if (FGJSBBase::debug_lvl > 0)
State->ReportState();
delete fgtrim;
pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );