1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 Purpose: Model the flight controls
9 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
11 This program is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free Software
13 Foundation; either version 2 of the License, or (at your option) any later
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23 Place - Suite 330, Boston, MA 02111-1307, USA.
25 Further information about the GNU General Public License can also be found on
26 the world wide web at http://www.gnu.org.
28 FUNCTIONAL DESCRIPTION
29 --------------------------------------------------------------------------------
30 This class models the flight controls for a specific airplane
33 --------------------------------------------------------------------------------
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42 #include "FGFDMExec.h"
43 #include "FGAtmosphere.h"
44 #include "FGAircraft.h"
45 #include "FGTranslation.h"
46 #include "FGRotation.h"
47 #include "FGPosition.h"
48 #include "FGAuxiliary.h"
50 #include "FGPropertyManager.h"
52 #include "filtersjb/FGFilter.h"
53 #include "filtersjb/FGDeadBand.h"
54 #include "filtersjb/FGGain.h"
55 #include "filtersjb/FGGradient.h"
56 #include "filtersjb/FGSwitch.h"
57 #include "filtersjb/FGSummer.h"
58 #include "filtersjb/FGKinemat.h"
60 static const char *IdSrc = "$Id$";
61 static const char *IdHdr = ID_FCS;
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
67 FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex)
72 DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = 0.0;
73 PTrimCmd = YTrimCmd = RTrimCmd = 0.0;
74 GearCmd = GearPos = 1; // default to gear down
75 LeftBrake = RightBrake = CenterBrake = 0.0;
79 for (i=0;i<=NForms;i++) {
80 DePos[i] = DaLPos[i] = DaRPos[i] = DrPos[i] = 0.0;
81 DfPos[i] = DsbPos[i] = DspPos[i] = 0.0;
84 for (i=0;i<NNorm;i++) { ToNormalize[i]=-1;}
88 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96 PropAdvanceCmd.clear();
103 for (i=0;i<Components.size();i++) delete Components[i];
107 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 bool FGFCS::Run(void)
113 if (!FGModel::Run()) {
114 for (i=0; i<ThrottlePos.size(); i++) ThrottlePos[i] = ThrottleCmd[i];
115 for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
116 for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
117 for (i=0; i<Components.size(); i++) Components[i]->Run();
118 if (DoNormalize) Normalize();
125 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
127 void FGFCS::SetThrottleCmd(int engineNum, double setting)
131 if (engineNum < (int)ThrottlePos.size()) {
133 for (ctr=0;ctr<ThrottleCmd.size();ctr++) ThrottleCmd[ctr] = setting;
135 ThrottleCmd[engineNum] = setting;
138 cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
139 << " engines exist, but attempted throttle command is for engine "
140 << engineNum << endl;
144 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146 void FGFCS::SetThrottlePos(int engineNum, double setting)
150 if (engineNum < (int)ThrottlePos.size()) {
152 for (ctr=0;ctr<ThrottlePos.size();ctr++) ThrottlePos[ctr] = setting;
154 ThrottlePos[engineNum] = setting;
157 cerr << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
158 << " engines exist, but attempted throttle position setting is for engine "
159 << engineNum << endl;
163 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165 double FGFCS::GetThrottleCmd(int engineNum) const
167 if (engineNum < (int)ThrottlePos.size()) {
169 cerr << "Cannot get throttle value for ALL engines" << endl;
171 return ThrottleCmd[engineNum];
174 cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
175 << " engines exist, but throttle setting for engine " << engineNum
176 << " is selected" << endl;
181 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183 double FGFCS::GetThrottlePos(int engineNum) const
185 if (engineNum < (int)ThrottlePos.size()) {
187 cerr << "Cannot get throttle value for ALL engines" << endl;
189 return ThrottlePos[engineNum];
192 cerr << "Throttle " << engineNum << " does not exist! " << ThrottlePos.size()
193 << " engines exist, but attempted throttle position setting is for engine "
194 << engineNum << endl;
199 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201 void FGFCS::SetMixtureCmd(int engineNum, double setting)
205 if (engineNum < (int)ThrottlePos.size()) {
207 for (ctr=0;ctr<MixtureCmd.size();ctr++) MixtureCmd[ctr] = setting;
209 MixtureCmd[engineNum] = setting;
214 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 void FGFCS::SetMixturePos(int engineNum, double setting)
220 if (engineNum < (int)ThrottlePos.size()) {
222 for (ctr=0;ctr<=MixtureCmd.size();ctr++) MixturePos[ctr] = MixtureCmd[ctr];
224 MixturePos[engineNum] = setting;
229 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231 void FGFCS::SetPropAdvanceCmd(int engineNum, double setting)
235 if (engineNum < (int)ThrottlePos.size()) {
237 for (ctr=0;ctr<PropAdvanceCmd.size();ctr++) PropAdvanceCmd[ctr] = setting;
239 PropAdvanceCmd[engineNum] = setting;
244 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246 void FGFCS::SetPropAdvance(int engineNum, double setting)
250 if (engineNum < (int)ThrottlePos.size()) {
252 for (ctr=0;ctr<=PropAdvanceCmd.size();ctr++) PropAdvance[ctr] = PropAdvanceCmd[ctr];
254 PropAdvance[engineNum] = setting;
259 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 bool FGFCS::Load(FGConfigFile* AC_cfg)
266 Name = Name + ":" + AC_cfg->GetValue("NAME");
267 if (debug_lvl > 0) cout << " Control System Name: " << Name << endl;
268 if ( AC_cfg->GetValue("NORMALIZE") == "FALSE") {
270 cout << " Automatic Control Surface Normalization Disabled" << endl;
272 AC_cfg->GetNextConfigLine();
273 while ((token = AC_cfg->GetValue()) != string("/FLIGHT_CONTROL")) {
274 if (token == "COMPONENT") {
275 token = AC_cfg->GetValue("TYPE");
276 if (debug_lvl > 0) cout << endl << " Loading Component \""
277 << AC_cfg->GetValue("NAME")
278 << "\" of type: " << token << endl;
279 if ((token == "LAG_FILTER") ||
280 (token == "LEAD_LAG_FILTER") ||
281 (token == "SECOND_ORDER_FILTER") ||
282 (token == "WASHOUT_FILTER") ||
283 (token == "INTEGRATOR") ) {
284 Components.push_back(new FGFilter(this, AC_cfg));
285 } else if ((token == "PURE_GAIN") ||
286 (token == "SCHEDULED_GAIN") ||
287 (token == "AEROSURFACE_SCALE") ) {
289 Components.push_back(new FGGain(this, AC_cfg));
291 } else if (token == "SUMMER") {
292 Components.push_back(new FGSummer(this, AC_cfg));
293 } else if (token == "DEADBAND") {
294 Components.push_back(new FGDeadBand(this, AC_cfg));
295 } else if (token == "GRADIENT") {
296 Components.push_back(new FGGradient(this, AC_cfg));
297 } else if (token == "SWITCH") {
298 Components.push_back(new FGSwitch(this, AC_cfg));
299 } else if (token == "KINEMAT") {
300 Components.push_back(new FGKinemat(this, AC_cfg));
302 cerr << "Unknown token [" << token << "] in FCS portion of config file" << endl;
305 AC_cfg->GetNextConfigLine();
308 //collect information for normalizing control surfaces
310 for (i=0;i<Components.size();i++) {
312 if ( (Components[i]->GetType() == "AEROSURFACE_SCALE"
313 || Components[i]->GetType() == "KINEMAT")
314 && Components[i]->GetOutputNode() ) {
315 nodeName= Components[i]->GetOutputNode()->GetName();
316 if ( nodeName == "elevator-pos-rad" ) {
318 } else if ( nodeName == "left-aileron-pos-rad"
319 || nodeName == "aileron-pos-rad" ) {
321 } else if ( nodeName == "right-aileron-pos-rad" ) {
323 } else if ( nodeName == "rudder-pos-rad" ) {
325 } else if ( nodeName == "speedbrake-pos-rad" ) {
327 } else if ( nodeName == "spoiler-pos-rad" ) {
329 } else if ( nodeName == "flaps-pos-deg" ) {
340 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
342 double FGFCS::GetComponentOutput(int idx) {
343 return Components[idx]->GetOutput();
346 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348 string FGFCS::GetComponentName(int idx) {
349 return Components[idx]->GetName();
352 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 double FGFCS::GetBrake(FGLGear::BrakeGroup bg)
357 case FGLGear::bgLeft:
359 case FGLGear::bgRight:
361 case FGLGear::bgCenter:
364 cerr << "GetBrake asked to return a bogus brake value" << endl;
369 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
371 string FGFCS::GetComponentStrings(void)
374 string CompStrings = "";
375 bool firstime = true;
377 for (comp = 0; comp < Components.size(); comp++) {
378 if (firstime) firstime = false;
379 else CompStrings += ", ";
381 CompStrings += Components[comp]->GetName();
387 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
389 string FGFCS::GetComponentValues(void)
392 string CompValues = "";
394 bool firstime = true;
396 for (comp = 0; comp < Components.size(); comp++) {
397 if (firstime) firstime = false;
398 else CompValues += ", ";
400 sprintf(buffer, "%9.6f", Components[comp]->GetOutput());
401 CompValues += string(buffer);
407 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
409 void FGFCS::AddThrottle(void)
411 ThrottleCmd.push_back(0.0);
412 ThrottlePos.push_back(0.0);
413 MixtureCmd.push_back(0.0); // assume throttle and mixture are coupled
414 MixturePos.push_back(0.0);
415 PropAdvanceCmd.push_back(0.0); // assume throttle and prop pitch are coupled
416 PropAdvance.push_back(0.0);
419 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421 void FGFCS::Normalize(void) {
423 //not all of these are guaranteed to be defined for every model
424 //those that are have an index >=0 in the ToNormalize array
425 //ToNormalize is filled in Load()
427 if ( ToNormalize[iDe] > -1 ) {
428 DePos[ofNorm] = Components[ToNormalize[iDe]]->GetOutputPct();
431 if ( ToNormalize[iDaL] > -1 ) {
432 DaLPos[ofNorm] = Components[ToNormalize[iDaL]]->GetOutputPct();
435 if ( ToNormalize[iDaR] > -1 ) {
436 DaRPos[ofNorm] = Components[ToNormalize[iDaR]]->GetOutputPct();
439 if ( ToNormalize[iDr] > -1 ) {
440 DrPos[ofNorm] = Components[ToNormalize[iDr]]->GetOutputPct();
443 if ( ToNormalize[iDsb] > -1 ) {
444 DsbPos[ofNorm] = Components[ToNormalize[iDsb]]->GetOutputPct();
447 if ( ToNormalize[iDsp] > -1 ) {
448 DspPos[ofNorm] = Components[ToNormalize[iDsp]]->GetOutputPct();
451 if ( ToNormalize[iDf] > -1 ) {
452 DfPos[ofNorm] = Components[ToNormalize[iDf]]->GetOutputPct();
455 DePos[ofMag] = fabs(DePos[ofRad]);
456 DaLPos[ofMag] = fabs(DaLPos[ofRad]);
457 DaRPos[ofMag] = fabs(DaRPos[ofRad]);
458 DrPos[ofMag] = fabs(DrPos[ofRad]);
459 DsbPos[ofMag] = fabs(DsbPos[ofRad]);
460 DspPos[ofMag] = fabs(DspPos[ofRad]);
461 DfPos[ofMag] = fabs(DfPos[ofRad]);
465 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
467 void FGFCS::bind(void)
469 PropertyManager->Tie("fcs/aileron-cmd-norm", this,
473 PropertyManager->Tie("fcs/elevator-cmd-norm", this,
477 PropertyManager->Tie("fcs/rudder-cmd-norm", this,
481 PropertyManager->Tie("fcs/flap-cmd-norm", this,
485 PropertyManager->Tie("fcs/speedbrake-cmd-norm", this,
489 PropertyManager->Tie("fcs/spoiler-cmd-norm", this,
493 PropertyManager->Tie("fcs/pitch-trim-cmd-norm", this,
494 &FGFCS::GetPitchTrimCmd,
495 &FGFCS::SetPitchTrimCmd,
497 PropertyManager->Tie("fcs/roll-trim-cmd-norm", this,
498 &FGFCS::GetYawTrimCmd,
499 &FGFCS::SetYawTrimCmd,
501 PropertyManager->Tie("fcs/yaw-trim-cmd-norm", this,
502 &FGFCS::GetRollTrimCmd,
503 &FGFCS::SetRollTrimCmd,
505 PropertyManager->Tie("gear/gear-cmd-norm", this,
510 PropertyManager->Tie("fcs/left-aileron-pos-rad", this,ofRad,
514 PropertyManager->Tie("fcs/left-aileron-pos-norm", this,ofNorm,
518 PropertyManager->Tie("fcs/mag-left-aileron-pos-rad", this,ofMag,
523 PropertyManager->Tie("fcs/right-aileron-pos-rad", this,ofRad,
527 PropertyManager->Tie("fcs/right-aileron-pos-norm", this,ofNorm,
531 PropertyManager->Tie("fcs/mag-right-aileron-pos-rad", this,ofMag,
536 PropertyManager->Tie("fcs/elevator-pos-rad", this, ofRad,
540 PropertyManager->Tie("fcs/elevator-pos-norm", this,ofNorm,
544 PropertyManager->Tie("fcs/mag-elevator-pos-rad", this,ofMag,
549 PropertyManager->Tie("fcs/rudder-pos-rad", this,ofRad,
553 PropertyManager->Tie("fcs/rudder-pos-norm", this,ofNorm,
557 PropertyManager->Tie("fcs/mag-rudder-pos-rad", this,ofMag,
562 PropertyManager->Tie("fcs/flap-pos-deg", this,ofRad,
566 PropertyManager->Tie("fcs/flap-pos-norm", this,ofNorm,
571 PropertyManager->Tie("fcs/speedbrake-pos-rad", this,ofRad,
575 PropertyManager->Tie("fcs/speedbrake-pos-norm", this,ofNorm,
579 PropertyManager->Tie("fcs/mag-speedbrake-pos-rad", this,ofMag,
584 PropertyManager->Tie("fcs/spoiler-pos-rad", this,ofRad,
588 PropertyManager->Tie("fcs/spoiler-pos-norm", this,ofNorm,
592 PropertyManager->Tie("fcs/mag-spoiler-pos-rad", this,ofMag,
597 PropertyManager->Tie("gear/gear-pos-norm", this,
603 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
605 void FGFCS::bindModel(void)
609 for (i=0; i<ThrottleCmd.size(); i++) {
610 PropertyManager->Tie("fcs/throttle-cmd-norm",this,i,
611 &FGFCS::GetThrottleCmd,
612 &FGFCS::SetThrottleCmd,
614 PropertyManager->Tie("fcs/throttle-pos-norm",this,i,
615 &FGFCS::GetThrottlePos,
616 &FGFCS::SetThrottlePos,
618 if ( MixtureCmd.size() > i ) {
619 PropertyManager->Tie("fcs/mixture-cmd-norm",this,i,
620 &FGFCS::GetMixtureCmd,
621 &FGFCS::SetMixtureCmd,
623 PropertyManager->Tie("fcs/mixture-pos-norm",this,i,
624 &FGFCS::GetMixturePos,
625 &FGFCS::SetMixturePos,
628 if ( PropAdvanceCmd.size() > i ) {
629 PropertyManager->Tie("fcs/advance-cmd-norm",this,i,
630 &FGFCS::GetPropAdvanceCmd,
631 &FGFCS::SetPropAdvanceCmd,
633 PropertyManager->Tie("fcs/advance-pos-norm",this,i,
634 &FGFCS::GetPropAdvance,
635 &FGFCS::SetPropAdvance,
641 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
643 void FGFCS::unbind(void)
645 PropertyManager->Untie("fcs/aileron-cmd-norm");
646 PropertyManager->Untie("fcs/elevator-cmd-norm");
647 PropertyManager->Untie("fcs/rudder-cmd-norm");
648 PropertyManager->Untie("fcs/flap-cmd-norm");
649 PropertyManager->Untie("fcs/speedbrake-cmd-norm");
650 PropertyManager->Untie("fcs/spoiler-cmd-norm");
651 PropertyManager->Untie("fcs/pitch-trim-cmd-norm");
652 PropertyManager->Untie("fcs/roll-trim-cmd-norm");
653 PropertyManager->Untie("fcs/yaw-trim-cmd-norm");
654 PropertyManager->Untie("gear/gear-cmd-norm");
655 PropertyManager->Untie("fcs/left-aileron-pos-rad");
656 PropertyManager->Untie("fcs/mag-left-aileron-pos-rad");
657 PropertyManager->Untie("fcs/left-aileron-pos-norm");
658 PropertyManager->Untie("fcs/right-aileron-pos-rad");
659 PropertyManager->Untie("fcs/mag-right-aileron-pos-rad");
660 PropertyManager->Untie("fcs/right-aileron-pos-norm");
661 PropertyManager->Untie("fcs/elevator-pos-rad");
662 PropertyManager->Untie("fcs/mag-elevator-pos-rad");
663 PropertyManager->Untie("fcs/elevator-pos-norm");
664 PropertyManager->Untie("fcs/rudder-pos-rad");
665 PropertyManager->Untie("fcs/mag-rudder-pos-rad");
666 PropertyManager->Untie("fcs/rudder-pos-norm");
667 PropertyManager->Untie("fcs/flap-pos-deg");
668 PropertyManager->Untie("fcs/flap-pos-norm");
669 PropertyManager->Untie("fcs/speedbrake-pos-rad");
670 PropertyManager->Untie("fcs/mag-speedbrake-pos-rad");
671 PropertyManager->Untie("fcs/speedbrake-pos-norm");
672 PropertyManager->Untie("fcs/spoiler-pos-rad");
673 PropertyManager->Untie("fcs/mag-spoiler-pos-rad");
674 PropertyManager->Untie("fcs/spoiler-pos-norm");
675 PropertyManager->Untie("gear/gear-pos-norm");
678 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
679 // The bitmasked value choices are as follows:
680 // unset: In this case (the default) JSBSim would only print
681 // out the normally expected messages, essentially echoing
682 // the config files as they are read. If the environment
683 // variable is not set, debug_lvl is set to 1 internally
684 // 0: This requests JSBSim not to output any messages
686 // 1: This value explicity requests the normal JSBSim
688 // 2: This value asks for a message to be printed out when
689 // a class is instantiated
690 // 4: When this value is set, a message is displayed when a
691 // FGModel object executes its Run() method
692 // 8: When this value is set, various runtime state variables
693 // are printed out periodically
694 // 16: When set various parameters are sanity checked and
695 // a message is printed out when they go out of bounds
697 void FGFCS::Debug(int from)
699 if (debug_lvl <= 0) return;
701 if (debug_lvl & 1) { // Standard console startup message output
702 if (from == 0) { // Constructor
706 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
707 if (from == 0) cout << "Instantiated: FGFCS" << endl;
708 if (from == 1) cout << "Destroyed: FGFCS" << endl;
710 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
712 if (debug_lvl & 8 ) { // Runtime state variables
714 if (debug_lvl & 16) { // Sanity checking
716 if (debug_lvl & 64) {
717 if (from == 0) { // Constructor
718 cout << IdSrc << endl;
719 cout << IdHdr << endl;