From 0ab2a40c2a2c75d117744f63a1bd74ccc7ea3a4e Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 24 Oct 2004 11:05:14 +0000 Subject: [PATCH] Roy Vegard Ovesen: I've added two new debug log types for the instrumentation and systems. They used to use the autopilot debug log, because I couldn't figure out how to make new log types. Well, now I have figured it out. ;-) --- src/FDM/JSBSim/FGEngine.cpp | 3 +++ src/Instrumentation/adf.cxx | 4 ++-- src/Instrumentation/airspeed_indicator.cxx | 4 ++-- src/Instrumentation/altimeter.cxx | 4 ++-- src/Instrumentation/attitude_indicator.cxx | 4 ++-- src/Instrumentation/clock.cxx | 4 ++-- src/Instrumentation/dme.cxx | 4 ++-- src/Instrumentation/gps.cxx | 4 ++-- src/Instrumentation/heading_indicator.cxx | 4 ++-- src/Instrumentation/mag_compass.cxx | 4 ++-- src/Instrumentation/slip_skid_ball.cxx | 4 ++-- src/Instrumentation/turn_indicator.cxx | 4 ++-- src/Instrumentation/vertical_speed_indicator.cxx | 4 ++-- src/Main/fg_props.cxx | 2 ++ src/Systems/pitot.cxx | 4 ++-- src/Systems/static.cxx | 4 ++-- src/Systems/vacuum.cxx | 4 ++-- 17 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/FDM/JSBSim/FGEngine.cpp b/src/FDM/JSBSim/FGEngine.cpp index edf834ba3..38193a2a2 100644 --- a/src/FDM/JSBSim/FGEngine.cpp +++ b/src/FDM/JSBSim/FGEngine.cpp @@ -107,6 +107,9 @@ FGEngine::FGEngine(FGFDMExec* exec, int engine_number) : EngineNumber(engine_num FGEngine::~FGEngine() { + if (Thruster) + delete Thruster; + Debug(1); } diff --git a/src/Instrumentation/adf.cxx b/src/Instrumentation/adf.cxx index e6d02a140..9d15b2bbd 100644 --- a/src/Instrumentation/adf.cxx +++ b/src/Instrumentation/adf.cxx @@ -75,9 +75,9 @@ ADF::ADF (SGPropertyNode *node ) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in adf config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in adf config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/airspeed_indicator.cxx b/src/Instrumentation/airspeed_indicator.cxx index cbdd75902..dbec719fa 100644 --- a/src/Instrumentation/airspeed_indicator.cxx +++ b/src/Instrumentation/airspeed_indicator.cxx @@ -36,9 +36,9 @@ AirspeedIndicator::AirspeedIndicator ( SGPropertyNode *node ) } else if ( cname == "static-port" ) { static_port = cval; } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in aispeed-indicator config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in aispeed-indicator config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/altimeter.cxx b/src/Instrumentation/altimeter.cxx index 86190d253..2a82ee7a0 100644 --- a/src/Instrumentation/altimeter.cxx +++ b/src/Instrumentation/altimeter.cxx @@ -66,9 +66,9 @@ Altimeter::Altimeter ( SGPropertyNode *node ) } else if ( cname == "static-port" ) { static_port = cval; } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in altimeter config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in altimeter config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/attitude_indicator.cxx b/src/Instrumentation/attitude_indicator.cxx index 82cb4c6a0..d958de25d 100644 --- a/src/Instrumentation/attitude_indicator.cxx +++ b/src/Instrumentation/attitude_indicator.cxx @@ -31,9 +31,9 @@ AttitudeIndicator::AttitudeIndicator ( SGPropertyNode *node ) } else if ( cname == "vacuum-system" ) { vacuum_system = cval; } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in attitude-indicator config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in attitude-indicator config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/clock.cxx b/src/Instrumentation/clock.cxx index 6f1db3e39..b850d18eb 100644 --- a/src/Instrumentation/clock.cxx +++ b/src/Instrumentation/clock.cxx @@ -33,9 +33,9 @@ Clock::Clock ( SGPropertyNode *node ) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in clock config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in clock config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/dme.cxx b/src/Instrumentation/dme.cxx index 0164888a1..e74977399 100644 --- a/src/Instrumentation/dme.cxx +++ b/src/Instrumentation/dme.cxx @@ -57,9 +57,9 @@ DME::DME ( SGPropertyNode *node ) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in dme config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in dme config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/gps.cxx b/src/Instrumentation/gps.cxx index 9e2e9cdf4..5ebfafcba 100644 --- a/src/Instrumentation/gps.cxx +++ b/src/Instrumentation/gps.cxx @@ -44,9 +44,9 @@ GPS::GPS ( SGPropertyNode *node) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in gps config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in gps config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/heading_indicator.cxx b/src/Instrumentation/heading_indicator.cxx index beeef54e9..8878e3ba1 100644 --- a/src/Instrumentation/heading_indicator.cxx +++ b/src/Instrumentation/heading_indicator.cxx @@ -26,9 +26,9 @@ HeadingIndicator::HeadingIndicator ( SGPropertyNode *node ) } else if ( cname == "vacuum-system" ) { vacuum_system = cval; } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in heading-indicator config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in heading-indicator config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/mag_compass.cxx b/src/Instrumentation/mag_compass.cxx index 378dd4bdd..c7b13553c 100644 --- a/src/Instrumentation/mag_compass.cxx +++ b/src/Instrumentation/mag_compass.cxx @@ -33,9 +33,9 @@ MagCompass::MagCompass ( SGPropertyNode *node ) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in magnetic-compass config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in magnetic-compass config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/slip_skid_ball.cxx b/src/Instrumentation/slip_skid_ball.cxx index d0ec8886f..ba470bd1c 100644 --- a/src/Instrumentation/slip_skid_ball.cxx +++ b/src/Instrumentation/slip_skid_ball.cxx @@ -23,9 +23,9 @@ SlipSkidBall::SlipSkidBall ( SGPropertyNode *node) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in slip-skid-ball config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in slip-skid-ball config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/turn_indicator.cxx b/src/Instrumentation/turn_indicator.cxx index 26b3c8f69..6eab60a49 100644 --- a/src/Instrumentation/turn_indicator.cxx +++ b/src/Instrumentation/turn_indicator.cxx @@ -28,9 +28,9 @@ TurnIndicator::TurnIndicator ( SGPropertyNode *node) : } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in turn-indicator config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in turn-indicator config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Instrumentation/vertical_speed_indicator.cxx b/src/Instrumentation/vertical_speed_indicator.cxx index 72ff151f4..fb2924600 100644 --- a/src/Instrumentation/vertical_speed_indicator.cxx +++ b/src/Instrumentation/vertical_speed_indicator.cxx @@ -28,9 +28,9 @@ VerticalSpeedIndicator::VerticalSpeedIndicator ( SGPropertyNode *node ) } else if ( cname == "static-port" ) { static_port = cval; } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in vertical-speed-indicator config logic" ); + SG_LOG( SG_INSTR, SG_WARN, "Error in vertical-speed-indicator config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); } } } diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index 2c93ad36c..8c603096e 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -82,6 +82,8 @@ LogClassMapping log_class_mappings [] = { LogClassMapping(SG_IO, "io"), LogClassMapping(SG_CLIPPER, "clipper"), LogClassMapping(SG_NETWORK, "network"), + LogClassMapping(SG_INSTR, "instrumentation"), + LogClassMapping(SG_SYSTEMS, "systems"), LogClassMapping(SG_UNDEFD, "") }; diff --git a/src/Systems/pitot.cxx b/src/Systems/pitot.cxx index 71b27fc7a..7201e4f5d 100644 --- a/src/Systems/pitot.cxx +++ b/src/Systems/pitot.cxx @@ -24,9 +24,9 @@ PitotSystem::PitotSystem ( SGPropertyNode *node ) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in systems config logic" ); + SG_LOG( SG_SYSTEMS, SG_WARN, "Error in systems config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_SYSTEMS, SG_WARN, "Section = " << name ); } } } diff --git a/src/Systems/static.cxx b/src/Systems/static.cxx index bac6ddf25..59111d322 100644 --- a/src/Systems/static.cxx +++ b/src/Systems/static.cxx @@ -23,9 +23,9 @@ StaticSystem::StaticSystem ( SGPropertyNode *node ) } else if ( cname == "number" ) { num = child->getIntValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in systems config logic" ); + SG_LOG( SG_SYSTEMS, SG_WARN, "Error in systems config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_SYSTEMS, SG_WARN, "Section = " << name ); } } } diff --git a/src/Systems/vacuum.cxx b/src/Systems/vacuum.cxx index bede8ed77..fcf80d5c3 100644 --- a/src/Systems/vacuum.cxx +++ b/src/Systems/vacuum.cxx @@ -29,9 +29,9 @@ VacuumSystem::VacuumSystem ( SGPropertyNode *node ) } else if ( cname == "scale" ) { scale = child->getDoubleValue(); } else { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in vacuum config logic" ); + SG_LOG( SG_SYSTEMS, SG_WARN, "Error in vacuum config logic" ); if ( name.length() ) { - SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name ); + SG_LOG( SG_SYSTEMS, SG_WARN, "Section = " << name ); } } }