Skip to content

Tie the external reaction and buoyancy properties only once - #1491

Open
Zaretto wants to merge 1 commit into
JSBSim-Team:masterfrom
Zaretto:d/external-reactions-bind-once
Open

Tie the external reaction and buoyancy properties only once#1491
Zaretto wants to merge 1 commit into
JSBSim-Team:masterfrom
Zaretto:d/external-reactions-bind-once

Conversation

@Zaretto

@Zaretto Zaretto commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

FGExternalReactions::Load() and FGBuoyantForces::Load() are public and append to their force and cell lists, so either may be called more than once to add further items.

My specific use case for this that an aircraft declares in <external_reactions> or <buoyant_forces> but then I need to add external forces from the C++ side which causes harmless errors because a second bind would log errors on the tied properties.

FGExternalReactions::Load() and FGBuoyantForces::Load() are public and append to their force and cell lists, so either may be called more than once to add further items.

My specific use case for this that an aircraft declares in <external_reactions> or <buoyant_forces> but then I need to add external forces from the C++ side which causes harmless errors because a second bind would log errors on the tied properties.
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.05%. Comparing base (0b688c8) to head (2bb3635).

Files with missing lines Patch % Lines
src/models/FGExternalReactions.cpp 0.00% 3 Missing ⚠️
src/models/FGBuoyantForces.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1491      +/-   ##
==========================================
- Coverage   25.06%   25.05%   -0.01%     
==========================================
  Files         171      171              
  Lines       18842    18845       +3     
==========================================
  Hits         4722     4722              
- Misses      14120    14123       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seanmcleod70

Copy link
Copy Markdown
Contributor

Hmm, although the Load(Element *document) methods are public, I'm not sure that in general the model implementations are designed to have their Load() method called multiple times. I'd imagine most of them assume they'll be called once while reading in the relevant config files.

So in terms of adding additional external forces etc. later on via your C++ host are you building up XML elements in your C++ host and then passing that in to the Load() methods?

So I wonder if it wouldn't be better to rather add additional methods that allow C++ hosts to add additional external forces/moments etc.?

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.

2 participants