-
Notifications
You must be signed in to change notification settings - Fork 461
/
JSBSimScript.xsd
306 lines (295 loc) · 13.8 KB
/
JSBSimScript.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<?xml version="1.0"?>
<!--<?xml-stylesheet type="text/xsl" href="XMLToDoc.xsl"?>-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation><xs:documentation>
This schema specifies the format that a JSBSim (www.jsbsim.org) script must
take to be valid. The JSBSim scripting language provides for specification
of which aircraft and initialization file will be used for a "batch" run, as
well as how long it will run, and at what time-step size it will be
integrated at. Also, "Events" may be defined that can direct the simulation
to set parameter values when specific conditions have been reached. The
script author may also specify that some notifications should take place
when an event is reached.
</xs:documentation></xs:annotation>
<xs:include schemaLocation="JSBSimCommon.xsd"/>
<xs:element name="runscript">
<xs:annotation><xs:documentation>
The "runscript" element is the top-level containing XML element. It may
have a name attribute, that describes briefly what the script does.
</xs:documentation></xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="use" maxOccurs="1">
<xs:complexType>
<xs:attribute name="aircraft" type="xs:token" use="required"/>
<xs:attribute name="initialize" type="xs:token" use="required"/>
</xs:complexType>
</xs:element>
<xs:element ref="run" maxOccurs="1"/>
<xs:element name="output" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="rates" type="ON-OFF" minOccurs="0"/>
<xs:element name="velocities" type="ON-OFF" minOccurs="0"/>
<xs:element name="position" type="ON-OFF" minOccurs="0"/>
<xs:element name="atmosphere" type="ON-OFF" minOccurs="0"/>
<xs:element name="fcs" type="ON-OFF" minOccurs="0"/>
<xs:element name="ground_reactions" type="ON-OFF" minOccurs="0"/>
<xs:element name="propulsion" type="ON-OFF" minOccurs="0"/>
<xs:element name="simulation" type="ON-OFF" minOccurs="0"/>
<xs:element name="massprops" type="ON-OFF" minOccurs="0"/>
<xs:element name="forces" type="ON-OFF" minOccurs="0"/>
<xs:element name="moments" type="ON-OFF" minOccurs="0"/>
<xs:element name="aerosurfaces" type="ON-OFF" minOccurs="0"/>
<xs:element name="coefficients" type="ON-OFF" minOccurs="0"/>
<xs:element name="property" type="property-with-caption" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:token" use="required"/>
<xs:attribute name="type" use="required">
<xs:annotation><xs:documentation>
The format in which the data output will be issued.
</xs:documentation></xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="CSV"/>
<xs:enumeration value="TABULAR"/>
<xs:enumeration value="SOCKET"/>
<xs:enumeration value="FLIGHTGEAR"/>
<xs:enumeration value="TERMINAL"/>
<xs:enumeration value="NONE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="rate" type="xs:decimal" use="required"/>
<xs:attribute name="file" type="xs:token" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:token" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="property-with-caption">
<xs:simpleContent>
<xs:extension base="property">
<xs:attribute name="caption" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="run">
<xs:annotation><xs:documentation>
The "run" element has as its parent the "runscript" element. The run
element contains any and all "event" elements. Within the run element, the
start and end time must be specified, and the integration timestep size
(the inverse of the integration frequency). Note that the start time will
almost always be 0.0, and so the end time merely specifies the duration of
the run.
</xs:documentation></xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
<xs:annotation><xs:documentation>
A property element placed within the run element (in a sort of
"global" script space) allows variables to be created for scripting.
The property can be given an initial value, as well.
</xs:documentation></xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="property-with-value">
<xs:attribute name="persistent" type="xs:boolean"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="start" type="xs:decimal" use="optional">
<xs:annotation><xs:documentation>
This attribute is not currently used. A script will always begin
execution at time 0.0.
</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="end" type="xs:decimal" use="required">
<xs:annotation><xs:documentation>
Since script execution always begins at time 0.0, the "end" attribute
is essentially the same thing as the duration of the script.
</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="dt" type="xs:decimal" use="required">
<xs:annotation><xs:documentation>
The dt attribute is simply the frame time, or the times step size.
</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="event">
<xs:annotation><xs:documentation>
The "event" element (if any) has as its parent the "run" element. There
may be any number of event elements defined - even none at all. An event
element may feature a name attribute, and/or a persistent attribute.
</xs:documentation></xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="condition" minOccurs="0" maxOccurs="1"/>
<xs:element ref="set" maxOccurs="unbounded" minOccurs="0"/>
<xs:element ref="notify" minOccurs="1" maxOccurs="1"/>
<xs:element name="delay" type="xs:decimal" minOccurs="0" maxOccurs="1">
<xs:annotation><xs:documentation>
The delay element represents the number of seconds to delay in
executing the set actions for an event once the conditions have
been met.
</xs:documentation></xs:annotation>
</xs:element>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:token" use="optional"/>
<xs:attribute name="persistent" type="xs:boolean" use="optional" default="false">
<xs:annotation><xs:documentation>
If an event is marked persistent, the event will be executed anytime
the condition[s] first evaluate to true after toggling from false.
Otherwise, the event only executes the first time the condition
evaluates toggles to true.
</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="continuous" type="xs:boolean" use="optional" default="false">
<xs:annotation><xs:documentation>
If an event is marked as "continuous", the "set" action will be
executed at all times while the conditions evaluate to true. This is
not only relevant when a property is set via the exponential approach
method. If a function is used within the "set" element to define the
value that the event will assign, the use of the continuous attribute
(set to true) causes the function to be evaluated continuously while
the condition evaluates to true.
</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="condition">
<xs:annotation><xs:documentation>
The condition element has as its parent the "event" element. The condition
element specifies the test or tests that must evaluate to true if the
event is to have its "set" actions carried out. Conditions are specified
in the form:
{property} {operation} {property|number}
where {property} is simply a property name, and {operation} is one of the
comparison operators (gt, ge, lt, le, eq, ne) in lower or upper case. For
example:
sim-time-sec ge 5.0
Any number of conditional tests such as the one above may be listed.
Additionally, further groupings of conditional tests may be collected
within a test element.
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="test" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="logic" type="AND-OR" default="AND"/>
</xs:complexType>
</xs:element>
<xs:element name="notify">
<xs:annotation><xs:documentation>
The "notify" element may appear by itself, or it may group together
properties. The notify element specifies that the program should print out
a notification message when the event is executed (when its conditions
evaluate to true). If the notify element contains properties, the values
of those properties will also be printed when the event is triggered.
</xs:documentation></xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="property" type="property-with-caption"/>
</xs:sequence>
<xs:attribute name="format" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="kml"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="set">
<xs:annotation><xs:documentation>
The "set" element is the mechanism by which the JSBSim Scripting function
carries out actions, setting the value of a property or properties to the
specified value, or change in value, when the event conditions have been
met. Once a condition has been met, a value may be assigned to a property
directory via a step change, via an exponential approach, or via a ramp
(when supplied with the time constant for the latter two).
</xs:documentation></xs:annotation>
<xs:complexType>
<xs:all minOccurs="0">
<xs:element minOccurs="0" ref="function"/>
</xs:all>
<xs:attribute name="name" type="xs:token" use="required"/>
<xs:attribute name="action" use="optional" default="FG_STEP">
<xs:annotation><xs:documentation>
The action specifies how the new value should be reached from the old
value. The choices are: step, ramp, exponential approach.
</xs:documentation></xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="FG_RAMP"/>
<xs:enumeration value="FG_STEP"/>
<xs:enumeration value="FG_EXP"/>
<xs:enumeration value="ramp"/>
<xs:enumeration value="step"/>
<xs:enumeration value="exp"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" type="xs:double" use="optional"/>
<xs:attribute name="tc" type="xs:double" use="optional"/>
<xs:attribute name="type" use="optional" default="FG_VALUE">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="FG_DELTA"/>
<xs:enumeration value="FG_VALUE"/>
<xs:enumeration value="FG_BOOL"/>
<xs:enumeration value="delta"/>
<xs:enumeration value="value"/>
<xs:enumeration value="bool"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="test">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="test"/>
</xs:sequence>
<xs:attribute name="logic" type="AND-OR" default="AND"/>
</xs:complexType>
</xs:element>
<xs:element name="table">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="independentVar" />
<xs:element ref="tableData" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" use="optional" type="xs:token" />
</xs:complexType>
</xs:element>
<xs:element name="independentVar">
<xs:complexType mixed="true">
<xs:attribute name="lookup" type="xs:token" />
</xs:complexType>
</xs:element>
<xs:element name="tableData">
<xs:simpleType>
<xs:list itemType="xs:decimal"/>
</xs:simpleType>
<!-- <xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="breakPoint" type="xs:double" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType> -->
</xs:element>
</xs:schema>