From: curt Date: Fri, 29 Sep 2000 22:02:32 +0000 (+0000) Subject: Tie the engine0 rpm to the property manager. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=83d06fb4d661d2c8e17d7cc81078863628920444;p=flightgear.git Tie the engine0 rpm to the property manager. --- diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index 7a492938e..c124e0dfd 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -123,6 +123,10 @@ FGBFI::init () current_properties.tieDouble("/orientation/roll", getRoll, setRoll); + // Engine + current_properties.tieDouble("/engine0/rpm", + getRPM, setRPM); + // Velocities current_properties.tieDouble("/velocities/airspeed", getAirspeed, 0); @@ -658,6 +662,26 @@ FGBFI::setRoll (double roll) } +/** + * Return the current engine0 rpm + */ +double +FGBFI::getRPM () +{ + return current_aircraft.fdm_state->get_engine(0)->get_RPM(); +} + + +/** + * Set the current engine0 rpm + */ +void +FGBFI::setRPM (double rpm) +{ + current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm ); +} + + //////////////////////////////////////////////////////////////////////// // Velocities diff --git a/src/Main/bfi.hxx b/src/Main/bfi.hxx index 42635639a..bc3c9d674 100644 --- a/src/Main/bfi.hxx +++ b/src/Main/bfi.hxx @@ -90,6 +90,9 @@ public: static void setPitch (double pitch); static void setRoll (double roll); + // Engine + static double getRPM (); + static void setRPM ( double rpm ); // Velocities static double getAirspeed ();