-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.ts
437 lines (435 loc) · 9.24 KB
/
types.ts
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
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type VariableDeclaration = {
/**
* Variable type. Allowed types: FLOAT, INT, STRING, UINT, ENUM.
*/
type: 'FLOAT' | 'INT' | 'STRING' | 'UINT' | 'ENUM';
/**
* User-friendly variable names that will be mapped to FSW variable names. Must begin with a letter and contain only letters, numbers, and underscores.
*/
name: string;
/**
* For enumerated type variables, the name of the corresponding FSW-defined ENUM.
*/
enum_name?: string;
/**
* A list of allowable values for this variable.
*/
allowable_values?: unknown[];
/**
* One or more allowable ranges of values, for FLOAT, INT, or UINT variable types.
*/
allowable_ranges?: VariableRange[];
/**
* 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)
*/
sc_name?: string;
} & {
[k: string]: unknown;
} & {
[k: string]: unknown;
};
/**
* Sequence steps can be grouped into a request, which can then be shifted or adjusted altogether as part of the request.
*/
export type Request = {
description?: Description;
ground_epoch?: GroundEpoch;
metadata?: Metadata;
/**
* Request Name, used for tracking commands back to the original request after ground expansion. Must be unique.
*/
name: string;
/**
* Sequence steps that are part of this request.
*
* @minItems 1
*/
steps: [Step, ...Step[]];
time?: Time;
type: 'request';
};
/**
* Description. Can be attached to any sequence step.
*/
export type Description = string;
export type Step = Activate | Command | GroundBlock | GroundEvent | Load;
/**
* Array of command arguments
*/
export type Args = (
| StringArgument
| NumberArgument
| BooleanArgument
| SymbolArgument
| HexArgument
| RepeatArgument
)[];
export interface SeqJson {
/**
* Unique identifier
*/
id: string;
/**
* Local variable declarations.
*
* @minItems 1
*/
locals?: [VariableDeclaration, ...VariableDeclaration[]];
metadata: Metadata;
/**
* Parameter variable declarations.
*
* @minItems 1
*/
parameters?: [VariableDeclaration, ...VariableDeclaration[]];
/**
* Commands groups into requests
*/
requests?: Request[];
/**
* Sequence steps
*/
steps?: Step[];
/**
* Immediate commands which are interpreted by FSW and not part of any sequence.
*/
immediate_commands?: (ImmediateFswCommand | ImmediateLoad | ImmediateActivate)[];
/**
* Hardware commands which are not interpreted by FSW and not part of any sequence.
*/
hardware_commands?: HardwareCommand[];
}
/**
* A range of allowable variable values between a defined min and max, inclusive. min and max must be numbers
*/
export interface VariableRange {
/**
* Minimum value of the variable, inclusive
*/
min: number;
/**
* Maximum value of the variable, inclusive
*/
max: number;
}
/**
* Flexible sequence metadata for any key-value pairs.
*/
export interface Metadata {
[k: string]: unknown;
}
/**
* Ground epoch object
*/
export interface GroundEpoch {
/**
* Epoch delta given as a duration, start time will be epoch+delta.
*/
delta?: string;
/**
* Name of ground-defined epoch.
*/
name?: string;
[k: string]: unknown;
}
/**
* Activate object
*/
export interface Activate {
args?: Args;
description?: Description;
/**
* Sequence target engine.
*/
engine?: number;
/**
* Onboard epoch to pass to the sequence for derivation of epoch-relative timetags
*/
epoch?: string;
metadata?: Metadata;
models?: Model[];
/**
* Onboard path and filename of sequence to be loaded.
*/
sequence: string;
time: Time;
type: 'activate';
}
/**
* A step argument containing a string.
*/
export interface StringArgument {
/**
* An optional string argument name.
*/
name?: string;
/**
* The string type.
*/
type: 'string';
/**
* A valid string value.
*/
value: string;
}
/**
* A step argument containing a number.
*/
export interface NumberArgument {
/**
* An optional number argument name.
*/
name?: string;
/**
* The number type.
*/
type: 'number';
/**
* The number value. The number must be valid.
*/
value: number;
}
/**
* A step argument containing a boolean.
*/
export interface BooleanArgument {
/**
* An optional boolean argument name.
*/
name?: string;
/**
* The boolean type.
*/
type: 'boolean';
/**
* The boolean value. The value must be all lowercase.
*/
value: boolean;
}
/**
* A step argument referencing a local or global variable, or some other symbolic name known to downstream modeling software (such as CONDITION in SEQGEN)
*/
export interface SymbolArgument {
/**
* An optional symbol argument name.
*/
name?: string;
/**
* The symbol argument type.
*/
type: 'symbol';
/**
* The symbolic name being referenced.
*/
value: string;
}
/**
* A step argument containing an unsigned integer in hexadecimal format.
*/
export interface HexArgument {
/**
* An optional hex argument name.
*/
name?: string;
/**
* The hex type.
*/
type: 'hex';
/**
* The hexadecimal integer value, as a string prefixed with 0x. Digits A-F must be uppercase.
*/
value: string;
}
/**
* An argument that can be repeated.
*/
export interface RepeatArgument {
/**
* An optional repeat argument name.
*/
name?: string;
/**
* The repeat argument type.
*/
type: 'repeat';
/**
* A repeat argument value.
*/
value: (StringArgument | NumberArgument | BooleanArgument | SymbolArgument | HexArgument)[][];
}
/**
* 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.
*/
export interface Model {
/**
* Duration to wait after step time to trigger model change
*/
offset: string;
/**
* Value to set in variable.
*/
value: string | number | boolean;
/**
* Variable to be set in the model
*/
variable: string;
}
/**
* Time object
*/
export interface Time {
/**
* Relative or absolute time. Required for ABSOLUTE, COMMAND_RELATIVE, and EPOCH_RELATIVE time tags but not COMMAND_COMPLETE.
*/
tag?: string;
/**
* Allowed time types: ABSOLUTE, COMMAND_RELATIVE, EPOCH_RELATIVE, or COMMAND_COMPLETE.
*/
type: 'ABSOLUTE' | 'COMMAND_RELATIVE' | 'EPOCH_RELATIVE' | 'COMMAND_COMPLETE';
}
/**
* Command object
*/
export interface Command {
args: Args;
description?: Description;
metadata?: Metadata;
models?: Model[];
/**
* Command stem
*/
stem: string;
time: Time;
type: 'command';
/**
* 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
*/
return_assign_to?: string;
}
/**
* Ground blocks
*/
export interface GroundBlock {
args?: Args;
description?: Description;
metadata?: Metadata;
models?: Model[];
/**
* Ground block name
*/
name: string;
time: Time;
type: 'ground_block';
}
/**
* Ground events
*/
export interface GroundEvent {
args?: Args;
description?: Description;
metadata?: Metadata;
models?: Model[];
/**
* Ground event name
*/
name: string;
time: Time;
type: 'ground_event';
}
/**
* Load object
*/
export interface Load {
args?: Args;
description?: Description;
/**
* Sequence target engine.
*/
engine?: number;
/**
* Onboard epoch to pass to the sequence for derivation of epoch-relative timetags
*/
epoch?: string;
metadata?: Metadata;
models?: Model[];
/**
* Onboard path and filename of sequence to be loaded.
*/
sequence: string;
time: Time;
type: 'load';
}
/**
* Object representing a single Immediate Command
*/
export interface ImmediateFswCommand {
args: Args;
description?: Description;
metadata?: Metadata;
/**
* Command stem
*/
stem: string;
type?: 'command';
}
/**
* Untimed load object
*/
export interface ImmediateLoad {
args?: Args;
description?: Description;
/**
* Sequence target engine.
*/
engine?: number;
/**
* Onboard epoch to pass to the sequence for derivation of epoch-relative timetags
*/
epoch?: string;
metadata?: Metadata;
models?: Model[];
/**
* Onboard path and filename of sequence to be loaded.
*/
sequence: string;
type: 'load';
}
/**
* Untimed activate object
*/
export interface ImmediateActivate {
args?: Args;
description?: Description;
/**
* Sequence target engine.
*/
engine?: number;
/**
* Onboard epoch to pass to the sequence for derivation of epoch-relative timetags
*/
epoch?: string;
metadata?: Metadata;
models?: Model[];
/**
* Onboard path and filename of sequence to be loaded.
*/
sequence: string;
type: 'activate';
}
/**
* Object representing a single Hardware Command
*/
export interface HardwareCommand {
description?: Description;
metadata?: Metadata;
/**
* Command stem
*/
stem: string;
}