]> git.mxchange.org Git - flightgear.git/commitdiff
Begin wiring Dave Luff's engine model into JSBSim.
authorcurt <curt>
Fri, 5 Oct 2001 20:27:33 +0000 (20:27 +0000)
committercurt <curt>
Fri, 5 Oct 2001 20:27:33 +0000 (20:27 +0000)
src/FDM/JSBSim.cxx
src/FDM/LaRCsim.cxx
src/FDM/flight.hxx

index 406ce3a42bd6f9e85704d2ab475c03980029b1cf..4ec1faf70148900217d3ce28a0d13dc7818fa8cc 100644 (file)
@@ -246,8 +246,15 @@ bool FGJSBsim::update( int multiloop ) {
     }
   
     for( i=0; i<get_num_engines(); i++ ) {
-      get_engine(i)->set_RPM( Propulsion->GetThruster(i)->GetRPM() );
-      get_engine(i)->set_Throttle( globals->get_controls()->get_throttle(i) );
+      FGEngInterface * e = get_engine(i);
+      FGEngine * eng = Propulsion->GetEngine(i);
+      FGThruster * thrust = Propulsion->GetThruster(i);
+      e->set_Manifold_Pressure( eng->getManifoldPressure_inHg() );
+      e->set_RPM( thrust->GetRPM() );
+      e->set_EGT( eng->getExhaustGasTemp_degF() );
+      e->set_CHT( eng->getCylinderHeadTemp_degF() );
+      e->set_Oil_Temp( eng->getOilTemp_degF() );
+      e->set_Throttle( globals->get_controls()->get_throttle(i) );
     }
 
     for ( i=0; i < multiloop; i++ ) {
@@ -283,6 +290,7 @@ bool FGJSBsim::copy_to_JSBsim() {
     FCS->SetCBrake( globals->get_controls()->get_brake( 2 ) );
     for (int i = 0; i < get_num_engines(); i++) {
       FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
+      FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
     }
 
     Position->SetSeaLevelRadius( get_Sea_level_radius() );
index 07ebb0ea55852328f0d8190a12eaee2feef1786a..a61bc1c6157e9e834e3add22a7a0eb7054aa1425 100644 (file)
@@ -74,8 +74,8 @@ FGLaRCsim::FGLaRCsim( double dt ) {
     // Hardwired to C172 full tanks for now - need to fix this sometime
     // Also note that this is the max quantity - the usable quantity
     // is slightly less
-    set_Tank1Fuel(28.0);
-    set_Tank2Fuel(28.0);  
+    set_Tank1Fuel(14.0);
+    set_Tank2Fuel(14.0);  
 
 
 }
@@ -128,6 +128,7 @@ bool FGLaRCsim::update( int multiloop ) {
        e->set_CHT( eng.get_CHT() );
        e->set_prop_thrust( eng.get_prop_thrust_SI() );
        e->set_Fuel_Flow( eng.get_fuel_flow_gals_hr() );
+       e->set_Oil_Temp( eng.get_oil_temp() );
 
         //Assume we are using both tanks equally for now
        reduce_Tank1Fuel( (eng.get_fuel_flow_gals_hr() / (2 * 3600))
index 35e9c2c9d1f1b10600aca407ffeae37b190b61cc..fd1a24efd84fe4ac7548868545188f482f3fbec1 100644 (file)
@@ -120,6 +120,7 @@ private:
     double CHT;                   //deg F
     double prop_thrust;           //lbs
     double Fuel_Flow;             //Gals/hr
+    double Oil_Temp;             //deg F
     
     /* others...
     double PercentN1,N1;  //GE,CFM
@@ -147,6 +148,7 @@ public:
     inline double get_CHT() const { return CHT; }
     inline double get_prop_thrust() const { return prop_thrust; }
     inline double get_Fuel_Flow() const { return Fuel_Flow; }
+    inline double get_Oil_Temp() const { return Oil_Temp; }
 
     inline void set_Throttle( double t ) { Throttle = t; }
     inline void set_Mixture( double m ) { Mixture = m; }
@@ -159,6 +161,7 @@ public:
     inline void set_CHT( double c ) { CHT = c; }
     inline void set_prop_thrust( double t ) { prop_thrust = t; }
     inline void set_Fuel_Flow( double f ) { Fuel_Flow = f; }
+    inline void set_Oil_Temp (double o) { Oil_Temp = o; }
 
 };