1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 Purpose: Manage output of sim parameters to file or stdout
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 is the place where you create output routines to dump data for perusal
34 --------------------------------------------------------------------------------
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
43 #include "FGFDMExec.h"
44 #include "FGAtmosphere.h"
46 #include "FGAerodynamics.h"
47 #include "FGGroundReactions.h"
48 #include "FGAircraft.h"
49 #include "FGMassBalance.h"
50 #include "FGPropagate.h"
51 #include "FGAuxiliary.h"
52 #include "FGInertial.h"
59 static const char *IdSrc = "$Id$";
60 static const char *IdHdr = ID_OUTPUT;
62 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
66 FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex)
69 sFirstPass = dFirstPass = true;
80 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 if (socket) delete socket;
85 OutputProperties.clear();
90 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92 bool FGOutput::Run(void)
94 if (FGModel::Run()) return true;
96 if (enabled && !State->IntegrationSuspended()&& !FDMExec->Holding()) {
97 if (Type == otSocket) {
99 } else if (Type == otCSV || Type == otTab) {
100 DelimitedOutput(Filename);
101 } else if (Type == otTerminal) {
103 } else if (Type == otNone) {
106 // Not a valid type of output
112 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114 void FGOutput::SetType(string type)
119 } else if (type == "TABULAR") {
122 } else if (type == "SOCKET") {
124 } else if (type == "TERMINAL") {
126 } else if (type != string("NONE")) {
128 cerr << "Unknown type of output specified in config file" << endl;
132 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134 void FGOutput::DelimitedOutput(string fname)
139 if (fname == "COUT" || fname == "cout") {
140 buffer = cout.rdbuf();
142 datafile.open(fname.c_str());
143 buffer = datafile.rdbuf();
146 ostream outstream(buffer);
150 if (SubSystems & ssSimulation) {
153 if (SubSystems & ssAerosurfaces) {
154 outstream << delimeter;
155 outstream << "Aileron Cmd" + delimeter;
156 outstream << "Elevator Cmd" + delimeter;
157 outstream << "Rudder Cmd" + delimeter;
158 outstream << "Flap Cmd" + delimeter;
159 outstream << "Left Aileron Pos" + delimeter;
160 outstream << "Right Aileron Pos" + delimeter;
161 outstream << "Elevator Pos" + delimeter;
162 outstream << "Rudder Pos" + delimeter;
163 outstream << "Flap Pos";
165 if (SubSystems & ssRates) {
166 outstream << delimeter;
167 outstream << "P" + delimeter + "Q" + delimeter + "R" + delimeter;
168 outstream << "Pdot" + delimeter + "Qdot" + delimeter + "Rdot";
170 if (SubSystems & ssVelocities) {
171 outstream << delimeter;
172 outstream << "QBar" + delimeter;
173 outstream << "Vtotal" + delimeter;
174 outstream << "UBody" + delimeter + "VBody" + delimeter + "WBody" + delimeter;
175 outstream << "UAero" + delimeter + "VAero" + delimeter + "WAero" + delimeter;
176 outstream << "Vn" + delimeter + "Ve" + delimeter + "Vd";
178 if (SubSystems & ssForces) {
179 outstream << delimeter;
180 outstream << "Drag" + delimeter + "Side" + delimeter + "Lift" + delimeter;
181 outstream << "L/D" + delimeter;
182 outstream << "Xforce" + delimeter + "Yforce" + delimeter + "Zforce";
184 if (SubSystems & ssMoments) {
185 outstream << delimeter;
186 outstream << "L" + delimeter + "M" + delimeter + "N";
188 if (SubSystems & ssAtmosphere) {
189 outstream << delimeter;
190 outstream << "Rho" + delimeter;
191 outstream << "SL pressure" + delimeter;
192 outstream << "Ambient pressure" + delimeter;
193 outstream << "NWind" + delimeter + "EWind" + delimeter + "DWind";
195 if (SubSystems & ssMassProps) {
196 outstream << delimeter;
197 outstream << "Ixx" + delimeter;
198 outstream << "Ixy" + delimeter;
199 outstream << "Ixz" + delimeter;
200 outstream << "Iyx" + delimeter;
201 outstream << "Iyy" + delimeter;
202 outstream << "Iyz" + delimeter;
203 outstream << "Izx" + delimeter;
204 outstream << "Izy" + delimeter;
205 outstream << "Izz" + delimeter;
206 outstream << "Mass" + delimeter;
207 outstream << "Xcg" + delimeter + "Ycg" + delimeter + "Zcg";
209 if (SubSystems & ssPropagate) {
210 outstream << delimeter;
211 outstream << "Altitude" + delimeter;
212 outstream << "Phi" + delimeter + "Tht" + delimeter + "Psi" + delimeter;
213 outstream << "Alpha" + delimeter;
214 outstream << "Beta" + delimeter;
215 outstream << "Latitude (Deg)" + delimeter;
216 outstream << "Longitude (Deg)" + delimeter;
217 outstream << "Distance AGL" + delimeter;
218 outstream << "Runway Radius";
220 if (SubSystems & ssCoefficients) {
221 scratch = Aerodynamics->GetCoefficientStrings(delimeter);
222 if (scratch.length() != 0) outstream << delimeter << scratch;
224 if (SubSystems & ssFCS) {
225 scratch = FCS->GetComponentStrings(delimeter);
226 if (scratch.length() != 0) outstream << delimeter << scratch;
228 if (SubSystems & ssGroundReactions) {
229 outstream << delimeter;
230 outstream << GroundReactions->GetGroundReactionStrings(delimeter);
232 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
233 outstream << delimeter;
234 outstream << Propulsion->GetPropulsionStrings(delimeter);
236 if (OutputProperties.size() > 0) {
237 for (unsigned int i=0;i<OutputProperties.size();i++) {
238 outstream << delimeter << OutputProperties[i]->GetName();
246 outstream << State->Getsim_time();
247 if (SubSystems & ssSimulation) {
249 if (SubSystems & ssAerosurfaces) {
250 outstream << delimeter;
251 outstream << FCS->GetDaCmd() << delimeter;
252 outstream << FCS->GetDeCmd() << delimeter;
253 outstream << FCS->GetDrCmd() << delimeter;
254 outstream << FCS->GetDfCmd() << delimeter;
255 outstream << FCS->GetDaLPos() << delimeter;
256 outstream << FCS->GetDaRPos() << delimeter;
257 outstream << FCS->GetDePos() << delimeter;
258 outstream << FCS->GetDrPos() << delimeter;
259 outstream << FCS->GetDfPos();
261 if (SubSystems & ssRates) {
262 outstream << delimeter;
263 outstream << Propagate->GetPQR().Dump(delimeter) << delimeter;
264 outstream << Propagate->GetPQRdot().Dump(delimeter);
266 if (SubSystems & ssVelocities) {
267 outstream << delimeter;
268 outstream << Auxiliary->Getqbar() << delimeter;
269 outstream << setprecision(12) << Auxiliary->GetVt() << delimeter;
270 outstream << setprecision(12) << Propagate->GetUVW().Dump(delimeter) << delimeter;
271 outstream << Auxiliary->GetAeroUVW().Dump(delimeter) << delimeter;
272 outstream << Propagate->GetVel().Dump(delimeter);
274 if (SubSystems & ssForces) {
275 outstream << delimeter;
276 outstream << Aerodynamics->GetvFs() << delimeter;
277 outstream << Aerodynamics->GetLoD() << delimeter;
278 outstream << Aircraft->GetForces().Dump(delimeter);
280 if (SubSystems & ssMoments) {
281 outstream << delimeter;
282 outstream << Aircraft->GetMoments().Dump(delimeter);
284 if (SubSystems & ssAtmosphere) {
285 outstream << delimeter;
286 outstream << Atmosphere->GetDensity() << delimeter;
287 outstream << Atmosphere->GetPressureSL() << delimeter;
288 outstream << Atmosphere->GetPressure() << delimeter;
289 outstream << Atmosphere->GetWindNED().Dump(delimeter);
291 if (SubSystems & ssMassProps) {
292 outstream << delimeter;
293 outstream << MassBalance->GetJ() << delimeter;
294 outstream << MassBalance->GetMass() << delimeter;
295 outstream << MassBalance->GetXYZcg();
297 if (SubSystems & ssPropagate) {
298 outstream << delimeter;
299 outstream << Propagate->Geth() << delimeter;
300 outstream << Propagate->GetEuler().Dump(delimeter) << delimeter;
301 outstream << Auxiliary->Getalpha(inDegrees) << delimeter;
302 outstream << Auxiliary->Getbeta(inDegrees) << delimeter;
303 outstream << Propagate->GetLocation().GetLatitudeDeg() << delimeter;
304 outstream << Propagate->GetLocation().GetLongitudeDeg() << delimeter;
305 outstream << Propagate->GetDistanceAGL() << delimeter;
306 outstream << Propagate->GetRunwayRadius();
308 if (SubSystems & ssCoefficients) {
309 scratch = Aerodynamics->GetCoefficientValues(delimeter);
310 if (scratch.length() != 0) outstream << delimeter << scratch;
312 if (SubSystems & ssFCS) {
313 scratch = FCS->GetComponentValues(delimeter);
314 if (scratch.length() != 0) outstream << delimeter << scratch;
316 if (SubSystems & ssGroundReactions) {
317 outstream << delimeter;
318 outstream << GroundReactions->GetGroundReactionValues(delimeter);
320 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
321 outstream << delimeter;
322 outstream << Propulsion->GetPropulsionValues(delimeter);
325 for (unsigned int i=0;i<OutputProperties.size();i++) {
326 outstream << delimeter << OutputProperties[i]->getDoubleValue();
333 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
335 void FGOutput::SocketOutput(void)
337 string asciiData, scratch;
339 if (socket == NULL) return;
340 if (!socket->GetConnectStatus()) return;
344 socket->Clear("<LABELS>");
345 socket->Append("Time");
347 if (SubSystems & ssAerosurfaces) {
348 socket->Append("Aileron Command");
349 socket->Append("Elevator Command");
350 socket->Append("Rudder Command");
351 socket->Append("Flap Command");
352 socket->Append("Left Aileron Position");
353 socket->Append("Right Aileron Position");
354 socket->Append("Elevator Position");
355 socket->Append("Rudder Position");
356 socket->Append("Flap Position");
359 if (SubSystems & ssRates) {
363 socket->Append("PDot");
364 socket->Append("QDot");
365 socket->Append("RDot");
368 if (SubSystems & ssVelocities) {
369 socket->Append("QBar");
370 socket->Append("Vtotal");
371 socket->Append("UBody");
372 socket->Append("VBody");
373 socket->Append("WBody");
374 socket->Append("UAero");
375 socket->Append("VAero");
376 socket->Append("WAero");
377 socket->Append("Vn");
378 socket->Append("Ve");
379 socket->Append("Vd");
381 if (SubSystems & ssForces) {
382 socket->Append("F_Drag");
383 socket->Append("F_Side");
384 socket->Append("F_Lift");
385 socket->Append("LoD");
386 socket->Append("Fx");
387 socket->Append("Fy");
388 socket->Append("Fz");
390 if (SubSystems & ssMoments) {
395 if (SubSystems & ssAtmosphere) {
396 socket->Append("Rho");
397 socket->Append("SL pressure");
398 socket->Append("Ambient pressure");
399 socket->Append("NWind");
400 socket->Append("EWind");
401 socket->Append("DWind");
403 if (SubSystems & ssMassProps) {
404 socket->Append("Ixx");
405 socket->Append("Ixy");
406 socket->Append("Ixz");
407 socket->Append("Iyx");
408 socket->Append("Iyy");
409 socket->Append("Iyz");
410 socket->Append("Izx");
411 socket->Append("Izy");
412 socket->Append("Izz");
413 socket->Append("Mass");
414 socket->Append("Xcg");
415 socket->Append("Ycg");
416 socket->Append("Zcg");
418 if (SubSystems & ssPropagate) {
419 socket->Append("Altitude");
420 socket->Append("Phi");
421 socket->Append("Tht");
422 socket->Append("Psi");
423 socket->Append("Alpha");
424 socket->Append("Beta");
425 socket->Append("Latitude (Deg)");
426 socket->Append("Longitude (Deg)");
428 if (SubSystems & ssCoefficients) {
429 scratch = Aerodynamics->GetCoefficientStrings(",");
430 if (scratch.length() != 0) socket->Append(scratch);
432 if (SubSystems & ssFCS) {
433 scratch = FCS->GetComponentStrings(",");
434 if (scratch.length() != 0) socket->Append(scratch);
436 if (SubSystems & ssGroundReactions) {
437 socket->Append(GroundReactions->GetGroundReactionStrings(","));
439 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
440 socket->Append(Propulsion->GetPropulsionStrings(","));
442 if (OutputProperties.size() > 0) {
443 for (unsigned int i=0;i<OutputProperties.size();i++) {
444 socket->Append(OutputProperties[i]->GetName());
453 socket->Append(State->Getsim_time());
455 if (SubSystems & ssAerosurfaces) {
456 socket->Append(FCS->GetDaCmd());
457 socket->Append(FCS->GetDeCmd());
458 socket->Append(FCS->GetDrCmd());
459 socket->Append(FCS->GetDfCmd());
460 socket->Append(FCS->GetDaLPos());
461 socket->Append(FCS->GetDaRPos());
462 socket->Append(FCS->GetDePos());
463 socket->Append(FCS->GetDrPos());
464 socket->Append(FCS->GetDfPos());
466 if (SubSystems & ssRates) {
467 socket->Append(Propagate->GetPQR(eP));
468 socket->Append(Propagate->GetPQR(eQ));
469 socket->Append(Propagate->GetPQR(eR));
470 socket->Append(Propagate->GetPQRdot(eP));
471 socket->Append(Propagate->GetPQRdot(eQ));
472 socket->Append(Propagate->GetPQRdot(eR));
474 if (SubSystems & ssVelocities) {
475 socket->Append(Auxiliary->Getqbar());
476 socket->Append(Auxiliary->GetVt());
477 socket->Append(Propagate->GetUVW(eU));
478 socket->Append(Propagate->GetUVW(eV));
479 socket->Append(Propagate->GetUVW(eW));
480 socket->Append(Auxiliary->GetAeroUVW(eU));
481 socket->Append(Auxiliary->GetAeroUVW(eV));
482 socket->Append(Auxiliary->GetAeroUVW(eW));
483 socket->Append(Propagate->GetVel(eNorth));
484 socket->Append(Propagate->GetVel(eEast));
485 socket->Append(Propagate->GetVel(eDown));
487 if (SubSystems & ssForces) {
488 socket->Append(Aerodynamics->GetvFs()(eDrag));
489 socket->Append(Aerodynamics->GetvFs()(eSide));
490 socket->Append(Aerodynamics->GetvFs()(eLift));
491 socket->Append(Aerodynamics->GetLoD());
492 socket->Append(Aircraft->GetForces(eX));
493 socket->Append(Aircraft->GetForces(eY));
494 socket->Append(Aircraft->GetForces(eZ));
496 if (SubSystems & ssMoments) {
497 socket->Append(Aircraft->GetMoments(eL));
498 socket->Append(Aircraft->GetMoments(eM));
499 socket->Append(Aircraft->GetMoments(eN));
501 if (SubSystems & ssAtmosphere) {
502 socket->Append(Atmosphere->GetDensity());
503 socket->Append(Atmosphere->GetPressureSL());
504 socket->Append(Atmosphere->GetPressure());
505 socket->Append(Atmosphere->GetWindNED().Dump(","));
507 if (SubSystems & ssMassProps) {
508 socket->Append(MassBalance->GetJ()(1,1));
509 socket->Append(MassBalance->GetJ()(1,2));
510 socket->Append(MassBalance->GetJ()(1,3));
511 socket->Append(MassBalance->GetJ()(2,1));
512 socket->Append(MassBalance->GetJ()(2,2));
513 socket->Append(MassBalance->GetJ()(2,3));
514 socket->Append(MassBalance->GetJ()(3,1));
515 socket->Append(MassBalance->GetJ()(3,2));
516 socket->Append(MassBalance->GetJ()(3,3));
517 socket->Append(MassBalance->GetMass());
518 socket->Append(MassBalance->GetXYZcg()(eX));
519 socket->Append(MassBalance->GetXYZcg()(eY));
520 socket->Append(MassBalance->GetXYZcg()(eZ));
522 if (SubSystems & ssPropagate) {
523 socket->Append(Propagate->Geth());
524 socket->Append(Propagate->GetEuler(ePhi));
525 socket->Append(Propagate->GetEuler(eTht));
526 socket->Append(Propagate->GetEuler(ePsi));
527 socket->Append(Auxiliary->Getalpha(inDegrees));
528 socket->Append(Auxiliary->Getbeta(inDegrees));
529 socket->Append(Propagate->GetLocation().GetLatitudeDeg());
530 socket->Append(Propagate->GetLocation().GetLongitudeDeg());
532 if (SubSystems & ssCoefficients) {
533 scratch = Aerodynamics->GetCoefficientValues(",");
534 if (scratch.length() != 0) socket->Append(scratch);
536 if (SubSystems & ssFCS) {
537 scratch = FCS->GetComponentValues(",");
538 if (scratch.length() != 0) socket->Append(scratch);
540 if (SubSystems & ssGroundReactions) {
541 socket->Append(GroundReactions->GetGroundReactionValues(","));
543 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
544 socket->Append(Propulsion->GetPropulsionValues(","));
547 for (unsigned int i=0;i<OutputProperties.size();i++) {
548 socket->Append(OutputProperties[i]->getDoubleValue());
554 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
556 void FGOutput::SocketStatusOutput(string out_str)
560 if (socket == NULL) return;
563 asciiData = string("<STATUS>") + out_str;
564 socket->Append(asciiData.c_str());
568 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
570 bool FGOutput::Load(Element* element)
572 string type="", parameter="";
573 string name="", fname="";
577 FGXMLParse output_file_parser;
578 Element *document, *property_element;
579 ifstream* output_file = new ifstream();
581 string separator = "/";
586 fname = element->GetAttributeValue("file");
587 if (!fname.empty()) {
588 output_file_name = FDMExec->GetAircraftPath() + separator
589 + FDMExec->GetModelName() + separator + fname + ".xml";
591 output_file->open(output_file_name.c_str());
592 readXML(*output_file, output_file_parser);
594 document = output_file_parser.GetDocument();
599 name = document->GetAttributeValue("name");
600 type = document->GetAttributeValue("type");
602 if (!document->GetAttributeValue("port").empty() && type == string("SOCKET")) {
603 port = atoi(document->GetAttributeValue("port").c_str());
604 socket = new FGfdmSocket(name, port);
608 if (!document->GetAttributeValue("rate").empty()) {
609 OutRate = (int)document->GetAttributeValueAsNumber("rate");
614 if (document->FindElementValue("simulation") == string("ON"))
615 SubSystems += ssSimulation;
616 if (document->FindElementValue("aerosurfaces") == string("ON"))
617 SubSystems += ssAerosurfaces;
618 if (document->FindElementValue("rates") == string("ON"))
619 SubSystems += ssRates;
620 if (document->FindElementValue("velocities") == string("ON"))
621 SubSystems += ssVelocities;
622 if (document->FindElementValue("forces") == string("ON"))
623 SubSystems += ssForces;
624 if (document->FindElementValue("moments") == string("ON"))
625 SubSystems += ssMoments;
626 if (document->FindElementValue("atmosphere") == string("ON"))
627 SubSystems += ssAtmosphere;
628 if (document->FindElementValue("massprops") == string("ON"))
629 SubSystems += ssMassProps;
630 if (document->FindElementValue("position") == string("ON"))
631 SubSystems += ssPropagate;
632 if (document->FindElementValue("coefficients") == string("ON"))
633 SubSystems += ssCoefficients;
634 if (document->FindElementValue("ground_reactions") == string("ON"))
635 SubSystems += ssGroundReactions;
636 if (document->FindElementValue("fcs") == string("ON"))
638 if (document->FindElementValue("propulsion") == string("ON"))
639 SubSystems += ssPropulsion;
640 property_element = document->FindElement("property");
641 while (property_element) {
642 string property = property_element->GetDataLine();
643 OutputProperties.push_back(PropertyManager->GetNode(property));
644 property_element = document->FindNextElement("property");
647 OutRate = OutRate>120?120:(OutRate<0?0:OutRate);
648 rate = (int)(0.5 + 1.0/(State->Getdt()*OutRate));
655 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
656 // The bitmasked value choices are as follows:
657 // unset: In this case (the default) JSBSim would only print
658 // out the normally expected messages, essentially echoing
659 // the config files as they are read. If the environment
660 // variable is not set, debug_lvl is set to 1 internally
661 // 0: This requests JSBSim not to output any messages
663 // 1: This value explicity requests the normal JSBSim
665 // 2: This value asks for a message to be printed out when
666 // a class is instantiated
667 // 4: When this value is set, a message is displayed when a
668 // FGModel object executes its Run() method
669 // 8: When this value is set, various runtime state variables
670 // are printed out periodically
671 // 16: When set various parameters are sanity checked and
672 // a message is printed out when they go out of bounds
674 void FGOutput::Debug(int from)
678 if (debug_lvl <= 0) return;
680 if (debug_lvl & 1) { // Standard console startup message output
681 if (from == 0) { // Constructor
685 if (output_file_name.empty())
686 cout << " " << "Output parameters read inline" << endl;
688 cout << " Output parameters read from file: " << output_file_name << endl;
690 if (Filename == "cout" || Filename == "COUT") {
691 scratch = " Log output goes to screen console";
692 } else if (!Filename.empty()) {
693 scratch = " Log output goes to file: " + Filename;
697 cout << scratch << " in CSV format output at rate " << 120/rate << " Hz" << endl;
700 cout << " No log output" << endl;
704 if (SubSystems & ssSimulation) cout << " Simulation parameters logged" << endl;
705 if (SubSystems & ssAerosurfaces) cout << " Aerosurface parameters logged" << endl;
706 if (SubSystems & ssRates) cout << " Rate parameters logged" << endl;
707 if (SubSystems & ssVelocities) cout << " Velocity parameters logged" << endl;
708 if (SubSystems & ssForces) cout << " Force parameters logged" << endl;
709 if (SubSystems & ssMoments) cout << " Moments parameters logged" << endl;
710 if (SubSystems & ssAtmosphere) cout << " Atmosphere parameters logged" << endl;
711 if (SubSystems & ssMassProps) cout << " Mass parameters logged" << endl;
712 if (SubSystems & ssCoefficients) cout << " Coefficient parameters logged" << endl;
713 if (SubSystems & ssPropagate) cout << " Propagate parameters logged" << endl;
714 if (SubSystems & ssGroundReactions) cout << " Ground parameters logged" << endl;
715 if (SubSystems & ssFCS) cout << " FCS parameters logged" << endl;
716 if (SubSystems & ssPropulsion) cout << " Propulsion parameters logged" << endl;
717 if (OutputProperties.size() > 0) cout << " Properties logged:" << endl;
718 for (unsigned int i=0;i<OutputProperties.size();i++) {
719 cout << " - " << OutputProperties[i]->GetName() << endl;
723 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
724 if (from == 0) cout << "Instantiated: FGOutput" << endl;
725 if (from == 1) cout << "Destroyed: FGOutput" << endl;
727 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
729 if (debug_lvl & 8 ) { // Runtime state variables
731 if (debug_lvl & 16) { // Sanity checking
733 if (debug_lvl & 64) {
734 if (from == 0) { // Constructor
735 cout << IdSrc << endl;
736 cout << IdHdr << endl;