Skip to content
New issue

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

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

Already on GitHub? # to your account

Update FGFunction documentation #1131

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

seanmcleod
Copy link
Member

While writing some example Python based code - #1126 (comment) - to process FDM XML files I noticed a small discrepancy between the documentation for function elements in:

configuration file includes the function element, and other elements. It should
be noted that there can be only one non-optional (non-documentation) element -
that is, one operation element - in the top-level function definition.

Versus what I came across in a number of FDM files when testing, e.g.

jsbsim/aircraft/f16/f16.xml

Lines 986 to 1009 in 651ad3c

<aerodynamics>
<function name="aero/function/kCLge">
<description>Change_in_lift_due_to_ground_effect</description>
<table>
<independentVar>aero/h_b-mac-ft</independentVar>
<tableData>
0.0000 1.2290
0.1000 1.1240
0.1500 1.1160
0.2000 1.1240
0.3000 1.1050
0.4000 1.0410
0.5000 1.0340
0.6000 1.0190
0.7000 1.0080
0.8000 1.0030
0.9000 1.0010
1.0000 1.0000
1.1000 1.0000
</tableData>
</table>
</function>

And also in JSBSim.xsd:

jsbsim/JSBSim.xsd

Lines 1456 to 1464 in 651ad3c

<xs:element name="function">
<xs:complexType>
<xs:sequence>
<xs:element ref="description" minOccurs="0"/>
<xs:group ref="func_group" />
</xs:sequence>
<xs:attribute name="name" use="optional" />
</xs:complexType>
</xs:element>

jsbsim/JSBSim.xsd

Lines 1403 to 1410 in 651ad3c

<!-- Functions -->
<xs:group name="func_group">
<xs:choice>
<xs:element ref="table" />
<xs:element ref="product" />
<xs:element ref="difference" />
<xs:element ref="sum" />
<xs:element ref="quotient" />

So this pull request provides a minor update to the comment in the source code for FGFunction.

Copy link

codecov bot commented Jul 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.93%. Comparing base (651ad3c) to head (291519d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1131   +/-   ##
=======================================
  Coverage   24.93%   24.93%           
=======================================
  Files         170      170           
  Lines       18239    18239           
=======================================
  Hits         4548     4548           
  Misses      13691    13691           

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

@bcoconni bcoconni merged commit 328a0b1 into JSBSim-Team:master Aug 3, 2024
29 checks passed
@bcoconni
Copy link
Member

bcoconni commented Aug 3, 2024

Looks good to me.

bcoconni pushed a commit to bcoconni/jsbsim that referenced this pull request Aug 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants