aboutsummaryrefslogtreecommitdiff
path: root/profile.yaml
blob: 4d28e65f991c81c47a97b4afec06dc28781fff5d (plain) (blame)
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
---
# This is the profile that I created for my own setup (good for DA40 with G1000 in X-Plane).
# for xplane_cmd, refer to /Resources/plugins/Commands.txt under your X-Plane installation
# for xplane_dataref, refer to /Resources/plugins/DataRefs.txt
#
# Page 0
- left:
    # left knob labels from top to bottom
    - label: Thr.
      inc:
        xplane_cmd: sim/engines/throttle_up
      dec:
        xplane_cmd: sim/engines/throttle_down
      pressed:
        xplane_cmd: sim/engines/throttle_full
    - label: Prop
      color_bg: '#0000ff'
      inc:
        xplane_cmd: sim/engines/prop_up
      dec:
        xplane_cmd: sim/engines/prop_down
    - label: Mix.
      inc:
        xplane_cmd: sim/engines/mixture_up
      dec:
        xplane_cmd: sim/engines/mixture_down
      pressed:
        xplane_cmd: sim/engines/mixture_max
      color_bg: '#ff0000'
  right:
    # right knob labels
    - label: HDG
      inc:
        xplane_cmd: sim/GPS/g1000n1_hdg_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_hdg_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_hdg_sync
    - label: ALT
      inc:
        xplane_cmd: sim/GPS/g1000n1_alt_inner_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_alt_inner_down
    - label: CRS
      inc:
        xplane_cmd: sim/GPS/g1000n1_crs_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_crs_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_crs_sync
  keys:
    # 12 touchable keys from left to right, top to bottom
    - display:
        # a "display" key only shows some live data, rather than functioning as a pressable key
        # "type" indicates which template for the display to use (one of meter/text/bar/attitude/ias/alt/hsi)
        # here, "bar" is a bar chart that draws several (practically <= 4) bars from left to right showing some stats
        type: bar
        # update frequency of the display
        freq: 6
        source:
          - xplane_dataref: sim/cockpit2/engine/actuators/throttle_ratio[0]
          - xplane_dataref: sim/cockpit2/engine/actuators/prop_ratio[0]
          - xplane_dataref: sim/cockpit2/engine/actuators/mixture_ratio[0]
          - xplane_dataref: sim/flightmodel/controls/flaprat
        label:
          - T
          - P
          - M
          - F
        # font size for each bar
        size:
          - 12
          - 12
          - 12
          - 12
        exp:
          - '$d'
          - '$d != null ? 1 - $d : null'
          - '$d'
          - '$d'

        # value expression written in a JS template literal (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
        # for each bar, should result in [0, 1]. Note $d is the array that
        # contains the fmt from "source"
        fmt:
          - '${$d[0] != null ? ($d[0] * 100).toFixed(0) : "X"}%'
          - '${$d[1] != null ? ($d[1] * 100).toFixed(0) : "X"}%'
          - '${$d[2] != null ? ($d[2] * 100).toFixed(0) : "X"}%'
          - '${$d[3] != null ? ($d[3] * 100).toFixed(0) : "X"}%'
        # bar colors
        color_fg:
          - white
          - blue
          - red
          - gray
    - display:
        # meter is a arc-style display that could be used to show RPM/power/speed, etc.
        type: meter
        freq: 6
        source:
          - xplane_dataref: sim/cockpit2/engine/indicators/MPR_in_hg[0]
        min: 10
        max: 30
        fmt: '${$d[0] != null ? $d[0].toFixed(1) : "X"}'
        # stops define the segmented arcs that the needle can point to at different angles
        stops:
          - color: 'green'
            value_begin: 13
            value_end: 30
    - display:
        type: meter
        freq: 6
        source:
          - xplane_dataref: sim/cockpit2/engine/indicators/engine_speed_rpm[0]
        min: 0
        max: 3000
        stops:
          - color: 'green'
            value_begin: 500
            value_end: 2400
          - color: 'yellow'
            value_begin: 2400
            value_end: 2700
          - color: 'red'
            value_begin: 2700
            value_end: 3000
    - label:
        - Flaps
        - Up
      size: 20
      pressed:
        xplane_cmd: sim/flight_controls/flaps_up
    - display:
        type: ias
        freq: 24
        source:
          - xplane_dataref: sim/cockpit2/gauges/indicators/airspeed_kts_pilot
    - display:
        type: attitude
        freq: 24
        source:
          - xplane_dataref: sim/cockpit/gyros/the_ind_ahars_pilot_deg # pitch
          - xplane_dataref: sim/cockpit/gyros/phi_ind_ahars_pilot_deg # roll
          - xplane_dataref: sim/cockpit2/gauges/indicators/slip_deg
          - xplane_dataref: sim/cockpit2/radios/actuators/HSI_source_select_pilot # navigation source for HSI
          - xplane_dataref: sim/cockpit2/radios/indicators/hsi_vdef_dots_pilot
          - xplane_dataref: sim/cockpit2/radios/indicators/hsi_flag_glideslope_pilot
        # navs contains the mapping from the HSI source value (source[2]) to the index in source[] array
        navs:
          2:
            def: 4
            received: 5
          0:
            def: 4
            received: 5
          1:
            def: 4
            received: 5
    - display:
        type: alt
        freq: 24
        source:
          - xplane_dataref: sim/cockpit2/gauges/indicators/altitude_ft_pilot # altitude
          - xplane_dataref: sim/cockpit2/gauges/indicators/vvi_fpm_pilot # vertical speed
          - xplane_dataref: sim/cockpit/autopilot/altitude # altitude bug
    - label:
        - Flaps
        - Down
      size: 20
      pressed:
        xplane_cmd: sim/flight_controls/flaps_down
    - display:
        type: text
        source:
          - xplane_dataref: sim/cockpit/autopilot/autopilot_state
          - xplane_dataref: sim/cockpit2/radios/actuators/HSI_source_select_pilot
        fmt:
          - '${($d[0] & 2) ? "HDG" : (($d[0] & 0x200) ? "NAV" : "ROL")} ${($d[0] & 0x10) ? "VS" : (($d[0] & 0x40) ? "FLC" : (($d[0] & 0x4000) ? "ALT" : "PIT"))}'
          - '${$d[1] == 0 ? "NAV1" : ($d[1] == 1 ? "NAV2" : ($d[1] == 2 ? "GPS" : "X"))}'
        size:
          - 16
          - 16
    - display:
        type: hsi
        freq: 12
        source:
          - xplane_dataref: sim/cockpit2/gauges/indicators/heading_AHARS_deg_mag_pilot # current heading
          - xplane_dataref: sim/cockpit2/autopilot/heading_dial_deg_mag_pilot # heading bug
          - xplane_dataref: sim/cockpit2/radios/actuators/HSI_source_select_pilot # navigation source for HSI
          - xplane_dataref: sim/cockpit2/radios/indicators/hsi_hdef_dots_pilot
          - xplane_dataref: sim/cockpit2/radios/indicators/hsi_display_horizontal_pilot
          - xplane_dataref: sim/cockpit/radios/gps_course_degtm
          - xplane_dataref: sim/cockpit/radios/gps_fromto
          - xplane_dataref: sim/cockpit2/radios/actuators/nav1_obs_deg_mag_pilot
          - xplane_dataref: sim/cockpit/radios/nav1_fromto
          - xplane_dataref: sim/cockpit2/radios/actuators/nav2_obs_deg_mag_pilot
          - xplane_dataref: sim/cockpit/radios/nav2_fromto
        navs:
          2:
            crs: 5
            fromto: 6
            def: 3
            received: 4
            color: magenta
          0:
            crs: 7
            fromto: 8
            def: 3
            received: 4
            color: '#2dfe54'
          1:
            crs: 9
            fromto: 10
            def: 3
            received: 4
            color: '#2dfe54'
    - display:
        type: text
        freq: 6
        source:
          - xplane_dataref: sim/cockpit2/gauges/indicators/heading_AHARS_deg_mag_pilot
          - xplane_dataref: sim/cockpit2/autopilot/heading_dial_deg_mag_pilot
          - xplane_dataref: sim/cockpit2/radios/actuators/HSI_source_select_pilot
          - xplane_dataref: sim/cockpit/radios/gps_course_degtm
          - xplane_dataref: sim/cockpit2/radios/actuators/nav1_obs_deg_mag_pilot
          - xplane_dataref: sim/cockpit2/radios/actuators/nav2_obs_deg_mag_pilot
        fmt:
          - '${$d[0] != null ? $d[0].toFixed(0).padStart(3, "0") : "000"}'
          - 'HDG ${$d[1] != null ? $d[1].toFixed(0).padStart(3, "0") : "000"}'
          - 'CRS ${($d[2] == 2 ? $d[3] : ($d[2] == 0 ? $d[4] : ($d[2] == 1 ? $d[5] : 0))).toFixed(0).padStart(3, "0")}'
        color_fg:
          - white
          - cyan
          - '${($d[2] == 2 ? "magenta" : ($d[2] == 0 ? "#2dfe54" : ($d[2] == 1 ? "#2dfe54" : "magenta")))}'
        size:
          - null
          - 16
          - 16
    - label: Brake
      pressed:
        xplane_cmd: sim/flight_controls/brakes_toggle_regular
      size: 20

