-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommandCatalog.ts
More file actions
453 lines (450 loc) · 13.8 KB
/
Copy pathcommandCatalog.ts
File metadata and controls
453 lines (450 loc) · 13.8 KB
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
import { ControlCommandTypes } from './controls'
import { AvionicsCommandTypes } from './avionics'
import { AutopilotCommandTypes } from './autopilot'
import { ElectricalCommandTypes } from './electrical'
import { EnvironmentCommandTypes } from './environment'
import { FuelCommandTypes } from './fuel'
import { LightingCommandTypes } from './lightingElectrical'
import { PropulsionCommandTypes } from './propulsion'
import { SurfaceCommandTypes } from './surfaces'
export interface SimCommandCatalogEntry {
readonly type: string
readonly subsystem: string
readonly description: string
readonly payloadExample?: unknown
}
export const SIM_COMMAND_CATALOG: readonly SimCommandCatalogEntry[] = [
{
type: LightingCommandTypes.setPotentiometer,
subsystem: 'lighting',
description: 'Set a light potentiometer ratio.',
payloadExample: { index: 1, ratio: 0.5, kind: 'panel' },
},
{
type: LightingCommandTypes.setPower,
subsystem: 'lighting',
description: 'Set a light power channel ratio.',
payloadExample: { channel: 'panel', ratio: 0.5 },
},
{
type: LightingCommandTypes.setChannelEnabled,
subsystem: 'lighting',
description: 'Enable or disable a named light channel.',
payloadExample: { channel: 'beacon', enabled: true },
},
{
type: LightingCommandTypes.setElectricalBusPowered,
subsystem: 'lighting',
description: 'Set lighting electrical bus availability.',
payloadExample: { id: 'main', powered: true },
},
{
type: ElectricalCommandTypes.setBattery,
subsystem: 'electrical',
description: 'Set battery switch state.',
payloadExample: { enabled: true },
},
{
type: ElectricalCommandTypes.setExternalPowerAvailable,
subsystem: 'electrical',
description: 'Set external power availability.',
payloadExample: { enabled: true },
},
{
type: ElectricalCommandTypes.setExternalPowerConnected,
subsystem: 'electrical',
description: 'Set external power connected state.',
payloadExample: { enabled: true },
},
{
type: ElectricalCommandTypes.setAvionicsMaster,
subsystem: 'electrical',
description: 'Set avionics master state.',
payloadExample: { enabled: true },
},
{
type: ElectricalCommandTypes.setBusVoltage,
subsystem: 'electrical',
description: 'Set named electrical bus voltage.',
payloadExample: { id: 'main', volts: 28 },
},
{
type: ElectricalCommandTypes.setSourceAvailable,
subsystem: 'electrical',
description: 'Set named electrical source availability.',
payloadExample: { id: 'battery', available: true },
},
{
type: ElectricalCommandTypes.setSourceConnected,
subsystem: 'electrical',
description: 'Set named electrical source connection state.',
payloadExample: { id: 'battery', connected: true },
},
{
type: ElectricalCommandTypes.setConsumerSwitch,
subsystem: 'electrical',
description: 'Set named electrical consumer switch state.',
payloadExample: { id: 'fuel-pump-1', enabled: true },
},
{
type: EnvironmentCommandTypes.setPitotHeat,
subsystem: 'environment',
description: 'Set indexed pitot heat switch state.',
payloadExample: { index: 1, enabled: true },
},
{
type: EnvironmentCommandTypes.setStructuralDeice,
subsystem: 'environment',
description: 'Set structural deice switch state.',
payloadExample: { enabled: true },
},
{
type: EnvironmentCommandTypes.setEngineAntiIce,
subsystem: 'environment',
description: 'Set indexed engine anti-ice switch state.',
payloadExample: { index: 1, enabled: true },
},
{
type: AvionicsCommandTypes.setRadioActiveFrequency,
subsystem: 'avionics',
description: 'Set indexed COM/NAV active radio frequency in MHz.',
payloadExample: { family: 'com', index: 1, mhz: 118 },
},
{
type: AvionicsCommandTypes.setRadioStandbyFrequency,
subsystem: 'avionics',
description: 'Set indexed COM/NAV standby radio frequency in MHz.',
payloadExample: { family: 'com', index: 1, mhz: 121.7 },
},
{
type: AvionicsCommandTypes.swapRadioFrequencies,
subsystem: 'avionics',
description: 'Swap indexed COM/NAV active and standby frequencies.',
payloadExample: { family: 'com', index: 1 },
},
{
type: AvionicsCommandTypes.setAdfActiveFrequency,
subsystem: 'avionics',
description: 'Set indexed ADF active frequency in kHz.',
payloadExample: { index: 1, khz: 300 },
},
{
type: AvionicsCommandTypes.setAdfStandbyFrequency,
subsystem: 'avionics',
description: 'Set indexed ADF standby frequency in kHz.',
payloadExample: { index: 1, khz: 350 },
},
{
type: AvionicsCommandTypes.setBarometer,
subsystem: 'avionics',
description: 'Set indexed barometer pressure setting in inches of mercury.',
payloadExample: { index: 1, settingHg: 29.92, standardMode: false },
},
{
type: AvionicsCommandTypes.setTransponderState,
subsystem: 'avionics',
description: 'Set indexed transponder state.',
payloadExample: { index: 1, state: 3 },
},
{
type: AvionicsCommandTypes.setTransponderIdent,
subsystem: 'avionics',
description: 'Set indexed transponder ident state.',
payloadExample: { index: 1, active: true },
},
{
type: AutopilotCommandTypes.setMaster,
subsystem: 'autopilot',
description: 'Set autopilot master state.',
payloadExample: { enabled: true },
},
{
type: AutopilotCommandTypes.setDisengaged,
subsystem: 'autopilot',
description: 'Set autopilot disengaged annunciation state.',
payloadExample: { enabled: false },
},
{
type: AutopilotCommandTypes.setModeEnabled,
subsystem: 'autopilot',
description: 'Enable or disable an autopilot mode.',
payloadExample: { mode: 'heading', enabled: true },
},
{
type: AutopilotCommandTypes.setFlightDirectorActive,
subsystem: 'autopilot',
description: 'Set indexed flight director active state.',
payloadExample: { index: 1, active: true },
},
{
type: AutopilotCommandTypes.setSelectedHeading,
subsystem: 'autopilot',
description: 'Set selected autopilot heading in degrees.',
payloadExample: { degrees: 270 },
},
{
type: AutopilotCommandTypes.setSelectedAltitude,
subsystem: 'autopilot',
description: 'Set selected autopilot altitude in feet.',
payloadExample: { feet: 5000 },
},
{
type: AutopilotCommandTypes.setSelectedVerticalSpeed,
subsystem: 'autopilot',
description: 'Set selected autopilot vertical speed in feet per minute.',
payloadExample: { feetPerMinute: 700 },
},
{
type: AutopilotCommandTypes.setSelectedAirspeed,
subsystem: 'autopilot',
description: 'Set selected autopilot airspeed in knots.',
payloadExample: { knots: 220 },
},
{
type: AutopilotCommandTypes.setSelectedMach,
subsystem: 'autopilot',
description: 'Set selected autopilot Mach target.',
payloadExample: { mach: 0.78 },
},
{
type: AutopilotCommandTypes.setMaxBankId,
subsystem: 'autopilot',
description: 'Set selected autopilot max-bank identifier.',
payloadExample: { id: 1 },
},
{
type: ControlCommandTypes.setGearHandle,
subsystem: 'controls',
description: 'Set landing gear handle ratio.',
payloadExample: { ratio: 1 },
},
{
type: ControlCommandTypes.setGearPosition,
subsystem: 'controls',
description: 'Set landing gear position ratio.',
payloadExample: { ratio: 1 },
},
{
type: ControlCommandTypes.setFlapsHandle,
subsystem: 'controls',
description: 'Set flaps handle ratio.',
payloadExample: { ratio: 0.5 },
},
{
type: ControlCommandTypes.setFlapsPosition,
subsystem: 'controls',
description: 'Set flaps position ratio.',
payloadExample: { ratio: 0.5 },
},
{
type: ControlCommandTypes.setSpoilersHandle,
subsystem: 'controls',
description: 'Set spoilers handle ratio.',
payloadExample: { ratio: 0.5 },
},
{
type: ControlCommandTypes.setSpoilersPosition,
subsystem: 'controls',
description: 'Set spoilers position ratio.',
payloadExample: { ratio: 0.5 },
},
{
type: ControlCommandTypes.setAileronPosition,
subsystem: 'controls',
description: 'Set aileron position ratio.',
payloadExample: { ratio: 0 },
},
{
type: ControlCommandTypes.setElevatorPosition,
subsystem: 'controls',
description: 'Set elevator position ratio.',
payloadExample: { ratio: 0 },
},
{
type: ControlCommandTypes.setRudderPosition,
subsystem: 'controls',
description: 'Set rudder position ratio.',
payloadExample: { ratio: 0 },
},
{
type: ControlCommandTypes.setAileronTrim,
subsystem: 'controls',
description: 'Set aileron trim signed ratio.',
payloadExample: { ratio: 0 },
},
{
type: ControlCommandTypes.setElevatorTrim,
subsystem: 'controls',
description: 'Set elevator trim signed ratio.',
payloadExample: { ratio: 0 },
},
{
type: ControlCommandTypes.setRudderTrim,
subsystem: 'controls',
description: 'Set rudder trim signed ratio.',
payloadExample: { ratio: 0 },
},
{
type: ControlCommandTypes.setAileronTrimDisabled,
subsystem: 'controls',
description: 'Enable or disable aileron trim.',
payloadExample: { enabled: false },
},
{
type: ControlCommandTypes.setElevatorTrimDisabled,
subsystem: 'controls',
description: 'Enable or disable elevator trim.',
payloadExample: { enabled: false },
},
{
type: ControlCommandTypes.setRudderTrimDisabled,
subsystem: 'controls',
description: 'Enable or disable rudder trim.',
payloadExample: { enabled: false },
},
{
type: ControlCommandTypes.setParkingBrake,
subsystem: 'controls',
description: 'Set parking brake state.',
payloadExample: { enabled: true },
},
{
type: PropulsionCommandTypes.setApuMaster,
subsystem: 'propulsion',
description: 'Set APU master state.',
payloadExample: { enabled: true },
},
{
type: PropulsionCommandTypes.setApuStarter,
subsystem: 'propulsion',
description: 'Set APU starter state.',
payloadExample: { enabled: true },
},
{
type: PropulsionCommandTypes.setApuRunning,
subsystem: 'propulsion',
description: 'Set APU running state.',
payloadExample: { enabled: true },
},
{
type: PropulsionCommandTypes.setApuRpm,
subsystem: 'propulsion',
description: 'Set APU RPM percentage.',
payloadExample: { percent: 100 },
},
{
type: PropulsionCommandTypes.setEngineStarter,
subsystem: 'propulsion',
description: 'Set indexed engine starter state.',
payloadExample: { index: 1, enabled: true },
},
{
type: PropulsionCommandTypes.setEngineRunning,
subsystem: 'propulsion',
description: 'Set indexed engine running state.',
payloadExample: { index: 1, enabled: true },
},
{
type: PropulsionCommandTypes.setEngineN1,
subsystem: 'propulsion',
description: 'Set indexed engine N1 percentage.',
payloadExample: { index: 1, value: 20 },
},
{
type: PropulsionCommandTypes.setEngineRpm,
subsystem: 'propulsion',
description: 'Set indexed engine RPM.',
payloadExample: { index: 1, value: 20 },
},
{
type: PropulsionCommandTypes.setEngineThrottle,
subsystem: 'propulsion',
description: 'Set indexed engine throttle lever ratio.',
payloadExample: { index: 1, value: 0.5 },
},
{
type: PropulsionCommandTypes.setEnginePropellerLever,
subsystem: 'propulsion',
description: 'Set indexed engine propeller lever ratio.',
payloadExample: { index: 1, value: 0.5 },
},
{
type: PropulsionCommandTypes.setEngineMixtureLever,
subsystem: 'propulsion',
description: 'Set indexed engine mixture lever ratio.',
payloadExample: { index: 1, value: 0.5 },
},
{
type: PropulsionCommandTypes.setEngineFuelValve,
subsystem: 'propulsion',
description: 'Set indexed engine fuel valve state.',
payloadExample: { index: 1, enabled: true },
},
{
type: PropulsionCommandTypes.setEngineAlternator,
subsystem: 'propulsion',
description: 'Set indexed engine alternator state.',
payloadExample: { index: 1, enabled: true },
},
{
type: FuelCommandTypes.setPumpSwitch,
subsystem: 'fuel',
description: 'Set indexed fuel pump switch state.',
payloadExample: { index: 1, enabled: true },
},
{
type: FuelCommandTypes.setPumpActive,
subsystem: 'fuel',
description: 'Set indexed fuel pump active state.',
payloadExample: { index: 1, enabled: true },
},
{
type: FuelCommandTypes.setValveSwitch,
subsystem: 'fuel',
description: 'Set indexed fuel valve switch state.',
payloadExample: { index: 1, open: true },
},
{
type: FuelCommandTypes.setValveOpen,
subsystem: 'fuel',
description: 'Set indexed fuel valve open state.',
payloadExample: { index: 1, open: true },
},
{
type: FuelCommandTypes.setJunctionSetting,
subsystem: 'fuel',
description: 'Set indexed fuel junction setting.',
payloadExample: { index: 1, setting: 2 },
},
{
type: FuelCommandTypes.setTankQuantity,
subsystem: 'fuel',
description: 'Set named fuel tank quantity ratio.',
payloadExample: { id: 'main', ratio: 0.75 },
},
{
type: SurfaceCommandTypes.setTarget,
subsystem: 'surfaces',
description: 'Set a moving surface target ratio.',
payloadExample: { id: 'flaps', ratio: 0.5 },
},
{
type: SurfaceCommandTypes.setPosition,
subsystem: 'surfaces',
description: 'Set a moving surface position ratio.',
payloadExample: { id: 'flaps', ratio: 0.5 },
},
] as const
export function listCanonicalEngineCommands(
filter = '',
limit = 500
): readonly SimCommandCatalogEntry[] {
const needle = filter.trim().toLowerCase()
return SIM_COMMAND_CATALOG.filter(
command =>
!needle ||
command.type.toLowerCase().includes(needle) ||
command.subsystem.toLowerCase().includes(needle) ||
command.description.toLowerCase().includes(needle)
).slice(0, limit)
}