Added ability to set engine RPM from FlightGear.
This commit is contained in:
parent
1d35fab813
commit
cf7f829130
3 changed files with 5 additions and 1 deletions
|
@ -333,6 +333,7 @@ bool FGJSBsim::copy_to_JSBsim() {
|
||||||
FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
|
FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
|
||||||
FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
|
FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
|
||||||
FCS->SetPropAdvanceCmd(i, globals->get_controls()->get_prop_advance(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() );
|
Position->SetSeaLevelRadius( get_Sea_level_radius() );
|
||||||
|
|
|
@ -77,6 +77,7 @@ public:
|
||||||
virtual double Calculate(double) {return 0.0;}
|
virtual double Calculate(double) {return 0.0;}
|
||||||
void SetName(string name) {Name = name;}
|
void SetName(string name) {Name = name;}
|
||||||
void SetThrusterNumber(int nn) {ThrusterNumber = nn;}
|
void SetThrusterNumber(int nn) {ThrusterNumber = nn;}
|
||||||
|
virtual void SetRPM(double rpm) {};
|
||||||
virtual double GetPowerRequired(void) {return 0.0;}
|
virtual double GetPowerRequired(void) {return 0.0;}
|
||||||
virtual void SetdeltaT(double dt) {deltaT = dt;}
|
virtual void SetdeltaT(double dt) {deltaT = dt;}
|
||||||
double GetThrust(void) {return Thrust;}
|
double GetThrust(void) {return Thrust;}
|
||||||
|
|
|
@ -392,7 +392,9 @@ FGInterface::bind ()
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
sprintf(buf, "/engines/engine[%d]/rpm", i);
|
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);
|
sprintf(buf, "/engines/engine[%d]/egt-degf", i);
|
||||||
fgTie(buf, get_engine(i), &FGEngInterface::get_EGT);
|
fgTie(buf, get_engine(i), &FGEngInterface::get_EGT);
|
||||||
|
|
Loading…
Reference in a new issue