# Page 1
- right:
    - label: HDG
      inc:
        xplane_cmd: sim/GPS/g1000n1_hdg_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_hdg_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_hdg_sync
    - label: ALT
      inc:
        xplane_cmd: sim/GPS/g1000n1_alt_inner_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_alt_inner_down
    - label: CRS
      inc:
        xplane_cmd: sim/GPS/g1000n1_crs_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_crs_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_crs_sync
  keys:
    - label: AP
      pressed:
        xplane_cmd: sim/GPS/g1000n1_ap
    - label: FD
      pressed:
        xplane_cmd: sim/GPS/g1000n1_fd
    - label: HDG
      pressed:
        xplane_cmd: sim/GPS/g1000n1_hdg
    - label: ALT
      pressed:
        xplane_cmd: sim/GPS/g1000n1_alt
    - label: NAV
      pressed:
        xplane_cmd: sim/GPS/g1000n1_nav
    - label: VNV
      pressed:
        xplane_cmd: sim/GPS/g1000n1_vnv
    - label: APR
      pressed:
        xplane_cmd: sim/GPS/g1000n1_apr
    - label: BC
      pressed:
        xplane_cmd: sim/GPS/g1000n1_bc
    - label: VS
      pressed:
        xplane_cmd: sim/GPS/g1000n1_vs
    - label: UP
      pressed:
        xplane_cmd: sim/GPS/g1000n1_nose_up
    - label: FLC
      pressed:
        xplane_cmd: sim/GPS/g1000n1_flc
    - label: DN
      pressed:
        xplane_cmd: sim/GPS/g1000n1_nose_down
  color: '#1a62fd'

