1
0
Fork 0

Added ability to set engine RPM from FlightGear.

This commit is contained in:
david 2002-01-14 14:23:53 +00:00
parent 1d35fab813
commit cf7f829130
3 changed files with 5 additions and 1 deletions

View file

@ -333,6 +333,7 @@ bool FGJSBsim::copy_to_JSBsim() {
FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
FCS->SetPropAdvanceCmd(i, globals->get_controls()->get_prop_advance(i));
Propulsion->GetThruster(i)->SetRPM(get_engine(i)->get_RPM());
}
Position->SetSeaLevelRadius( get_Sea_level_radius() );

View file

@ -77,6 +77,7 @@ public:
virtual double Calculate(double) {return 0.0;}
void SetName(string name) {Name = name;}
void SetThrusterNumber(int nn) {ThrusterNumber = nn;}
virtual void SetRPM(double rpm) {};
virtual double GetPowerRequired(void) {return 0.0;}
virtual void SetdeltaT(double dt) {deltaT = dt;}
double GetThrust(void) {return Thrust;}

View file

@ -392,7 +392,9 @@ FGInterface::bind ()
char buf[64];
sprintf(buf, "/engines/engine[%d]/rpm", i);
fgTie(buf, get_engine(i), &FGEngInterface::get_RPM);
fgTie(buf, get_engine(i),
&FGEngInterface::get_RPM, &FGEngInterface::set_RPM);
fgSetArchivable(buf);
sprintf(buf, "/engines/engine[%d]/egt-degf", i);
fgTie(buf, get_engine(i), &FGEngInterface::get_EGT);