-
Notifications
You must be signed in to change notification settings - Fork 443
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
FGLGear
doesn't need to inherit from FGSurface
.
#884
Conversation
Codecov Report
@@ Coverage Diff @@
## master #884 +/- ##
==========================================
- Coverage 23.06% 23.05% -0.01%
==========================================
Files 167 167
Lines 19611 19619 +8
==========================================
Hits 4524 4524
- Misses 15087 15095 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Not that I'm against refactoring JSBSim but let me explain what the original intention was: The gears define friction coefficients but in reality this is only about rubber against asphalt or concrete. But even that is not exactly clear. Fortunately their friction coefficients are close enough you will hardly notice the difference. But in reality you should take into account the surface properties of both the aircraft component (tires, skids, floats, skis, metal skin, cloth) and the ground surface which could be concrete, asphalt, grass, dry mud, moist mud, wet mud, snow, dry ice, wet ice, water) This does not only affect friction factors but also impact-values like pressure resistance. Which in turn could be used for crash detection for example. This is what the surface class was meant to be turned into. |
As I mentioned above: "This PR introduces a few modifications to remove this inheritance without impacting the features provided by This PR does not remove the features you mentioned, it is actually showing that the same result can be obtained without recurring to the inheritance of a class. Indeed
This feature is unaffected by this PR.
At best crash detection and pressure resistance are loosely linked. As @seanmcleod mentioned in #819 (comment), one leg of the 747 main landing gears can absorb the entire aircraft landing load. This means that the runway must also be designed to sustain that exact same load. However a c172 will be smashed on such a runway before it reaches a fraction of that runway pressure resistance. So you cannot tell from a runway pressure resistance if a landing impact will result in a crash, a hard landing or a soft landing. |
You wouldn't know that since you removed the call to FGSurface::bind() I would strongly advice to reject this pull request as it not well thought trough. |
Good catch ! The call to Following this update, the PR still removes the inheritance of
Come on ! You're overreacting. |
Okay, this looks better already. As FGSurface is only being used by FGGroundReactions after this patch you could do the same there. Erik |
Thanks.
I can see at least 2 reasons to remove
You're exactly right and this will give a third reason why |
As I exposed in #883 (comment),
FGLGear
does not need to inherit fromFGSurface
. This PR introduces a few modifications to remove this inheritance without impacting the features provided byFGSurface
.The PR shows that:
FGLGear
does not use any methods that it inherits fromFGSurface
. Nor any code is using these inherited methods from anywhere else in JSBSim code.isSolid
,maximumForce
androllingFFactor
need not being members. In 2 cases, they do not even need being variable as they are used at a single location.bumpiness
is not used anywhere.The only member that needs to be moved fromFGSurface
isstaticFFactor
. But it merely contains the value read fromFGGroundReactions
.staticFCoeff
anddynamicFCoeff
need not being inFGSurface
asFGLGear
is the only class that accesses them.EDIT: The arguments above that are stroke out happened to be irrelevant as has been shown in the discussion below. The other arguments, including those exposed in #883 (comment), are still applicable.