forked from arktools/jsbsim
-
Notifications
You must be signed in to change notification settings - Fork 29
/
JSBSimScript.xsd
499 lines (484 loc) · 18.2 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
<?xml version="1.0"?>
<!--<?xml-stylesheet type="text/xsl" href="XMLToDoc.xsl"?>-->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
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: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 ref="description" minOccurs="0" maxOccurs="1"/>
<xs:element ref="use"/>
<xs:element ref="run" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<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="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="xs:string">
<xs:attribute name="value" type="xs:decimal" default="0.0" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element ref="event" minOccurs="1" 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: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 ref="delay" minOccurs="0" maxOccurs="1"/>
<xs:element name="description" type="xs:string"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="optional"/>
<xs:attribute name="persistent" 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:simpleType><xs:restriction base="xs:string"><xs:pattern value="true|false"/></xs:restriction></xs:simpleType>
</xs:attribute>
<xs:attribute name="continuous" 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:simpleType><xs:restriction base="xs:string"><xs:pattern value="true|false"/></xs:restriction></xs:simpleType>
</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:
</xs:documentation>
<xs:documentation>
{property} {operation} {property|number}
</xs:documentation>
<xs:documentation>
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:
</xs:documentation>
<xs:documentation>
sim-time-sec ge 5.0
</xs:documentation>
<xs:documentation>
Any number of conditional tests such as the one above may be listed.
</xs:documentation>
<xs:documentation>
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" default="AND">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="AND|OR"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</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="property" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="delay" type="xs:double">
<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:element name="property">
<xs:annotation><xs:documentation>
A "property" is a JSBSim simulation parameter that represents any of a number of
things, from engine throttle settings, to aircraft rotation rates, to the simulation time.
To see a list of properties that are available for an individual aircraft, one can provide
the "--catalog" option to the JSBSim standalone program.
</xs:documentation></xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</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:string" 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:string">
<xs:pattern value="FG_RAMP|FG_STEP|FG_EXP"></xs:pattern>
</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:string">
<xs:pattern value="FG_VALUE|FG_DELTA"/>
</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" default="AND">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="AND|OR"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="description" type="xs:string">
<xs:annotation id="test">
<xs:documentation>Documents the runscript purpose.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="use">
<xs:complexType>
<xs:attribute name="aircraft" type="xs:string" use="required"/>
<xs:attribute name="initialize" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<!-- 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" />
<xs:element ref="pow" />
<xs:element ref="abs" />
<xs:element ref="sin" />
<xs:element ref="cos" />
<xs:element ref="tan" />
<xs:element ref="asin" />
<xs:element ref="acos" />
<xs:element ref="atan" />
<xs:element ref="atan2" />
<xs:element ref="min" />
<xs:element ref="max" />
<xs:element ref="avg" />
<xs:element ref="fraction" />
<xs:element ref="integer" />
<xs:element ref="mod"/>
<xs:element name="random"/>
</xs:choice>
</xs:group>
<xs:element name="function">
<xs:complexType>
<xs:sequence>
<xs:element name="description" minOccurs="0">
<xs:annotation><xs:documentation>
A descriptiopn of the element.
</xs:documentation></xs:annotation>
</xs:element>
<xs:group ref="func_group" />
</xs:sequence>
<xs:attribute name="name" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="product">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="difference">
<xs:complexType>
<xs:choice maxOccurs="2">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="sum">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="quotient">
<xs:complexType>
<xs:choice maxOccurs="2">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="abs">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="pow">
<xs:complexType>
<xs:choice maxOccurs="2" minOccurs="2">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="sin">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="cos">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="tan">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="asin">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="acos">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="atan">
<xs:complexType>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="atan2">
<xs:complexType>
<xs:choice maxOccurs="2" minOccurs="2">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="min">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="max">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="avg">
<xs:complexType>
<xs:choice minOccurs="2" maxOccurs="unbounded">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="fraction">
<xs:complexType>
<xs:choice>
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="integer">
<xs:complexType>
<xs:choice>
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="value" type="xs:double" />
<xs:element name="mod">
<xs:complexType>
<xs:choice maxOccurs="2" minOccurs="2">
<xs:group ref="func_group" />
<xs:element ref="value" />
<xs:element ref="property" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:simpleType name="PositiveNumber">
<xs:restriction base="xs:double">
<xs:minInclusive value="0" />
</xs:restriction>
</xs:simpleType>
<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:string" />
</xs:complexType>
</xs:element>
<xs:element name="independentVar">
<xs:complexType mixed="true">
<xs:attribute name="lookup" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="tableData">
<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>