From 83d06fb4d661d2c8e17d7cc81078863628920444 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 29 Sep 2000 22:02:32 +0000 Subject: [PATCH] Tie the engine0 rpm to the property manager. --- src/Main/bfi.cxx | 24 ++++++++++++++++++++++++ src/Main/bfi.hxx | 3 +++ 2 files changed, 27 insertions(+) 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 (); -- 2.39.5