fix uninitialized ThrottlePos in FGTurbine
ThrottlePos is used in InitRunning() to calculate N2 before the first Calculate() initializes it from the engine.
We observed the uninitialized memory sometimes causing astronomical full consumption because ThrottlePos->N2->Thrust->fuel consumption.
Codecov Report
Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
Project coverage is 24.76%. Comparing base (
1f7bceb) to head (b1a3ac0). Report is 2 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/models/propulsion/FGTurbine.cpp | 0.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #1297 +/- ##
==========================================
- Coverage 24.76% 24.76% -0.01%
==========================================
Files 169 169
Lines 19605 19606 +1
==========================================
Hits 4856 4856
- Misses 14749 14750 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Just wondering whether InitRunning() should use this instead of 0.
ThrottlePos = in.ThrottlePos[EngineNumber];
Just wondering whether
InitRunning()should use this instead of 0.ThrottlePos = in.ThrottlePos[EngineNumber];
Yeah, looks correct to me. But I'm not deep enough into the codebase to have an informed opinion. 😄
I would keep it as a separate commit because that technically changes the behavior? In practice it probably doesn't matter.
It rang a bell, just looked it up, based on this commit - https://github.com/JSBSim-Team/jsbsim/commit/a48cf0e6301de42cbb49e9442849caf7e44f8cb5 there is code that specifically sets the throttle position before the engine type specific InitRunning() is called.
PR merged. Thanks for your contribution.