# Page 2
- left:
    - label: FMS out
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n1_fms_outer_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_fms_outer_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_cursor
    - label: FMS in
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n1_fms_inner_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_fms_inner_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_cursor
    - label: BARO
      inc:
        xplane_cmd: sim/GPS/g1000n1_baro_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_baro_down
  right:
    - label: FMS out
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n3_fms_outer_up
      dec:
        xplane_cmd: sim/GPS/g1000n3_fms_outer_down
      pressed:
        xplane_cmd: sim/GPS/g1000n3_cursor
    - label: FMS in
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n3_fms_inner_up
      dec:
        xplane_cmd: sim/GPS/g1000n3_fms_inner_down
      pressed:
        xplane_cmd: sim/GPS/g1000n3_cursor
    -
  keys:
    - label: -D->
      pressed:
        xplane_cmd: sim/GPS/g1000n1_direct
    - label: MENU
      pressed:
        xplane_cmd: sim/GPS/g1000n1_menu
    - label: -D->
      pressed:
        xplane_cmd: sim/GPS/g1000n3_direct
    - label: MENU
      pressed:
        xplane_cmd: sim/GPS/g1000n3_menu
    - label: FPL
      pressed:
        xplane_cmd: sim/GPS/g1000n1_fpl
    - label: PROC
      pressed:
        xplane_cmd: sim/GPS/g1000n1_proc
    - label: FPL
      pressed:
        xplane_cmd: sim/GPS/g1000n3_fpl
    - label: PROC
      pressed:
        xplane_cmd: sim/GPS/g1000n3_proc
    - label: CLR
      pressed:
        xplane_cmd: sim/GPS/g1000n1_clr
    - label: ENT
      pressed:
        xplane_cmd: sim/GPS/g1000n1_ent
    - label: CLR
      pressed:
        xplane_cmd: sim/GPS/g1000n3_clr
    - label: ENT
      pressed:
        xplane_cmd: sim/GPS/g1000n3_ent
  color: 'yellow'

# Page 3
- left:
    - label: COM in
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n1_com_inner_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_com_inner_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_com12
    - label: COM out
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n1_com_outer_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_com_outer_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_com12
    -
  right:
    - label: NAV in
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n1_nav_inner_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_nav_inner_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_nav12
    - label: NAV out
      size: 20
      inc:
        xplane_cmd: sim/GPS/g1000n1_nav_outer_up
      dec:
        xplane_cmd: sim/GPS/g1000n1_nav_outer_down
      pressed:
        xplane_cmd: sim/GPS/g1000n1_nav12
    -
  keys:
    - label:
        - COM
        - <->
      pressed:
        xplane_cmd: sim/GPS/g1000n1_com_ff
    - label:
        - NAV
        - <->
      pressed:
        xplane_cmd: sim/GPS/g1000n1_nav_ff
    -
    -
    - label:
        - COM1
        - Mic
      pressed:
        xplane_cmd: sim/audio_panel/transmit_audio_com1
    - label: COM1
      pressed:
        xplane_cmd: sim/audio_panel/monitor_audio_com1
    -
    -
    - label:
        - COM2
        - Mic
      pressed:
        xplane_cmd: sim/audio_panel/transmit_audio_com2
    - label: COM2
      pressed:
        xplane_cmd: sim/audio_panel/monitor_audio_com2
    -
    -
  color: 'white'