]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPiston.cpp
JSBSim tweaks.
[flightgear.git] / src / FDM / JSBSim / FGPiston.cpp
index 914d7fa1b7b0bee7f457eed2fe8fd57b24bbb21b..e60a65fa39f3e8fc63631b2fca3fc4364998ee2c 100644 (file)
@@ -54,36 +54,31 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec)
   string token;
 
   Name = Eng_cfg->GetValue("NAME");
-  cout << "\n    Engine Name: " << Name << endl;
   Eng_cfg->GetNextConfigLine();
   while (Eng_cfg->GetValue() != "/FG_PISTON") {
     *Eng_cfg >> token;
-    if (token == "BRAKEHORSEPOWER") {
-      *Eng_cfg >> BrakeHorsePower;
-      cout << "      BrakeHorsePower = " << BrakeHorsePower << endl;
-    } else if (token == "MAXTHROTTLE") {
-      *Eng_cfg >> MaxThrottle;
-      cout << "      MaxThrottle = " << MaxThrottle << endl;
-    } else if (token == "MINTHROTTLE") {
-      *Eng_cfg >> MinThrottle;
-      cout << "      MinThrottle = " << MinThrottle << endl;
-    } else if (token == "SLFUELFLOWMAX") {
-      *Eng_cfg >> SLFuelFlowMax;
-      cout << "      SLFuelFlowMax = " << SLFuelFlowMax << endl;
-    } else if (token == "SPEEDSLOPE") {
-      *Eng_cfg >> SpeedSlope;
-      cout << "      SpeedSlope = " << SpeedSlope << endl;
-    } else if (token == "SPEEDINTERCEPT") {
-      *Eng_cfg >> SpeedIntercept;
-      cout << "      SpeedIntercept = " << SpeedIntercept << endl;
-    } else if (token == "ALTITUDESLOPE") {
-      *Eng_cfg >> AltitudeSlope;
-      cout << "      AltitudeSlope = " << AltitudeSlope << endl;
-    } else {
-      cout << "Unhandled token in Engine config file: " << token << endl;
-    }
+    if      (token == "BRAKEHORSEPOWER") *Eng_cfg >> BrakeHorsePower;
+    else if (token == "MAXTHROTTLE")     *Eng_cfg >> MaxThrottle;
+    else if (token == "MINTHROTTLE")     *Eng_cfg >> MinThrottle;
+    else if (token == "SLFUELFLOWMAX")   *Eng_cfg >> SLFuelFlowMax;
+    else if (token == "SPEEDSLOPE")      *Eng_cfg >> SpeedSlope;
+    else if (token == "SPEEDINTERCEPT")  *Eng_cfg >> SpeedIntercept;
+    else if (token == "ALTITUDESLOPE")   *Eng_cfg >> AltitudeSlope;
+    else cerr << "Unhandled token in Engine config file: " << token << endl;
   }
 
+  if (debug_lvl > 0) {
+    cout << "\n    Engine Name: " << Name << endl;
+    cout << "      BrakeHorsePower = " << BrakeHorsePower << endl;
+    cout << "      MaxThrottle = " << MaxThrottle << endl;
+    cout << "      MinThrottle = " << MinThrottle << endl;
+    cout << "      SLFuelFlowMax = " << SLFuelFlowMax << endl;
+    cout << "      SpeedSlope = " << SpeedSlope << endl;
+    cout << "      SpeedIntercept = " << SpeedIntercept << endl;
+    cout << "      AltitudeSlope = " << AltitudeSlope << endl;
+  }
+
+  Type = etPiston;
   EngineNumber = 0;
 
   if (debug_lvl & 2) cout << "Instantiated: FGPiston" << endl;