Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the Mach/VCAS conversion methods to FGAuxiliary #898

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

bcoconni
Copy link
Member

This PR is a counter proposal to the PRs #881 and #885 that I previously submitted. The motivations remain the same than the ones exposed in #881 while avoiding the problems that the PR #885 is awkwardly trying to fix. In the current PR, the Mach/VCAS conversion methods are moved to FGAuxiliary. As such this PR undoes #881 and supersedes #885.

Basically the idea is to move the Mach/VCAS conversion routines to FGAuxiliary rather than to FGAtmosphere as the PR #881 did. For that purpose, FGAuxiliary only needs an access to FGAtmosphere constants such as the specific heat ratio and the standard day pressure, temperature and speed of sound. As these are constexpr members, FGAuxiliary can safely access them using C++ qualified identifiers such as FGAtmosphere::StdDaySLpressure which is much simpler than #881 and #885 combined. Even though the standard day speed of sound needs a special treatment as the function sqrt cannot be used for constexpr members. So we need to fall back to a good old const variable for StdDaySLsoundspeed.

IMHO, with this PR, all the pieces are finally falling into place and I'd suggest to merge this PR and cancel #885.

@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #898 (8ca5fed) into master (95f143e) will increase coverage by 0.04%.
The diff coverage is 89.28%.

@@            Coverage Diff             @@
##           master     #898      +/-   ##
==========================================
+ Coverage   23.05%   23.10%   +0.04%     
==========================================
  Files         167      167              
  Lines       19619    19627       +8     
==========================================
+ Hits         4524     4534      +10     
+ Misses      15095    15093       -2     
Impacted Files Coverage Δ
src/initialization/FGInitialCondition.h 74.71% <ø> (ø)
src/models/FGAtmosphere.cpp 93.64% <ø> (-0.94%) ⬇️
src/models/FGAtmosphere.h 100.00% <ø> (ø)
src/models/FGAuxiliary.h 84.90% <ø> (ø)
src/initialization/FGInitialCondition.cpp 45.18% <69.23%> (+0.32%) ⬆️
src/models/FGAuxiliary.cpp 66.00% <94.44%> (+4.81%) ⬆️
src/FGFDMExec.cpp 41.48% <100.00%> (+0.27%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@seanmcleod
Copy link
Member

Looks good.

@agodemar agodemar merged commit 02b4e25 into JSBSim-Team:master Apr 26, 2023
@bcoconni bcoconni deleted the Mach+vcas_to_FGAuxiliary branch April 26, 2023 17:55
bcoconni added a commit to bcoconni/jsbsim that referenced this pull request Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants