]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/proptest.cpp
FGPUIDialog: fix reading from already free'd memory.
[flightgear.git] / src / FDM / YASim / proptest.cpp
index 81955b5a882912a4306a7b1143807e8978189cb8..cc4ffc42110fe2bfe8b1d978eed7c37175bc2038 100644 (file)
@@ -5,8 +5,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <simgear/math/SGMath.hxx>
-
 #include "Math.hpp"
 #include "FGFDM.hpp"
 #include "PropEngine.hpp"
@@ -26,8 +24,8 @@ bool fgSetString(char const * name, char const * str) { return false; }
 SGPropertyNode* fgGetNode (const char * path, bool create) { return 0; }
 SGPropertyNode* fgGetNode (const char * path, int i, bool create) { return 0; }
 float fgGetFloat (const char * name, float defaultValue) { return 0; }
-float fgGetDouble (const char * name, double defaultValue) { return 0; }
-float fgSetDouble (const char * name, double defaultValue) { return 0; }
+double fgGetDouble (const char * name, double defaultValue) { return 0; }
+bool fgSetDouble (const char * name, double defaultValue) { return false; }
 
 static const float KTS2MPS = 0.514444444444;
 static const float RPM2RAD = 0.10471975512;
@@ -82,6 +80,8 @@ int main(int argc, char** argv)
 
     printf("Alt: %f\n", alt / FT2M);
     printf("Spd: %f\n", speed / KTS2MPS);
+    printf("-----------------\n");
+    printf("Throt   RPM   thrustlbs      HP   eff %%   torque\n");
     for(int i=0; i<COUNT; i++) {
         float throttle = i/(COUNT-1.0);
         pe->setThrottle(throttle);
@@ -97,13 +97,14 @@ int main(int argc, char** argv)
 
         float eff = thrust * speed / power;
 
-        printf("%6.3f: %6.1frpm %6.1flbs %6.1fhp %6.1f%% torque: %f\n",
+        printf("%5.3f %7.1f %8.1f %8.1f %7.1f %8.1f\n",
                throttle, rpm, thrust * N2LB, power * (1/HP2W), 100*eff, eng->getTorque());
     }
 
     printf("\n");
     printf("Propeller vs. RPM\n");
     printf("-----------------\n");
+    printf("RPM       thrustlbs         HP   eff %%      torque\n");
     for(int i=0; i<COUNT; i++) {
         float thrust, torque, rpm = 3000 * i/(COUNT-1.0);
         float omega = rpm * RPM2RAD;
@@ -111,7 +112,7 @@ int main(int argc, char** argv)
                    speed, omega, &thrust, &torque);
         float power = torque * omega;
         float eff = (thrust * speed) / power;
-        printf("%6.1frpm %6.1flbs %6.1fhp %.1f%% torque: %f\n",
+        printf("%7.1f %11.1f %10.1f %7.1f %11.1f\n",
                rpm, thrust * N2LB, power * (1/HP2W), 100*eff, torque);
     }
 }