-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.json
786 lines (786 loc) · 21.5 KB
/
schema.json
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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
{
"$id": "https://github.com/NASA-AMMOS/seq-json-schema/tree/v1.2.0",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"immediate_activate": {
"additionalProperties": false,
"description": "Untimed activate object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"engine": {
"type": "integer",
"description": "Sequence target engine."
},
"epoch": {
"type": "string",
"description": "Onboard epoch to pass to the sequence for derivation of epoch-relative timetags"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"sequence": {
"type": "string",
"description": "Onboard path and filename of sequence to be loaded."
},
"type": {
"const": "immediate_activate"
}
},
"required": ["sequence", "type"],
"type": "object"
},
"activate": {
"additionalProperties": false,
"description": "Activate object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"engine": {
"type": "integer",
"description": "Sequence target engine."
},
"epoch": {
"type": "string",
"description": "Onboard epoch to pass to the sequence for derivation of epoch-relative timetags"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"sequence": {
"type": "string",
"description": "Onboard path and filename of sequence to be loaded."
},
"time": {
"$ref": "#/$defs/time"
},
"type": {
"const": "activate"
}
},
"required": ["sequence", "time", "type"],
"type": "object"
},
"args": {
"description": "Array of command arguments",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/$defs/string_argument"
},
{
"$ref": "#/$defs/number_argument"
},
{
"$ref": "#/$defs/boolean_argument"
},
{
"$ref": "#/$defs/symbol_argument"
},
{
"$ref": "#/$defs/hex_argument"
},
{
"$ref": "#/$defs/repeat_argument"
}
]
}
},
"immediate_fsw_command": {
"additionalProperties": false,
"description": "Object representing a single Immediate Command",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"stem": {
"type": "string",
"description": "Command stem"
},
"type": {
"const": "immediate_command"
}
},
"required": ["stem", "args"],
"type": "object"
},
"command": {
"additionalProperties": false,
"description": "Command object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"stem": {
"type": "string",
"description": "Command stem"
},
"time": {
"$ref": "#/$defs/time"
},
"type": {
"const": "command"
},
"return_assign_to": {
"description": "Name of a defined local variable to which the exit status of this command should be written to. For this to work, that local variable must have been defined with the 'SC_Name' property set to LCS",
"type": "string"
}
},
"required": ["stem", "args", "time", "type"],
"type": "object"
},
"description": {
"description": "Description. Can be attached to any sequence step.",
"type": "string"
},
"ground_block": {
"additionalProperties": false,
"description": "Ground blocks",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"name": {
"description": "Ground block name",
"type": "string"
},
"time": {
"$ref": "#/$defs/time"
},
"type": {
"const": "ground_block"
}
},
"required": ["name", "time", "type"],
"type": "object"
},
"ground_epoch": {
"description": "Ground epoch object",
"properties": {
"delta": {
"description": "Epoch delta given as a duration, start time will be epoch+delta.",
"type": "string"
},
"name": {
"description": "Name of ground-defined epoch.",
"type": "string"
}
},
"type": "object"
},
"ground_event": {
"additionalProperties": false,
"description": "Ground events",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"name": {
"description": "Ground event name",
"type": "string"
},
"time": {
"$ref": "#/$defs/time"
},
"type": {
"const": "ground_event"
}
},
"required": ["name", "time", "type"],
"type": "object"
},
"immediate_load": {
"additionalProperties": false,
"description": "Untimed load object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"engine": {
"type": "integer",
"description": "Sequence target engine."
},
"epoch": {
"type": "string",
"description": "Onboard epoch to pass to the sequence for derivation of epoch-relative timetags"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"sequence": {
"type": "string",
"description": "Onboard path and filename of sequence to be loaded."
},
"type": {
"const": "immediate_load"
}
},
"required": ["sequence", "type"],
"type": "object"
},
"load": {
"additionalProperties": false,
"description": "Load object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"engine": {
"type": "integer",
"description": "Sequence target engine."
},
"epoch": {
"type": "string",
"description": "Onboard epoch to pass to the sequence for derivation of epoch-relative timetags"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"sequence": {
"type": "string",
"description": "Onboard path and filename of sequence to be loaded."
},
"time": {
"$ref": "#/$defs/time"
},
"type": {
"const": "load"
}
},
"required": ["sequence", "time", "type"],
"type": "object"
},
"metadata": {
"description": "Flexible sequence metadata for any key-value pairs.",
"type": "object"
},
"model": {
"additionalProperties": false,
"description": "Model object that be included with commands to set variables for modeling purposes only, usually to direct sequence execution down a particular branch during modeling.",
"properties": {
"offset": {
"description": "Duration to wait after step time to trigger model change",
"type": "string"
},
"value": {
"description": "Value to set in variable.",
"type": ["string", "number", "boolean"]
},
"variable": {
"description": "Variable to be set in the model",
"type": "string"
}
},
"required": ["offset", "value", "variable"],
"type": "object"
},
"request": {
"additionalProperties": false,
"description": "Sequence steps can be grouped into a request, which can then be shifted or adjusted altogether as part of the request.",
"oneOf": [
{
"required": ["ground_epoch"]
},
{
"required": ["time"]
}
],
"properties": {
"description": {
"$ref": "#/$defs/description"
},
"ground_epoch": {
"$ref": "#/$defs/ground_epoch"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"name": {
"description": "Request Name, used for tracking commands back to the original request after ground expansion. Must be unique.",
"type": "string"
},
"steps": {
"description": "Sequence steps that are part of this request.",
"items": {
"$ref": "#/$defs/step"
},
"minItems": 1,
"type": "array"
},
"time": {
"$ref": "#/$defs/time"
},
"type": {
"const": "request"
}
},
"required": ["name", "steps", "type"],
"type": "object"
},
"step": {
"oneOf": [
{
"$ref": "#/$defs/activate"
},
{
"$ref": "#/$defs/command"
},
{
"$ref": "#/$defs/ground_block"
},
{
"$ref": "#/$defs/ground_event"
},
{
"$ref": "#/$defs/load"
}
]
},
"hardware_command": {
"additionalProperties": false,
"description": "Object representing a single Hardware Command",
"properties": {
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"stem": {
"type": "string",
"description": "Command stem"
}
},
"required": ["stem"],
"type": "object"
},
"time": {
"additionalProperties": false,
"description": "Time object",
"properties": {
"tag": {
"description": "Relative or absolute time. Required for ABSOLUTE, COMMAND_RELATIVE, and EPOCH_RELATIVE time tags but not COMMAND_COMPLETE.",
"type": "string"
},
"type": {
"description": "Allowed time types: ABSOLUTE, COMMAND_RELATIVE, EPOCH_RELATIVE, or COMMAND_COMPLETE.",
"enum": ["ABSOLUTE", "COMMAND_RELATIVE", "EPOCH_RELATIVE", "COMMAND_COMPLETE"],
"type": "string"
}
},
"required": ["type"],
"type": "object"
},
"variable_range": {
"additionalProperties": false,
"description": "A range of allowable variable values between a defined min and max, inclusive. min and max must be numbers",
"properties": {
"min": {
"description": "Minimum value of the variable, inclusive",
"type": "number"
},
"max": {
"description": "Maximum value of the variable, inclusive",
"type": "number"
}
},
"required": ["min", "max"],
"type": "object"
},
"symbol_argument": {
"additionalProperties": false,
"description": "A step argument referencing a local or global variable, or some other symbolic name known to downstream modeling software (such as CONDITION in SEQGEN)",
"properties": {
"name": {
"description": "An optional symbol argument name.",
"type": "string"
},
"type": {
"description": "The symbol argument type.",
"const": "symbol"
},
"value": {
"description": "The symbolic name being referenced.",
"type": "string"
}
},
"required": ["type", "value"],
"type": "object"
},
"repeat_argument": {
"additionalProperties": false,
"description": "An argument that can be repeated.",
"properties": {
"name": {
"description": "An optional repeat argument name.",
"type": "string"
},
"type": {
"description": "The repeat argument type.",
"const": "repeat"
},
"value": {
"description": "A repeat argument value.",
"type": "array",
"items": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/$defs/string_argument"
},
{
"$ref": "#/$defs/number_argument"
},
{
"$ref": "#/$defs/boolean_argument"
},
{
"$ref": "#/$defs/symbol_argument"
},
{
"$ref": "#/$defs/hex_argument"
}
]
}
}
}
},
"required": ["type", "value"],
"type": "object"
},
"string_argument": {
"additionalProperties": false,
"description": "A step argument containing a string.",
"properties": {
"name": {
"description": "An optional string argument name.",
"type": "string"
},
"type": {
"description": "The string type.",
"const": "string"
},
"value": {
"description": "A valid string value.",
"type": "string"
}
},
"required": ["type", "value"],
"type": "object"
},
"number_argument": {
"additionalProperties": false,
"description": "A step argument containing a number.",
"properties": {
"name": {
"description": "An optional number argument name.",
"type": "string"
},
"type": {
"description": "The number type.",
"const": "number"
},
"value": {
"description": "The number value. The number must be valid.",
"type": "number"
}
},
"required": ["type", "value"],
"type": "object"
},
"boolean_argument": {
"additionalProperties": false,
"description": "A step argument containing a boolean.",
"properties": {
"name": {
"description": "An optional boolean argument name.",
"type": "string"
},
"type": {
"description": "The boolean type.",
"const": "boolean"
},
"value": {
"description": "The boolean value. The value must be all lowercase.",
"type": "boolean"
}
},
"required": ["type", "value"],
"type": "object"
},
"hex_argument": {
"additionalProperties": false,
"description": "A step argument containing an unsigned integer in hexadecimal format.",
"properties": {
"name": {
"description": "An optional hex argument name.",
"type": "string"
},
"type": {
"description": "The hex type.",
"const": "hex"
},
"value": {
"description": "The hexadecimal integer value, as a string prefixed with 0x. Digits A-F must be uppercase.",
"pattern": "^0x([0-9A-F])+$",
"type": "string"
}
},
"required": ["type", "value"],
"type": "object"
},
"variable_declaration": {
"allOf": [
{
"description": "Variable (local or parameter) declarations.",
"additionalProperties": false,
"properties": {
"type": {
"description": "Variable type. Allowed types: FLOAT, INT, STRING, UINT, ENUM.",
"enum": ["FLOAT", "INT", "STRING", "UINT", "ENUM"],
"type": "string"
},
"name": {
"description": "User-friendly variable names that will be mapped to FSW variable names. Must begin with a letter and contain only letters, numbers, and underscores.",
"pattern": "^[A-Za-z][A-Za-z_0-9]*$",
"type": "string"
},
"enum_name": {
"description": "For enumerated type variables, the name of the corresponding FSW-defined ENUM.",
"pattern": "^[A-Za-z][A-Za-z_0-9]*$",
"type": "string"
},
"allowable_values": {
"description": "A list of allowable values for this variable.",
"type": "array"
},
"allowable_ranges": {
"description": "One or more allowable ranges of values, for FLOAT, INT, or UINT variable types.",
"type": "array",
"items": {
"$ref": "#/$defs/variable_range"
}
},
"sc_name": {
"description": "The FSW-specified name for this variable that should be used in the translated sequence, in case this must be specified. Used for variables which are specially-handled onboard such as LCS (Last Command Status)",
"type": "string"
}
},
"required": ["type", "name"],
"type": "object"
},
{
"$comment": "This if/then/else block causes 'enum_name' to be a required property if the type is ENUM, and disallows it otherwise.",
"if": {
"properties": {
"type": {
"const": "ENUM"
}
}
},
"then": {
"required": ["enum_name"]
},
"else": {
"properties": {
"enum_name": false
}
}
},
{
"$comment": "This if/then/else block causes 'allowable_values' to require a number as its array item type if the variable type is FLOAT, UINT, or INT. If it is STRING or ENUM, it causes 'allowable_values' to require a string and disallows 'allowable_ranges'.",
"if": {
"properties": {
"type": {
"oneOf": [
{
"const": "FLOAT"
},
{
"const": "UINT"
},
{
"const": "INT"
}
]
}
}
},
"then": {
"properties": {
"allowable_values": {
"items": {
"type": "number"
}
}
}
},
"else": {
"properties": {
"allowable_values": {
"items": {
"type": "string"
}
},
"allowable_ranges": false
}
}
}
]
}
},
"additionalProperties": false,
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"locals": {
"description": "Local variable declarations.",
"items": {
"$ref": "#/$defs/variable_declaration"
},
"minItems": 1,
"type": "array"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"parameters": {
"description": "Parameter variable declarations.",
"items": {
"$ref": "#/$defs/variable_declaration"
},
"minItems": 1,
"type": "array"
},
"requests": {
"description": "Commands groups into requests",
"items": {
"$ref": "#/$defs/request"
},
"type": "array"
},
"steps": {
"description": "Sequence steps",
"items": {
"$ref": "#/$defs/step"
},
"type": "array"
},
"immediate_commands": {
"description": "Immediate commands which are interpreted by FSW and not part of any sequence.",
"items": {
"oneOf": [
{
"$ref": "#/$defs/immediate_fsw_command"
},
{
"$ref": "#/$defs/immediate_load"
},
{
"$ref": "#/$defs/immediate_activate"
}
]
},
"type": "array"
},
"hardware_commands": {
"description": "Hardware commands which are not interpreted by FSW and not part of any sequence.",
"items": {
"$ref": "#/$defs/hardware_command"
},
"type": "array"
}
},
"required": ["id", "metadata"],
"type": "object"
}