-
Notifications
You must be signed in to change notification settings - Fork 2
/
A-10C.lua
1381 lines (1204 loc) · 76.2 KB
/
A-10C.lua
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
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
BIOS.protocol.beginModule("A-10C", 0x1000)
BIOS.protocol.setExportModuleAircrafts({"A-10C", "A-10C_2"})
--overhaul by WarLord
local inputProcessors = moduleBeingDefined.inputProcessors
local documentation = moduleBeingDefined.documentation
local document = BIOS.util.document
local parse_indication = BIOS.util.parse_indication
local defineIndicatorLight = BIOS.util.defineIndicatorLight
local definePushButton = BIOS.util.definePushButton
local definePotentiometer = BIOS.util.definePotentiometer
local defineRotary = BIOS.util.defineRotary
local defineSetCommandTumb = BIOS.util.defineSetCommandTumb
local defineTumb = BIOS.util.defineTumb
local define3PosTumb = BIOS.util.define3PosTumb
local defineToggleSwitch = BIOS.util.defineToggleSwitch
local defineToggleSwitchToggleOnly = BIOS.util.defineToggleSwitchToggleOnly
local defineFixedStepTumb = BIOS.util.defineFixedStepTumb
local defineVariableStepTumb = BIOS.util.defineVariableStepTumb
local defineString = BIOS.util.defineString
local defineRockerSwitch = BIOS.util.defineRockerSwitch
local defineMultipositionSwitch = BIOS.util.defineMultipositionSwitch
local defineElectricallyHeldSwitch = BIOS.util.defineElectricallyHeldSwitch
local defineFloat = BIOS.util.defineFloat
local define8BitFloat = BIOS.util.define8BitFloat
local defineIntegerFromGetter = BIOS.util.defineIntegerFromGetter
local function defineRadioWheel(msg, device_id, command1, command2, command_args, arg_number, step, limits, output_map, category, description)
defineTumb(msg, device_id, command1, arg_number, step, limits, output_map, "skiplast", category, description)
local docentry = moduleBeingDefined.documentation[category][msg]
assert(docentry.inputs[2].interface == "set_state")
docentry.inputs[2] = nil
moduleBeingDefined.documentation[category][msg].control_type = "discrete_dial"
inputProcessors[msg] = function(state)
if state == "INC" then
GetDevice(device_id):performClickableAction(command2, command_args[2])
end
if state == "DEC" then
GetDevice(device_id):performClickableAction(command1, command_args[1])
end
end
end
local function define3PosTumb1(msg, device_id, command, arg_number, category, description)
defineTumb(msg, device_id, command, arg_number, 0.1, {0.0, 0.2}, nil, false, category, description)
end
local function getCMSPDisplayLines(dev0)
local cmsp = BIOS.util.parse_indication(7)
if not cmsp then
local emptyline = string.format("%19s", "") -- 19 spaces
return emptyline, emptyline
else
local tu = cmsp["txt_UP"]
local line1 = string.format("%-4s", tu:sub(0, 4))..
" "..string.format("%-4s", tu:sub(5, 8))..
" "..string.format("%-4s", tu:sub(9, 12))..
" "..string.format("%-4s", tu:sub(13, 16))
local line2 = string.format("%-4s", cmsp["txt_DOWN1"])..
" "..string.format("%-4s", cmsp["txt_DOWN2"])..
" "..string.format("%-4s", cmsp["txt_DOWN3"])..
" "..string.format("%-4s", cmsp["txt_DOWN4"])
return line1, line2
end
end
local function getUHFPreset()
local ind = parse_indication(10)
if ind == nil then return " " end
return ind["txtPresetChannel"]
end
local function getUHFFrequency()
local ind = parse_indication(11)
if ind == nil then return " " end
local freqStatus = ind["txtFreqStatus"] -- e.g. "251000"
return freqStatus:sub(0,3) .. "." .. freqStatus:sub(4,6)
end
local vhf_lut1 = {
["0.0"] = "3",
["0.15"] = "3",
["0.20"] = "4",
["0.25"] = "5",
["0.30"] = "6",
["0.35"] = "7",
["0.40"] = "8",
["0.45"] = "9",
["0.50"] = "10",
["0.55"] = "11",
["0.60"] = "12",
["0.65"] = "13",
["0.70"] = "14",
["0.75"] = "15"
}
local function getVhfAmFreqency()
local freq1 = vhf_lut1[string.format("%.2f",GetDevice(0):get_argument_value(143))]
if freq1 == nil then freq1 = "3" end
local freq2 = string.format("%1.1f", GetDevice(0):get_argument_value(144)):sub(3)
if freq2 == nil then freq2 = "0" end
local freq3 = string.format("%1.1f", GetDevice(0):get_argument_value(145)):sub(3)
if freq3 == nil then freq3 = "0" end
local freq4 = string.format("%1.2f", GetDevice(0):get_argument_value(146)):sub(3)
if freq4 == nil then freq4 = "00" end
return freq1 .. freq2 .. "." .. freq3 .. freq4
end
local function getVhfFmFreqency()
local freq1 = vhf_lut1[string.format("%.2f",GetDevice(0):get_argument_value(157))]
if freq1 == nil then freq1 = "3" end
local freq2 = string.format("%1.1f", GetDevice(0):get_argument_value(158)):sub(3)
if freq2 == nil then freq2 = "0" end
local freq3 = string.format("%1.1f", GetDevice(0):get_argument_value(159)):sub(3)
if freq3 == nil then freq3 = "0" end
local freq4 = string.format("%1.2f", GetDevice(0):get_argument_value(160)):sub(3)
if freq4 == nil then freq4 = "00" end
return freq1 .. freq2 .. "." .. freq3 .. freq4
end
local function getTacanChannel()
local tcn_2 = ""
if GetDevice(0):get_argument_value(263) == 0 then
tcn_2 = "0"
else
tcn_2 = "1"
end
local tcn_1 = string.format("%.1f", GetDevice(0):get_argument_value(264)):sub(3)
local tcn_0 = string.format("%.1f", GetDevice(0):get_argument_value(265)):sub(3)
local tcn_xy = ""
if GetDevice(0):get_argument_value(266) == 0 then
tcn_xy = "X"
else
tcn_xy = "Y"
end
return tcn_2 .. tcn_1 .. tcn_0 .. tcn_xy
end
local function getILSFrequency()
local ils_mhz_lut = {
["0.0"] = "108",
["0.1"] = "109",
["0.2"] = "110",
["0.3"] = "111"
}
local ils_khz_lut = {
["0.0"] = "10",
["0.1"] = "15",
["0.2"] = "30",
["0.3"] = "35",
["0.4"] = "50",
["0.5"] = "55",
["0.6"] = "70",
["0.7"] = "75",
["0.8"] = "90",
["0.9"] = "95"
}
local mhz = ils_mhz_lut[string.format("%.1f", GetDevice(0):get_argument_value(251))]
if mhz == nil then mhz = "108" end
local khz = ils_khz_lut[string.format("%.01f", GetDevice(0):get_argument_value(252))]
if khz == nil then khz = "10" end
return mhz .. "." .. khz
end
local cmsp1Alloc = moduleBeingDefined.memoryMap:allocateString{ maxLength = 19 }
local cmsp2Alloc = moduleBeingDefined.memoryMap:allocateString{ maxLength = 19 }
document {
identifier = "CMSP1",
category = "CMSP",
description = "CMSP Display Line 1",
control_type = "display",
inputs = {},
outputs = {
{ ["type"] = "string",
suffix = "",
address = cmsp1Alloc.address,
mask = cmsp1Alloc.mask,
shift_by = cmsp1Alloc.shiftBy,
max_length = cmsp1Alloc.maxLength,
description = "CMSP Display Line 1 (19 characters)"
}
}
}
document {
identifier = "CMSP2",
category = "CMSP",
description = "CMSP Display Line 2",
control_type = "display",
inputs = {},
outputs = {
{ ["type"] = "string",
suffix = "",
address = cmsp2Alloc.address,
mask = cmsp2Alloc.mask,
shift_by = cmsp2Alloc.shiftBy,
max_length = cmsp2Alloc.maxLength,
description = "CMSP Display Line 2 (19 characters)"
}
}
}
moduleBeingDefined.exportHooks[#moduleBeingDefined.exportHooks+1] = function(dev0)
local line1, line2 = getCMSPDisplayLines(dev0)
cmsp1Alloc:setValue(line1)
cmsp2Alloc:setValue(line2)
end
defineFloat("SAI_PITCH", 63, {-1, 1}, "Standby Attitude Indicator", "SAI Pitch")
defineFloat("SAI_BANK", 64, {-1, 1}, "Standby Attitude Indicator", "SAI Bank")
defineFloat("SAI_WARNING_FLAG", 65, {0, 1}, "Standby Attitude Indicator", "SAI Warning Flag")
defineFloat("SAI_PITCH_ADJ", 715, {-1, 1}, "Standby Attitude Indicator", "SAI Manual Pitch Adjustment")
defineFloat("SAI_KNOB_ARROW", 717, {-1, 1}, "Standby Attitude Indicator", "SAI Knob Arrow")
defineFloat("ADI_PITCH", 17, {-1, 1}, "ADI", "ADI Pitch")
defineFloat("ADI_BANK", 18, {-1, 1}, "ADI", "ADI Bank")
defineFloat("ADI_SLIP", 24, {-1, 1}, "ADI", "ADI Slipball Position")
defineFloat("ADI_TURN", 23, {-1, 1}, "ADI", "ADI Turn Needle")
defineFloat("ADI_ATTWARN_FLAG", 25, {0, 1}, "ADI", "ADI Attitude Warning Flag")
defineFloat("ADI_CRSWARN_FLAG", 19, {0, 1}, "ADI", "ADI Course Warning Flag")
defineFloat("ADI_GSWARN_FLAG", 26, {0, 1}, "ADI", "ADI Glide Slope Warning Flag")
defineFloat("ADI_STEER_BANK", 20, {-1, 1}, "ADI", "ADI Bank Steering Bar")
defineFloat("ADI_STEER_PITCH", 21, {-1, 1}, "ADI", "ADI Pitch Steering Bar")
defineFloat("ADI_GS", 27, {-1, 1}, "ADI", "ADI Glide Slope Indicator")
defineFloat("HSI_PWROFF_FLAG", 40, {0, 1}, "HSI", "HSI Poweroff Flag")
defineFloat("HSI_RANGE_FLAG", 32, {0, 1}, "HSI", "HSI Range Flag")
defineFloat("HSI_BEARING_FLAG", 46, {0, 1}, "HSI", "HSI Bearing Flag")
defineFloat("HSI_HDG", 34, {0, 1}, "HSI", "HSI Heading")
defineFloat("HSI_BEARING1", 33, {0, 1}, "HSI", "HSI Bearing Pointer 1")
defineFloat("HSI_BEARING2", 35, {0, 1}, "HSI", "HSI Bearing Pointer 2")
defineFloat("HSI_HDG_BUG", 36, {0, 1}, "HSI", "HSI Heading Bug")
defineFloat("HSI_CRS", 47, {0, 1}, "HSI", "HSI Course")
defineFloat("HSI_CC_A", 37, {0, 1}, "HSI", "HSI Course Counter A")
defineFloat("HSI_CC_B", 39, {0, 1}, "HSI", "HSI Course Counter B")
defineFloat("HSI_RC_A", 28, {0, 1}, "HSI", "HSI Range Counter A")
defineFloat("HSI_RC_B", 29, {0, 1}, "HSI", "HSI Range Counter B")
defineFloat("HSI_RC_C", 30, {0, 1}, "HSI", "HSI Range Counter C")
defineFloat("HSI_RC_D", 31, {0, 1}, "HSI", "HSI Range Counter D")
defineFloat("HSI_DEVIATION", 41, {-1, 1}, "HSI", "HSI Deviation")
defineFloat("HSI_TOFROM1", 42, {0, 1}, "HSI", "HSI TO/FROM 1")
defineFloat("HSI_TOFROM2", 43, {0, 1}, "HSI", "HSI TO/FROM 2")
local dummyAlloc = moduleBeingDefined.memoryMap:allocateInt { maxValue = 65535 }
local dummyAlloc = moduleBeingDefined.memoryMap:allocateInt { maxValue = 65535 }
defineFloat("HARS_SYNC", 269, {-1, 1}, "HARS", "HARS Sync")
defineFloat("VVI", 12, {-1, 1}, "VVI", "Vertical Velocity Indicator")
defineFloat("ACCEL_G", 15, {0, 1}, "Accelerometer", "G Load")
defineFloat("ACCEL_MIN", 902, {0, 1}, "Accelerometer", "Accelerometer Min Pointer")
defineFloat("ACCEL_MAX", 903, {0, 1}, "Accelerometer", "Accelerometer Max Pointer")
defineFloat("AOA_PWROFF", 55, {0, 1}, "AOA Indicator", "AOA Poweroff Flag")
defineFloat("AOA_UNITS", 4, {0, 1}, "AOA Indicator", "AOA Units")
defineFloat("AIRSPEED_NEEDLE", 48, {0, 1}, "Airspeed Indicator", "Airspeed Needle")
defineFloat("AIRSPEED_DIAL", 49, {0, 1}, "Airspeed Indicator", "Airspeed Dial")
defineFloat("ALT_100FT", 51, {0, 1}, "Altimeter", "100 ft Pointer")
defineFloat("ALT_10000FT_CNT", 52, {0, 1}, "Altimeter", "10000 FT Counter")
defineFloat("ALT_1000FT_CNT", 53, {0, 1}, "Altimeter", "1000 FT Counter")
defineFloat("ALT_100FT_CNT", 54, {0, 1}, "Altimeter", "100 FT Counter")
defineFloat("ALT_PRESSURE0", 59, {0, 1}, "Altimeter", "Barometric Pressure Digit 0")
defineFloat("ALT_PRESSURE1", 58, {0, 1}, "Altimeter", "Barometric Pressure Digit 1")
defineFloat("ALT_PRESSURE2", 57, {0, 1}, "Altimeter", "Barometric Pressure Digit 2")
defineFloat("ALT_PRESSURE3", 56, {0, 1}, "Altimeter", "Barometric Pressure Digit 3")
defineIndicatorLight("CMSC_LAUNCH", 372, "CMSC", "Missile Launch Indicator (red)")
defineIndicatorLight("CMSC_PRIO", 373, "CMSC", "Priority Status Indicator (green)")
defineIndicatorLight("CMSC_UNKN", 374, "CMSC", "Unknown Status Indicator (green)")
local cmscData = nil
moduleBeingDefined.exportHooks[#moduleBeingDefined.exportHooks+1] = function()
cmscData = parse_indication(8)
end
local function getCmscChaffFlare()
if not cmscData then return " " end
return cmscData.txt_CHAFF_FLARE or " "
end
defineString("CMSC_TXT_CHAFF_FLARE", getCmscChaffFlare, 8, "CMSC", "Chaff / Flare Amount Display")
local function getCmscJmr()
if not cmscData then return " " end
return cmscData.txt_JMR or " "
end
defineString("CMSC_TXT_JMR", getCmscJmr, 8, "CMSC", "JMR Status Display")
local dummy = moduleBeingDefined.memoryMap:allocateInt{ maxValue = 65535 }
defineFloat("FLAP_POS", 653, {0, 2/3}, "Landing Gear and Flap Control Panel", "Flap Position Indicator")
defineFloat("L_ENG_FAN", 76, {0, 1}, "Engine Instruments", "Left Engine Fan Speed")
defineFloat("R_ENG_FAN", 77, {0, 1}, "Engine Instruments", "Right Engine Fan Speed")
defineFloat("L_ENG_CORE_T", 79, {0, 1}, "Engine Instruments", "Left Engine Core Speed Tenth")
defineFloat("L_ENG_CORE", 78, {0, 1}, "Engine Instruments", "Left Engine Core Speed")
defineFloat("R_ENG_CORE_T", 81, {0, 1}, "Engine Instruments", "Right Engine Core Speed Tenth")
defineFloat("R_ENG_CORE", 80, {0, 1}, "Engine Instruments", "Right Engine Core Speed")
defineFloat("L_ENG_FUEL_FLOW", 84, {0, 1}, "Engine Instruments", "Left Engine Fuel Flow")
defineFloat("R_ENG_FUEL_FLOW", 85, {0, 1}, "Engine Instruments", "Right Engine Fuel Flow")
defineFloat("L_ENG_TEMP_T", 71, {0, 1}, "Engine Instruments", "Left Engine Temperature Tenth")
defineFloat("L_ENG_TEMP", 70, {0, 1}, "Engine Instruments", "Left Engine Temperature")
defineFloat("R_ENG_TEMP_T", 74, {0, 1}, "Engine Instruments", "Right Engine Temperature Tenth")
defineFloat("R_ENG_TEMP", 73, {0, 1}, "Engine Instruments", "Right Engine Temperature")
defineFloat("L_ENG_TEMP_OFF", 72, {0, 1}, "Engine Instruments", "Left Engine Temperature Off")
defineFloat("R_ENG_TEMP_OFF", 75, {0, 1}, "Engine Instruments", "Right Engine Temperature Off")
defineFloat("APU_RPM", 13, {0, 1}, "Engine Instruments", "APU RPM Gauge")
defineFloat("APU_TEMP", 14, {0, 1}, "Engine Instruments", "APU Temperature Gauge")
defineFloat("L_HYD_PRESS", 647, {0, 1}, "Engine Instruments", "Left Hydraulic Pressure")
defineFloat("R_HYD_PRESS", 648, {0, 1}, "Engine Instruments", "Right Hydraulic Pressure")
defineFloat("L_OIL_PRESS", 82, {0, 1}, "Engine Instruments", "Left Oil Pressure")
defineFloat("R_OIL_PRESS", 83, {0, 1}, "Engine Instruments", "Right Oil Pressure")
defineFloat("FUEL_QTY_L", 88, {0, 1}, "Fuel Panel", "Fuel Qty Left")
defineFloat("FUEL_QTY_R", 89, {0, 1}, "Fuel Panel", "Fuel Qty Right")
defineFloat("FUEL_QTY_10000", 90, {0, 1}, "Fuel Panel", "Fuel Quantity Counter 10000")
defineFloat("FUEL_QTY_1000", 91, {0, 1}, "Fuel Panel", "Fuel Quantity Counter 1000")
defineFloat("FUEL_QTY_100", 92, {0, 1}, "Fuel Panel", "Fuel Quantity Counter 100")
defineIndicatorLight("MASTER_CAUTION", 404, "UFC", "Master Caution Light (yellow)")
-- The order in this file roughly follows clickabledata.lua
-- the following 12 indicators are "out of order" to ensure that
-- the caution lights begin on a 16-bit boundary
defineIndicatorLight("AOA_INDEXER_HIGH", 540, "HUD", "AOA Indexer High (green)")
defineIndicatorLight("AOA_INDEXER_NORMAL", 541, "HUD", "AOA Indexer Normal (green)")
defineIndicatorLight("AOA_INDEXER_LOW", 542, "HUD", "AOA Indexer Low (green)")
defineIndicatorLight("AIR_REFUEL_READY", 730, "HUD", "Air Refuel READY Light (green)")
defineIndicatorLight("AIR_REFUEL_LATCHED", 731, "HUD", "Air Refuel LATCHED Light (green)")
defineIndicatorLight("AIR_REFUEL_DISCONNECT", 732, "HUD", "Air Refuel DISCONNECT Light (green)")
defineIndicatorLight("TAKE_OFF_TRIM", 191, "SAS Panel", "TAKEOFF TRIM Indicator Light (green)")
defineIndicatorLight("GEAR_N_SAFE", 659, "Landing Gear and Flap Control Panel", "Nose Gear Safe (green)")
defineIndicatorLight("GEAR_L_SAFE", 660, "Landing Gear and Flap Control Panel", "Left Gear Safe (green)")
defineIndicatorLight("GEAR_R_SAFE", 661, "Landing Gear and Flap Control Panel", "Right Gear Safe (green)")
defineIndicatorLight("HANDLE_GEAR_WARNING", 737, "Landing Gear and Flap Control Panel", "Handle Gear Warning Light (red)")
defineIndicatorLight("GUN_READY", 662, "Front Dash", "GUN READY Indicator (green)")
-- Caution Lights
defineIndicatorLight("CL_A1", 480, "Caution Lights Panel", "ENG START CYCLE Light (green)")
defineIndicatorLight("CL_A2", 481, "Caution Lights Panel", "L-HYD PRESS Light (green)")
defineIndicatorLight("CL_A3", 482, "Caution Lights Panel", "R-HYD PRESS Light (green)")
defineIndicatorLight("CL_A4", 483, "Caution Lights Panel", "GUN UNSAFE Light (green)")
defineIndicatorLight("CL_B1", 484, "Caution Lights Panel", "ANTI-SKID Light (green)")
defineIndicatorLight("CL_B2", 485, "Caution Lights Panel", "L-HYD RES Light (green)")
defineIndicatorLight("CL_B3", 486, "Caution Lights Panel", "R-HYD RES Light (green)")
defineIndicatorLight("CL_B4", 487, "Caution Lights Panel", "OXY LOW Light (green)")
defineIndicatorLight("CL_C1", 488, "Caution Lights Panel", "ELEV DISENG Light (green)")
defineIndicatorLight("CL_C2", 489, "Caution Lights Panel", "VOID1 Light (green)")
defineIndicatorLight("CL_C3", 490, "Caution Lights Panel", "SEAT NOT ARMED Light (green)")
defineIndicatorLight("CL_C4", 491, "Caution Lights Panel", "BLEED AIR LEAK Light (green)")
defineIndicatorLight("CL_D1", 492, "Caution Lights Panel", "AIL DISENG Light (green)")
defineIndicatorLight("CL_D2", 493, "Caution Lights Panel", "L-AIL TAB Light (green)")
defineIndicatorLight("CL_D3", 494, "Caution Lights Panel", "R-AIL TAB Light (green)")
defineIndicatorLight("CL_D4", 495, "Caution Lights Panel", "SERVICE AIR HOT Light (green)")
defineIndicatorLight("CL_E1", 496, "Caution Lights Panel", "PITCH SAS Light (green)")
defineIndicatorLight("CL_E2", 497, "Caution Lights Panel", "L-ENG HOT Light (green)")
defineIndicatorLight("CL_E3", 498, "Caution Lights Panel", "R-ENG HOT Light (green)")
defineIndicatorLight("CL_E4", 499, "Caution Lights Panel", "WINDSHIELD HOT Light (green)")
defineIndicatorLight("CL_F1", 500, "Caution Lights Panel", "YAW SAS Light (green)")
defineIndicatorLight("CL_F2", 501, "Caution Lights Panel", "L-ENG OIL PRESS Light (green)")
defineIndicatorLight("CL_F3", 502, "Caution Lights Panel", "R-ENG OIL PRESS Light (green)")
defineIndicatorLight("CL_F4", 503, "Caution Lights Panel", "CICU Light (green)")
defineIndicatorLight("CL_G1", 504, "Caution Lights Panel", "GCAS Light (green)")
defineIndicatorLight("CL_G2", 505, "Caution Lights Panel", "L-MAIN PUMP Light (green)")
defineIndicatorLight("CL_G3", 506, "Caution Lights Panel", "R-MAIN PUMP Light (green)")
defineIndicatorLight("CL_G4", 507, "Caution Lights Panel", "VOID2 Light (green)")
defineIndicatorLight("CL_H1", 508, "Caution Lights Panel", "LASTE Light (green)")
defineIndicatorLight("CL_H2", 509, "Caution Lights Panel", "L-WING PUMP Light (green)")
defineIndicatorLight("CL_H3", 510, "Caution Lights Panel", "R-WING PUMP Light (green)")
defineIndicatorLight("CL_H4", 511, "Caution Lights Panel", "HARS Light (green)")
defineIndicatorLight("CL_I1", 512, "Caution Lights Panel", "IFF MODE-4 Light (green)")
defineIndicatorLight("CL_I2", 513, "Caution Lights Panel", "L-MAIN FUEL LOW Light (green)")
defineIndicatorLight("CL_I3", 514, "Caution Lights Panel", "R-MAIN FUEL LOW Light (green)")
defineIndicatorLight("CL_I4", 515, "Caution Lights Panel", "L-R TKS UNEQUAL Light (green)")
defineIndicatorLight("CL_J1", 516, "Caution Lights Panel", "EAC Light (green)")
defineIndicatorLight("CL_J2", 517, "Caution Lights Panel", "L-FUEL PRESS Light (green)")
defineIndicatorLight("CL_J3", 518, "Caution Lights Panel", "R-FUEL PRESS Light (green)")
defineIndicatorLight("CL_J4", 519, "Caution Lights Panel", "NAV Light (green)")
defineIndicatorLight("CL_K1", 520, "Caution Lights Panel", "STALL SYS Light (green)")
defineIndicatorLight("CL_K2", 521, "Caution Lights Panel", "L-CONV Light (green)")
defineIndicatorLight("CL_K3", 522, "Caution Lights Panel", "R-CONV Light (green)")
defineIndicatorLight("CL_K4", 523, "Caution Lights Panel", "CADC Light (green)")
defineIndicatorLight("CL_L1", 524, "Caution Lights Panel", "APU GEN Light (green)")
defineIndicatorLight("CL_L2", 525, "Caution Lights Panel", "L-GEN Light (green)")
defineIndicatorLight("CL_L3", 526, "Caution Lights Panel", "R-GEN Light (green)")
defineIndicatorLight("CL_L4", 527, "Caution Lights Panel", "INST INV Light (green)")
defineIndicatorLight("NOSEWHEEL_STEERING", 663, "Front Dash", "Nosewheel Steering Indicator (green)")
defineIndicatorLight("MARKER_BEACON", 664, "Front Dash", "MARKER BEACON Indicator (green)")
defineIndicatorLight("CANOPY_UNLOCKED", 665, "Front Dash", "CANOPY UNLOCKED Indicator (green)")
defineIndicatorLight("L_ENG_FIRE", 215, "Glare Shield", "Left Engine Fire Indicator (yellow)")
defineIndicatorLight("APU_FIRE", 216, "Glare Shield", "APU Fire Indicator (yellow)")
defineIndicatorLight("R_ENG_FIRE", 217, "Glare Shield", "Right Engine Fire Indicator (yellow)")
defineIndicatorLight("L_AILERON_EMER_DISENGAGE", 178, "Emergency Flight Control Panel", "Left Aileron EMER DISENG Indicator (yellow)")
defineIndicatorLight("R_AILERON_EMER_DISENGAGE", 179, "Emergency Flight Control Panel", "Right Aileron EMER DISENG Indicator (yellow)")
defineIndicatorLight("L_ELEVATOR_EMER_DISENGAGE", 181, "Emergency Flight Control Panel", "Left Elevator EMER DISENG Indicator (yellow)")
defineIndicatorLight("R_ELEVATOR_EMER_DISENGAGE", 182, "Emergency Flight Control Panel", "Right Elevator EMER DISENG Indicator (yellow)")
defineIndicatorLight("TACAN_TEST", 260, "TACAN Panel", "TACAN Test Indicator Light (green)")
definePushButton("LMFD_01", 2, 3001, 300, "Left MFCD", "OSB 1")
definePushButton("LMFD_02", 2, 3002, 301, "Left MFCD", "OSB 2")
definePushButton("LMFD_03", 2, 3003, 302, "Left MFCD", "OSB 3")
definePushButton("LMFD_04", 2, 3004, 303, "Left MFCD", "OSB 4")
definePushButton("LMFD_05", 2, 3005, 304, "Left MFCD", "OSB 5")
definePushButton("LMFD_06", 2, 3006, 305, "Left MFCD", "OSB 6")
definePushButton("LMFD_07", 2, 3007, 306, "Left MFCD", "OSB 7")
definePushButton("LMFD_08", 2, 3008, 307, "Left MFCD", "OSB 8")
definePushButton("LMFD_09", 2, 3009, 308, "Left MFCD", "OSB 9")
definePushButton("LMFD_10", 2, 3010, 309, "Left MFCD", "OSB 10")
definePushButton("LMFD_11", 2, 3011, 310, "Left MFCD", "OSB 11")
definePushButton("LMFD_12", 2, 3012, 311, "Left MFCD", "OSB 12")
definePushButton("LMFD_13", 2, 3013, 312, "Left MFCD", "OSB 13")
definePushButton("LMFD_14", 2, 3014, 313, "Left MFCD", "OSB 14")
definePushButton("LMFD_15", 2, 3015, 314, "Left MFCD", "OSB 15")
definePushButton("LMFD_16", 2, 3016, 315, "Left MFCD", "OSB 16")
definePushButton("LMFD_17", 2, 3017, 316, "Left MFCD", "OSB 17")
definePushButton("LMFD_18", 2, 3018, 317, "Left MFCD", "OSB 18")
definePushButton("LMFD_19", 2, 3019, 318, "Left MFCD", "OSB 19")
definePushButton("LMFD_20", 2, 3020, 319, "Left MFCD", "OSB 20")
defineRockerSwitch("LMFD_ADJ", 2, 3021, 3023, 3022, 3023, 320, "Left MFCD", "ADJ")
defineRockerSwitch("LMFD_DSP", 2, 3024, 3026, 3025, 3026, 321, "Left MFCD", "DSP")
defineRockerSwitch("LMFD_BRT", 2, 3027, 3029, 3028, 3029, 322, "Left MFCD", "BRT")
defineRockerSwitch("LMFD_CON", 2, 3030, 3032, 3031, 3032, 323, "Left MFCD", "CON")
defineRockerSwitch("LMFD_SYM", 2, 3033, 3035, 3034, 3035, 324, "Left MFCD", "SYM")
defineTumb("LMFD_PWR", 2, 3036, 325, 0.1, {0.0, 0.2}, nil, false, "Left MFCD", "PWR OFF - NT - DAY")
definePushButton("RMFD_01", 3, 3001, 326, "Right MFCD", "OSB 1")
definePushButton("RMFD_02", 3, 3002, 327, "Right MFCD", "OSB 2")
definePushButton("RMFD_03", 3, 3003, 328, "Right MFCD", "OSB 3")
definePushButton("RMFD_04", 3, 3004, 329, "Right MFCD", "OSB 4")
definePushButton("RMFD_05", 3, 3005, 330, "Right MFCD", "OSB 5")
definePushButton("RMFD_06", 3, 3006, 331, "Right MFCD", "OSB 6")
definePushButton("RMFD_07", 3, 3007, 332, "Right MFCD", "OSB 7")
definePushButton("RMFD_08", 3, 3008, 333, "Right MFCD", "OSB 8")
definePushButton("RMFD_09", 3, 3009, 334, "Right MFCD", "OSB 9")
definePushButton("RMFD_10", 3, 3010, 335, "Right MFCD", "OSB 10")
definePushButton("RMFD_11", 3, 3011, 336, "Right MFCD", "OSB 11")
definePushButton("RMFD_12", 3, 3012, 337, "Right MFCD", "OSB 12")
definePushButton("RMFD_13", 3, 3013, 338, "Right MFCD", "OSB 13")
definePushButton("RMFD_14", 3, 3014, 339, "Right MFCD", "OSB 14")
definePushButton("RMFD_15", 3, 3015, 340, "Right MFCD", "OSB 15")
definePushButton("RMFD_16", 3, 3016, 341, "Right MFCD", "OSB 16")
definePushButton("RMFD_17", 3, 3017, 342, "Right MFCD", "OSB 17")
definePushButton("RMFD_18", 3, 3018, 343, "Right MFCD", "OSB 18")
definePushButton("RMFD_19", 3, 3019, 344, "Right MFCD", "OSB 19")
definePushButton("RMFD_20", 3, 3020, 345, "Right MFCD", "OSB 20")
defineRockerSwitch("RMFD_ADJ", 3, 3021, 3023, 3022, 3023, 346, "Right MFCD", "ADJ")
defineRockerSwitch("RMFD_DSP", 3, 3024, 3026, 3025, 3026, 347, "Right MFCD", "DSP")
defineRockerSwitch("RMFD_BRT", 3, 3027, 3029, 3028, 3029, 348, "Right MFCD", "BRT")
defineRockerSwitch("RMFD_CON", 3, 3030, 3032, 3031, 3032, 349, "Right MFCD", "CON")
defineRockerSwitch("RMFD_SYM", 3, 3033, 3035, 3034, 3035, 350, "Right MFCD", "SYM")
defineTumb("RMFD_PWR", 3, 3036, 351, 0.1, {0.0, 0.2}, nil, false, "Right MFCD", "PWR OFF - NT - DAY")
definePushButton("CMSP_ARW1", 4, 3001, 352, "CMSP", "SET Button 1")
definePushButton("CMSP_ARW2", 4, 3002, 353, "CMSP", "SET Button 2")
definePushButton("CMSP_ARW3", 4, 3003, 354, "CMSP", "SET Button 3")
definePushButton("CMSP_ARW4", 4, 3004, 355, "CMSP", "SET Button 4")
defineRockerSwitch("CMSP_UPDN", 4, 3005, 3005, 3006, 3006, 356, "CMSP", "Cycle Program or Value Up/Down")
definePushButton("CMSP_RTN", 4, 3007, 357, "CMSP", "RTN")
defineToggleSwitch("CMSP_JTSN", 4, 3008, 358, "CMSP", "JTSN / OFF")
definePotentiometer("CMSP_BRT", 4, 3009, 359, {0.15, 0.85}, "CMSP", "Brightness")
local function defineCMSPSwitch(msg, device_id, down_command, up_command, arg_number, category, description)
local alloc = moduleBeingDefined.memoryMap:allocateInt{ maxValue = 2 }
moduleBeingDefined.exportHooks[#moduleBeingDefined.exportHooks+1] = function(dev0)
local lut = {["0.0"] = "0", ["0.1"] = "1", ["0.2"] = "2"}
alloc:setValue(lut[string.format("%.1f", dev0:get_argument_value(arg_number))])
end
document {
identifier = msg,
category = category,
description = description,
control_type = "selector",
momentary_positions = "last",
physical_variant = "toggle_switch",
inputs = {
{ interface = "set_state", max_value = 2, description = "set the switch position -- 0 = down, 1 = centered, 2 = held up" },
},
outputs = {
{ ["type"] = "integer",
suffix = "",
address = alloc.address,
mask = alloc.mask,
shift_by = alloc.shiftBy,
max_value = 2,
description = "switch position: 0 - down, 1 - center, 2 - up"
}
}
}
moduleBeingDefined.inputProcessors[msg] = function(toState)
if toState == "0" then
toState = -1
elseif toState == "1" then
toState = 0
elseif toState == "2" then
toState = 1
else
return
end
local fromState = string.format("%.1f", GetDevice(0):get_argument_value(arg_number))
local fslut = {["0.0"] = -1, ["0.1"] = 0, ["0.2"] = 1}
fromState = fslut[fromState]
local dev = GetDevice(device_id)
if fromState == 0 and toState == 1 then dev:performClickableAction(up_command, 0.2) end
if fromState == 1 and toState == 0 then dev:performClickableAction(up_command, 0.1) end
if fromState == 0 and toState == -1 then dev:performClickableAction(down_command, 0.0) end
if fromState == -1 and toState == 0 then dev:performClickableAction(down_command, 0.1) end
if fromState == -1 and toState == 1 then
dev:performClickableAction(down_command, 0.1)
dev:performClickableAction(up_command, 0.2)
end
if fromState == 1 and toState == -1 then
dev:performClickableAction(up_command, 0.1)
dev:performClickableAction(down_command, 0.0)
end
end
end
defineCMSPSwitch("CMSP_MWS", 4, 3010, 3011, 360, "CMSP", "Missile Warning System OFF - ON - (MENU)")
defineCMSPSwitch("CMSP_JMR", 4, 3012, 3013, 361, "CMSP", "Jammer OFF - ON - (MENU)")
defineCMSPSwitch("CMSP_RWR", 4, 3014, 3015, 362, "CMSP", "Radar Warning Receiver OFF - ON - (MENU)")
defineCMSPSwitch("CMSP_DISP", 4, 3016, 3017, 363, "CMSP", "Countermeasure Dispenser OFF - ON - (MENU)")
defineTumb("CMSP_MODE", 4, 3018, 364, 0.1, {0.0, 0.4}, nil, false, "CMSP", "CMSP Mode Select")
definePushButton("CMSC_JMR", 5, 3001, 365, "CMSC", "Select Jammer Program")
definePushButton("CMSC_MWS", 5, 3002, 366, "CMSC", "Select MWS Programs (No Function)")
definePushButton("CMSC_PRI", 5, 3003, 369, "CMSC", "Toggle between 5 and 16 Priority Threats Displayed")
definePushButton("CMSC_SEP", 5, 3004, 370, "CMSC", "Separate RWR Symbols")
definePotentiometer("CMSC_BRT", 5, 3006, 367, {0.15, 0.85}, "CMSC", "Adjust Display Brightness")
definePotentiometer("CMSC_RWR_VOL", 5, 3007, 368, nil, "CMSC", "Adjust RWR Volume")
defineTumb("AHCP_MASTER_ARM", 7, 3001, 375, 0.1, {0.0, 0.2}, nil, false, "AHCP", "Master Arm TRAIN - SAFE - ARM")
defineTumb("AHCP_GUNPAC", 7, 3002, 376, 0.1, {0.0, 0.2}, nil, false, "AHCP", "GUN/PAC GUNARM - SAFE - ARM")
defineTumb("AHCP_LASER_ARM", 7, 3003, 377, 0.1, {0.0, 0.2}, nil, false, "AHCP", "Laser Arm TRAIN - SAFE - ARM")
defineToggleSwitch("AHCP_TGP", 7, 3004, 378, "AHCP", "TGP OFF - ON")
defineTumb("AHCP_ALT_SCE", 7, 3005, 379, 0.1, {0.0, 0.2}, nil, false, "AHCP", "Altimeter Source RADAR - DELTA - BARO")
defineToggleSwitch("AHCP_HUD_DAYNIGHT", 7, 3006, 380, "AHCP", "Hud Mode NIGHT - DAY")
defineToggleSwitch("AHCP_HUD_MODE", 7, 3007, 381, "AHCP", "Hud Mode STBY - NORM")
defineToggleSwitch("AHCP_CICU", 7, 3008, 382, "AHCP", "CICU OFF - ON")
defineToggleSwitch("AHCP_JTRS", 7, 3009, 383, "AHCP", "JTRS OFF - ON")
defineTumb("AHCP_IFFCC", 7, 3010, 384, 0.1, {0.0, 0.2}, nil, false, "AHCP", "IFFCC OFF - TEST - ON")
definePushButton("UFC_1", 8, 3001, 385, "UFC", "1")
definePushButton("UFC_2", 8, 3002, 386, "UFC", "2")
definePushButton("UFC_3", 8, 3003, 387, "UFC", "3")
definePushButton("UFC_4", 8, 3004, 388, "UFC", "4")
definePushButton("UFC_5", 8, 3005, 389, "UFC", "5")
definePushButton("UFC_6", 8, 3006, 390, "UFC", "6")
definePushButton("UFC_7", 8, 3007, 391, "UFC", "7")
definePushButton("UFC_8", 8, 3008, 392, "UFC", "8")
definePushButton("UFC_9", 8, 3009, 393, "UFC", "9")
definePushButton("UFC_10", 8, 3010, 395, "UFC", "10")
definePushButton("UFC_SPC", 8, 3011, 396, "UFC", "SPC")
definePushButton("UFC_HACK", 8, 3012, 394, "UFC", "HACK")
definePushButton("UFC_FUNC", 8, 3013, 397, "UFC", "FUNC")
definePushButton("UFC_LTR", 8, 3014, 398, "UFC", "LTR")
definePushButton("UFC_CLR", 8, 3015, 399, "UFC", "CLR")
definePushButton("UFC_ENT", 8, 3016, 400, "UFC", "ENT")
definePushButton("UFC_MK", 8, 3017, 401, "UFC", "MK")
definePushButton("UFC_ALT_ALRT", 8, 3018, 402, "UFC", "ALT ALRT")
defineRockerSwitch("UFC_STEER", 8, 3020, 3020, 3021, 3021, 405, "UFC", "STEER Up/Down")
defineRockerSwitch("UFC_DATA", 8, 3022, 3022, 3023, 3023, 406, "UFC", "DATA Up/Down")
defineRockerSwitch("UFC_SEL", 8, 3024, 3024, 3025, 3025, 407, "UFC", "SEL Up/Down")
defineRockerSwitch("UFC_DEPR", 8, 3026, 3026, 3027, 3027, 408, "UFC", "DEPR Up/Down")
defineRockerSwitch("UFC_INTEN", 8, 3028, 3028, 3029, 3029, 409, "UFC", "INTEN Incr/Decr")
definePushButton("UFC_NA1", 8, 3030, 531, "UFC", "No Function 1")
definePushButton("UFC_NA2", 8, 3031, 532, "UFC", "No Function 2")
definePushButton("UFC_NA3", 8, 3032, 533, "UFC", "No Function 3")
definePushButton("UFC_NA4", 8, 3033, 534, "UFC", "No Function 4")
definePushButton("UFC_NA5", 8, 3034, 535, "UFC", "No Function 5")
definePushButton("UFC_NA6", 8, 3035, 536, "UFC", "No Function 6")
definePushButton("UFC_MASTER_CAUTION", 24, 3001, 403, "UFC", "Master Caution Reset")
definePushButton("GEAR_HORN_SILENCE", 24, 3003, 127, "Landing Gear and Flap Control Panel", "Landing Gear Horn Silence")
definePushButton("CDU_LSK_3L", 9, 3001, 410, "CDU", "LSK 3L")
definePushButton("CDU_LSK_5L", 9, 3002, 411, "CDU", "LSK 5L")
definePushButton("CDU_LSK_7L", 9, 3003, 412, "CDU", "LSK 7L")
definePushButton("CDU_LSK_9L", 9, 3004, 413, "CDU", "LSK 9L")
definePushButton("CDU_LSK_3R", 9, 3005, 414, "CDU", "LSK 3R")
definePushButton("CDU_LSK_5R", 9, 3006, 415, "CDU", "LSK 5R")
definePushButton("CDU_LSK_7R", 9, 3007, 416, "CDU", "LSK 7R")
definePushButton("CDU_LSK_9R", 9, 3008, 417, "CDU", "LSK 9R")
definePushButton("CDU_SYS", 9, 3009, 418, "CDU", "SYS")
definePushButton("CDU_NAV", 9, 3010, 419, "CDU", "NAV")
definePushButton("CDU_WP", 9, 3011, 420, "CDU", "WP")
definePushButton("CDU_OSET", 9, 3012, 421, "CDU", "OSET")
definePushButton("CDU_FPM", 9, 3013, 422, "CDU", "FPM")
definePushButton("CDU_PREV", 9, 3014, 423, "CDU", "PREV")
definePushButton("CDU_1", 9, 3015, 425, "CDU", "1")
definePushButton("CDU_2", 9, 3016, 426, "CDU", "2")
definePushButton("CDU_3", 9, 3017, 427, "CDU", "3")
definePushButton("CDU_4", 9, 3018, 428, "CDU", "4")
definePushButton("CDU_5", 9, 3019, 429, "CDU", "5")
definePushButton("CDU_6", 9, 3020, 430, "CDU", "6")
definePushButton("CDU_7", 9, 3021, 431, "CDU", "7")
definePushButton("CDU_8", 9, 3022, 432, "CDU", "8")
definePushButton("CDU_9", 9, 3023, 433, "CDU", "9")
definePushButton("CDU_0", 9, 3024, 434, "CDU", "0")
definePushButton("CDU_POINT", 9, 3025, 435, "CDU", "Decimal Point")
definePushButton("CDU_SLASH", 9, 3026, 436, "CDU", "Slash")
definePushButton("CDU_A", 9, 3027, 437, "CDU", "A")
definePushButton("CDU_B", 9, 3028, 438, "CDU", "B")
definePushButton("CDU_C", 9, 3029, 439, "CDU", "C")
definePushButton("CDU_D", 9, 3030, 440, "CDU", "D")
definePushButton("CDU_E", 9, 3031, 441, "CDU", "E")
definePushButton("CDU_F", 9, 3032, 442, "CDU", "F")
definePushButton("CDU_G", 9, 3033, 443, "CDU", "G")
definePushButton("CDU_H", 9, 3034, 444, "CDU", "H")
definePushButton("CDU_I", 9, 3035, 445, "CDU", "I")
definePushButton("CDU_J", 9, 3036, 446, "CDU", "J")
definePushButton("CDU_K", 9, 3037, 447, "CDU", "K")
definePushButton("CDU_L", 9, 3038, 448, "CDU", "L")
definePushButton("CDU_M", 9, 3039, 449, "CDU", "M")
definePushButton("CDU_N", 9, 3040, 450, "CDU", "N")
definePushButton("CDU_O", 9, 3041, 451, "CDU", "O")
definePushButton("CDU_P", 9, 3042, 452, "CDU", "P")
definePushButton("CDU_Q", 9, 3043, 453, "CDU", "Q")
definePushButton("CDU_R", 9, 3044, 454, "CDU", "R")
definePushButton("CDU_S", 9, 3045, 455, "CDU", "S")
definePushButton("CDU_T", 9, 3046, 456, "CDU", "T")
definePushButton("CDU_U", 9, 3047, 457, "CDU", "U")
definePushButton("CDU_V", 9, 3048, 458, "CDU", "V")
definePushButton("CDU_W", 9, 3049, 459, "CDU", "W")
definePushButton("CDU_X", 9, 3050, 460, "CDU", "X")
definePushButton("CDU_Y", 9, 3051, 461, "CDU", "Y")
definePushButton("CDU_Z", 9, 3052, 462, "CDU", "Z")
definePushButton("CDU_NA1", 9, 3053, 464, "CDU", "No Function 1")
definePushButton("CDU_NA2", 9, 3054, 465, "CDU", "No Function 2")
definePushButton("CDU_MK", 9, 3055, 466, "CDU", "MK")
definePushButton("CDU_BCK", 9, 3056, 467, "CDU", "BCK")
definePushButton("CDU_SPC", 9, 3057, 468, "CDU", "SPC")
definePushButton("CDU_CLR", 9, 3058, 470, "CDU", "CLR")
definePushButton("CDU_FA", 9, 3059, 471, "CDU", "FA")
defineRockerSwitch("CDU_BRT", 9, 3060, 3060, 3061, 3061, 424, "CDU", "CDU Display Brightness Adjustment")
defineRockerSwitch("CDU_PG", 9, 3062, 3062, 3063, 3063, 463, "CDU", "PG Rocker")
defineRockerSwitch("CDU_SCROLL", 9, 3064, 3064, 3065, 3065, 469, "CDU", "Scroll Waypoint Names (Blank Rocker)")
defineRockerSwitch("CDU_DATA", 9, 3066, 3066, 3067, 3067, 472, "CDU", "+/- Rocker")
defineTumb("AAP_STEERPT", 22, 3001, 473, 0.1, {0.0, 0.2}, nil, false, "AAP", "STEERPT FLTPLAN - MARK - MISSION")
defineRockerSwitch("AAP_STEER", 22, 3003, 3003, 3002, 3002, 474, "AAP", "Toggle Steerpoint")
defineTumb("AAP_PAGE", 22, 3004, 475, 0.1, {0.0, 0.3}, nil, false, "AAP", "PAGE OTHER - POSITION - STEER - WAYPT")
defineToggleSwitch("AAP_CDUPWR", 22, 3005, 476, "AAP", "CDU Power")
defineToggleSwitch("AAP_EGIPWR", 22, 3006, 477, "AAP", "EGI Power")
definePushButton("CLOCK_SET", 15, 3001, 68, "Digital Clock", "Clock SET")
definePushButton("CLOCK_CTRL", 15, 3002, 69, "Digital Clock", "Clock CTRL")
local lastClockData = nil
moduleBeingDefined.exportHooks[#moduleBeingDefined.exportHooks+1] = function()
lastClockData = parse_indication(4)
end
local function getClockHH()
if not lastClockData then return " " end
return lastClockData.txtHours or " "
end
local function getClockMM()
if not lastClockData then return " " end
return lastClockData.txtMinutes or " "
end
local function getClockSS()
if not lastClockData then return " " end
return lastClockData.txtSeconds or " "
end
local function getClockETC()
if not lastClockData then return " " end
return (lastClockData.txtET or " ") .. (lastClockData.txtC or " ")
end
defineString("CLOCK_HH", getClockHH, 2, "Digital Clock", "Clock Hours (or two spaces)")
defineString("CLOCK_MM", getClockMM, 2, "Digital Clock", "Clock Minutes (or two spaces)")
defineString("CLOCK_SS", getClockSS, 2, "Digital Clock", "Clock Seconds (or two spaces)")
defineString("CLOCK_ETC", getClockETC, 3, "Digital Clock", "Clock ETC display ('ET ', ' C', or three spaces)")
defineToggleSwitch("FSCP_EXT_TANKS_WING", 36, 3001, 106, "Fuel System Control Panel", "External Wing Tanks Boost Pumps")
defineToggleSwitch("FSCP_EXT_TANKS_FUS", 36, 3002, 107, "Fuel System Control Panel", "External Fuselage Tanks Boost Pumps")
defineToggleSwitch("FSCP_TK_GATE", 36, 3003, 108, "Fuel System Control Panel", "TK Gate")
defineToggleSwitch("FSCP_CROSSFEED", 36, 3004, 109, "Fuel System Control Panel", "Crossfeed")
defineToggleSwitch("FSCP_BOOST_WING_L", 36, 3005, 110, "Fuel System Control Panel", "Boost Pumps Left Wing")
defineToggleSwitch("FSCP_BOOST_WING_R", 36, 3006, 111, "Fuel System Control Panel", "Boost Pumps Right Wing")
defineToggleSwitch("FSCP_BOOST_MAIN_L", 36, 3007, 112, "Fuel System Control Panel", "Boost Pumps Main Fuselage Left")
defineToggleSwitch("FSCP_BOOST_MAIN_R", 36, 3008, 113, "Fuel System Control Panel", "Boost Pumps Main Fuselage Right")
defineToggleSwitch("FSCP_AMPL", 36, 3009, 114, "Fuel System Control Panel", "Signal Amplifier NORM - OVERRIDE")
definePushButton("FSCP_LINE_CHECK", 36, 3010, 115, "Fuel System Control Panel", "Line Check")
definePushButton("FSCP_FD_WING_L", 36, 3012, 117, "Fuel System Control Panel", "Fill Disable Wing Left")
definePushButton("FSCP_FD_WING_R", 36, 3013, 118, "Fuel System Control Panel", "Fill Disable Wing Right")
definePushButton("FSCP_FD_MAIN_L", 36, 3014, 119, "Fuel System Control Panel", "Fill Disable Main Left")
definePushButton("FSCP_FD_MAIN_R", 36, 3015, 120, "Fuel System Control Panel", "Fill Disable Main Right")
defineToggleSwitch("FSCP_RCVR_LEVER", 36, 3016, 121, "Fuel System Control Panel", "Aerial Refueling Slipway Control Lever")
definePushButton("FQIS_TEST", 36, 3018, 646, "Fuel Panel", "Fuel Gauge Test")
defineTumb("FQIS_SELECT", 36, 3017, 645, 0.1, {0.0, 0.4}, nil, false, "Fuel Panel", "Fuel Display Selector")
defineToggleSwitch("ENGINE_FUEL_FLOW_L", 37, 3001, 122, "Throttle", "Fuel Flow L")
defineToggleSwitch("ENGINE_FUEL_FLOW_R", 37, 3002, 123, "Throttle", "Fuel Flow R")
defineRockerSwitch("ENGINE_OPER_L", 37, 3003, 3003, 3007, 3007, 124, "Throttle", "ENG OPER L")
defineRockerSwitch("ENGINE_OPER_R", 37, 3004, 3004, 3008, 3008, 125, "Throttle", "ENG OPER R")
defineToggleSwitch("ENGINE_APU_START", 37, 3005, 126, "Throttle", "APU START")
definePotentiometer("ENGINE_THROTTLE_FRICTION", 37, 3006, 128, nil, "Throttle", "Friction Control")
definePushButton("ENGINE_TEMS_DATA", 37, 3009, 652, "Landing Gear and Flap Control Panel", "TEMS Data")
defineTumb("LASTE_AP_MODE", 38, 3001, 132, 1, {-1, 1}, nil, false, "LASTE Panel", "AP MODE")
definePushButton("LASTE_AP_TOGGLE", 38, 3002, 131, "LASTE Panel", "Autopilot Engage/Disengage")
defineElectricallyHeldSwitch("LASTE_EAC", 38, 3026, 3027, 129, "LASTE Panel", "EAC On/Off")
defineToggleSwitch("LASTE_RDR_ALTM", 67, 3001, 130, "LASTE Panel", "Radar Altimeter")
defineElectricallyHeldSwitch("SASP_YAW_SAS_L", 38, 3003, 3004, 185, "SAS Panel", "Yaw SAS Left OFF - ENGAGE")
defineElectricallyHeldSwitch("SASP_YAW_SAS_R", 38, 3005, 3006, 186, "SAS Panel", "Yaw SAS Right OFF - ENGAGE")
defineElectricallyHeldSwitch("SASP_PITCH_SAS_L", 38, 3007, 3008, 187, "SAS Panel", "Pitch SAS Left OFF - ENGAGE")
defineElectricallyHeldSwitch("SASP_PITCH_SAS_R", 38, 3009, 3010, 188, "SAS Panel", "Pitch SAS Right OFF - ENGAGE")
defineTumb("SASP_MONITOR_TEST", 38, 3011, 189, 1, {-1, 1}, nil, false, "SAS Panel", "Monitor Test Left/Right")
definePushButton("SASP_TO_TRIM", 38, 3012, 190, "SAS Panel", "T/O Trim Button")
definePotentiometer("SASP_YAW_TRIM", 38, 3013, 192, {-1, 1}, "SAS Panel", "Yaw Trim")
defineToggleSwitch("EFCP_SPDBK_EMER_RETR", 38, 3015, 174, "Emergency Flight Control Panel", "Speed Brake Emergency Retract")
defineToggleSwitch("EFCP_TRIM_OVERRIDE", 38, 3016, 175, "Emergency Flight Control Panel", "Pitch/Roll Trim Override EMER - NORM")
defineTumb("EFCP_EMER_TRIM", 38, 3025, 176, 0.1, {0.0, 0.4}, nil, false, "Emergency Flight Control Panel", "Emergency Trim CENTER - NOSE DN - RWD - NOSE UP - LWD")
moduleBeingDefined.inputProcessors["EFCP_EMER_TRIM"] = function(args)
local currentState = tonumber(string.format("%1.1f", GetDevice(0):get_argument_value(176)):sub(3))
if args == "INC" then
args = tostring(currentState + 1)
if args == "5" then args = "0" end
elseif args == "DEC" then
args = tostring(currentState - 1)
if args == "-1" then args = "4" end
end
if args == "0" then
GetDevice(38):performClickableAction(3025, 0)
elseif args == "1" then
GetDevice(38):performClickableAction(3025, 0)
GetDevice(38):performClickableAction(3017, 0.1)
elseif args == "2" then
GetDevice(38):performClickableAction(3025, 0)
GetDevice(38):performClickableAction(3018, 0.2)
elseif args == "3" then
GetDevice(38):performClickableAction(3025, 0)
GetDevice(38):performClickableAction(3019, 0.3)
elseif args == "4" then
GetDevice(38):performClickableAction(3025, 0)
GetDevice(38):performClickableAction(3020, 0.4)
end
end
defineTumb("EFCP_AILERON_EMER_DISENGAGE", 38, 3021, 177, 1, {-1, 1}, nil, false, "Emergency Flight Control Panel", "Aileron Emergency Disengage LEFT - OFF - RIGHT")
defineTumb("EFCP_ELEVATOR_EMER_DISENGAGE", 38, 3022, 180, 1, {-1, 1}, nil, false, "Emergency Flight Control Panel", "Elevator Emergency Disengage LEFT - OFF - RIGHT")
defineToggleSwitch("EFCP_FLAPS_EMER_RETR", 38, 3023, 183, "Emergency Flight Control Panel", "Flaps Emergency Retract")
defineToggleSwitch("EFCP_MRFCS", 38, 3024, 184, "Emergency Flight Control Panel", "Manual Reversion Flight Control System MAN REVERSION - NORM")
defineToggleSwitch("EPP_APU_GEN_PWR", 1, 3001, 241, "Electrical Power Panel", "APU GEN PWR")
defineTumb("EPP_INVERTER", 1, 3002, 242, 1, {-1, 1}, nil, false, "Electrical Power Panel", "Inverter TEST - OFF - STBY")
defineToggleSwitch("EPP_AC_GEN_PWR_L", 1, 3004, 244, "Electrical Power Panel", "AC GEN PWR Left")
defineToggleSwitch("EPP_AC_GEN_PWR_R", 1, 3005, 245, "Electrical Power Panel", "AC GEN PWR Right")
defineToggleSwitch("EPP_BATTERY_PWR", 1, 3006, 246, "Electrical Power Panel", "Battery Power")
defineToggleSwitch("EPP_EMER_FLOOD", 49, 3007, 243, "Electrical Power Panel", "Emergency Flood Light")
defineToggleSwitch("GEAR_LEVER", 39, 3001, 716, "Landing Gear and Flap Control Panel", "Gear Lever DOWN - UP")
definePushButton("DOWNLOCK_OVERRIDE", 39, 3003, 651, "Landing Gear and Flap Control Panel", "Downlock Override Button")
defineTumb("FLAPS_SWITCH", 39, 3002, 773, 0.5, {0.0, 1.0}, nil, false, "Throttle", "Flaps Setting DN - MVR - UP")
defineElectricallyHeldSwitch("ANTI_SKID_SWITCH", 38, 3028, 3029, 654, "Landing Gear and Flap Control Panel", "Anti-Skid Switch")
definePushButton("NMSP_HARS_BTN", 46, 3001, 605, "NMSP", "HARS Button")
defineIndicatorLight("NMSP_HARS_LED", 606, "NMSP", "HARS Button LED (green)")
definePushButton("NMSP_EGI_BTN", 46, 3002, 607, "NMSP", "EGI Button")
defineIndicatorLight("NMSP_EGI_LED", 608, "NMSP", "EGI Button LED (green)")
definePushButton("NMSP_TISL_BTN", 46, 3003, 609, "NMSP", "TISL Button (No Function)")
defineIndicatorLight("NMSP_TISL_LED", 610, "NMSP", "TISL Button LED (green)")
definePushButton("NMSP_STEERPT_BTN", 46, 3004, 611, "NMSP", "STEERPT Button")
defineIndicatorLight("NMSP_STEERPT_LED", 612, "NMSP", "STEERPT Button LED (green)")
definePushButton("NMSP_ANCHR_BTN", 46, 3005, 613, "NMSP", "ANCHR Button")
defineIndicatorLight("NMSP_ANCHR_LED", 614, "NMSP", "ANCHR Button LED (green)")
definePushButton("NMSP_TCN_BTN", 46, 3006, 615, "NMSP", "TCN Button")
defineIndicatorLight("NMSP_TCN_LED", 616, "NMSP", "TCN Button LED (green)")
definePushButton("NMSP_ILS_BTN", 46, 3007, 617, "NMSP", "ILS Button")
defineIndicatorLight("NMSP_ILS_LED", 618, "NMSP", "ILS Button LED (green)")
defineToggleSwitch("NMSP_ABLE_STOW", 46, 3008, 621, "NMSP", "Able/Stow Localizer Bars")
defineTumb("TISL_MODE", 57, 3001, 622, 0.1, {0.0, 0.4}, nil, false, "TISL Panel", "TISL Mode")
defineTumb("TISL_SLANT_RANGE", 57, 3002, 623, 1, {-1, 1}, nil, false, "TISL Panel", "Slant Range UNDER 5 - 5 - 10")
defineTumb("TISL_ALT_10000", 57, 3003, 624, 0.1, {0, 1}, {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}, "skiplast", "TISL Panel", "Altitude Above Target, 10000 ft")
defineTumb("TISL_ALT_1000", 57, 3004, 626, 0.1, {0, 1}, {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}, "skiplast", "TISL Panel", "Altitude Above Target, 1000 ft")
defineTumb("TISL_CODE1", 57, 3005, 636, 0.05, {0, 1}, {"0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "0"}, "skiplast", "TISL Panel", "Code Wheel 1")
defineTumb("TISL_CODE2", 57, 3006, 638, 0.05, {0, 1}, {"0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "0"}, "skiplast", "TISL Panel", "Code Wheel 2")
defineTumb("TISL_CODE3", 57, 3007, 640, 0.05, {0, 1}, {"0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "0"}, "skiplast", "TISL Panel", "Code Wheel 3")
defineTumb("TISL_CODE4", 57, 3008, 642, 0.05, {0, 1}, {"0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "0"}, "skiplast", "TISL Panel", "Code Wheel 4")
defineTumb("TISL_AUX", 57, 3009, 644, 1, {-1, 1}, nil, false, "TISL Panel", "TISL AUX Switch")
definePushButton("TISL_ENTER", 57, 3010, 628, "TISL Panel", "TISL ENTER")
definePushButton("TISL_BITE", 57, 3011, 632, "TISL Panel", "TISL BITE")
definePushButton("EXT_STORES_JETTISON", 12, 3001, 101, "Glare Shield", "External Stores Jettison Button")
definePushButton("LAMP_TEST_BTN", 24, 3002, 197, "Auxiliary Light Control Panel", "Signal Lights Test")
defineToggleSwitch("GND_SAFE_OVERRIDE_COVER", 12, 3002, 709, "Misc", "Ground Safety Override Switch Cover")
defineToggleSwitch("GND_SAFE_OVERRIDE", 12, 3003, 710, "Misc", "Ground Safety Override")
defineFixedStepTumb("IFF_CODE", 43, 3007, 199, 0.1, {0.0, 0.3}, {1, -1}, nil, "IFF", "IFF Code: ZERO - B - A - (HOLD)")
defineTumb("IFF_MASTER", 43, 3008, 200, 0.1, {0, 0.4}, nil, true, "IFF", "IFF Master: OFF - STBY - LOW - NORM - EMER")
define3PosTumb("IFF_OUT_AUDIO_LIGHT", 43, 3009, 201, "IFF", "IFF Out: LIGHT - OFF - AUDIO")
defineTumb("IFF_TEST_M1", 43, 3010, 202, 1, {-1, 1}, nil, true, "IFF", "Test M-1")
defineTumb("IFF_TEST_M2", 43, 3011, 203, 1, {-1, 1}, nil, true, "IFF", "Test M-2")
defineTumb("IFF_TEST_M3", 43, 3012, 204, 1, {-1, 1}, nil, true, "IFF", "Test M-3")
defineTumb("IFF_TEST_M4", 43, 3013, 205, 1, {-1, 1}, nil, true, "IFF", "Test M-4")
defineTumb("IFF_RADTEST", 43, 3014, 206, 1, {-1, 1}, nil, true, "IFF", "RAD Test/Mon")
defineTumb("IFF_MIC_IDENT", 43, 3015, 207, 1, {-1, 1}, nil, true, "IFF", "Ident/Mic")
defineToggleSwitch("IFF_ON_OUT", 43, 3016, 208, "IFF", "IFF On/Out")
defineTumb("IFF_MODE1_WHEEL1", 43, 3001, 209, 0.1, {0.0, 0.7}, nil, true, "IFF", "Mode-1 Wheel 1")
defineTumb("IFF_MODE1_WHEEL2", 43, 3002, 210, 0.1, {0.0, 0.3}, nil, true, "IFF", "Mode-1 Wheel 2")
defineTumb("IFF_MODE3A_WHEEL1", 43, 3003, 211, 0.1, {0.0, 0.7}, nil, true, "IFF", "Mode-3A Wheel 1")
defineTumb("IFF_MODE3A_WHEEL2", 43, 3004, 212, 0.1, {0.0, 0.7}, nil, true, "IFF", "Mode-3A Wheel 2")
defineTumb("IFF_MODE3A_WHEEL3", 43, 3005, 213, 0.1, {0.0, 0.7}, nil, true, "IFF", "Mode-3A Wheel 3")
defineTumb("IFF_MODE3A_WHEEL4", 43, 3006, 214, 0.1, {0.0, 0.7}, nil, true, "IFF", "Mode-3A Wheel 4")
definePushButton("IFF_REPLY_TEST", 43, 3017, 795, "IFF", "REPLY Push to Test")
definePotentiometer("IFF_REPLY_DIM", 43, 3020, 900, {0.0, 1.0}, "IFF", "IFF Reply Dim")
definePushButton("IFF_TEST_TEST", 43, 3018, 796, "IFF", "TEST Push to Test")
definePotentiometer("IFF_TEST_DIM", 43, 3021, 901, {0.0, 1.0}, "IFF", "TEST Reply Dim")
defineTumb("OXY_EMERGENCY", 40, 3003, 601, 1, {-1, 1}, nil, false, "Oxygen Regulator Panel", "Oxygen Flow: Emergency / Normal / Test")
defineToggleSwitch("OXY_DILUTER", 40, 3002, 602, "Oxygen Regulator Panel", "Oxygen Normal/100%")
defineToggleSwitch("OXY_SUPPLY", 40, 3001, 603, "Oxygen Regulator Panel", "Oxygen Supply On/Off")
defineFloat("OXY_PRESS", 604, {0, 1}, "Oxygen Regulator Panel", "Oxygen Pressure Indicator")
defineIndicatorLight("OXY_FLOW", 600, "Oxygen Regulator Panel", "Flow Indicator (on/off) (white)")
defineFloat("OXY_VOLUME", 274, {0, 1}, "Environment Control Panel", "Oxygen Volume (0 to 5 liters)")
defineFloat("CABIN_PRESS_ALT", 281, {0, 1}, "Environment Control Panel", "Cabin Pressure Altitude")
definePushButton("ENVCP_OXY_TEST", 41, 3001, 275, "Environment Control Panel", "Oxygen Indicator Test")
defineToggleSwitch("ENVCP_WINDSHIELD_DEFOG", 41, 3002, 276, "Environment Control Panel", "Windshield Defog/Deice")
definePotentiometer("ENVCP_CANOPY_DEFOG", 41, 3003, 277, {0.0, 1.0}, "Environment Control Panel", "Canopy Defog")
define3PosTumb("ENVCP_WRRW", 41, 3004, 278, "Environment Control Panel", "Windshield Rain Removal/Wash")
defineToggleSwitch("ENVCP_PITOT_HEAT", 41, 3005, 279, "Environment Control Panel", "Pitot Heat")
defineToggleSwitch("ENVCP_BLEED_AIR", 41, 3006, 280, "Environment Control Panel", "Bleed Air")
define3PosTumb("ENVCP_TEMP_PRESS", 41, 3007, 282, "Environment Control Panel", "Temperature/Pressure Control")
local dummyAlloc = moduleBeingDefined.memoryMap:allocateInt { maxValue = 7 }
defineToggleSwitch("ENVCP_AIR_SUPPLY", 41, 3008, 283, "Environment Control Panel", "Main Air Supply")
definePotentiometer("ENVCP_FLOW_LEVEL", 41, 3009, 284, {0.0, 1.0}, "Environment Control Panel", "Flow Level")
definePotentiometer("ENVCP_TEMP_LEVEL", 41, 3013, 286, {0.0, 1.0}, "Environment Control Panel", "Temp Level Control")
defineTumb("ENVCP_AC_OPER", 41, 3010, 285, 0.1, {0.0, 0.3}, nil, false, "Environment Control Panel", "Air Conditioner MAN/AUTO/COLD/HOT")
do
local function breaker(msg, command, arg_number, description)
definePushButton(msg, 1, command, arg_number, "Circuit Breaker Panel", description.." Circuit Breaker")
end
local breakers = {
"AILERON DISC L",
"AILERON DISC R",
"SPS RUDDER AUTH LIM",
"ELEVATION DISC L",
"ELEVATION DISC R",
"AILERON TAB L",
"AILERON TAB R",
"EMER FLAP",
"EMER TRIM",
"GEAR",
"ENG START L",
"ENG START R",
"APU CONT",
"ENG IGNITOR 1",
"ENG IGNITOR 2",
"FUEL SHUTOFF L",
"FUEL SHUTOFF R",
"DC FUEL PUMP",
"BLEED AIR CONT L",
"BLEED AIR CONT R",
"EXT STORES JETT 1",
"EXT STORES JETT 2",
"STBY ATT IND",
"MASTER CAUTION",
"PITOT HEAT AC",
"IFF",
"UHF",
"INTERCOM",
"GEN CONT L",
"GEN CONT R",
"CONVERTER L",
"AUX ESS BUS 0A",
"AUX ESS BUS 0B",
"AUX ESS BUS 0C",
"BAT BUS TRANS",
"INVERTER PWR",
"INVERTER CONT",
"AUX ESS BUS TIE"
}
for k, v in ipairs(breakers) do
breaker("CBP_"..v:gsub(" ", "_"), 3006 + k, 665 + k, v)
end
end
defineRotary("ALT_SET_PRESSURE", 35, 3001, 62, "Altimeter", "Set Pressure")
defineRockerSwitch("ALT_ELECT_PNEU", 62, 3002, 3002, 3001, 3001, 60, "Altimeter", "ELECT / PNEU")
defineTumb("LCP_POSITION", 49, 3008, 287, 1, {-1, 1}, nil, false, "Light System Control Panel", "Position Lights FLASH/OFF/STEADY")
-- skip 3 bits in the memory map to preserve backwards compatibility:
local dummyAlloc = moduleBeingDefined.memoryMap:allocateInt{ maxValue = 7 }
definePotentiometer("LCP_FORMATION", 49, 3009, 288, {0, 1}, "Light System Control Panel", "Formation Lights")
defineElectricallyHeldSwitch("LCP_ANTICOLLISION", 49, 3010, 3011, 289, "Light System Control Panel", "Anticollision Lights")
definePotentiometer("LCP_ENG_INST", 49, 3001, 290, {0, 1}, "Light System Control Panel", "Engine Instrument Lights")
defineToggleSwitch("LCP_NOSE_ILLUM", 49, 3012, 291, "Light System Control Panel", "Nose Illumination")
definePotentiometer("LCP_FLIGHT_INST", 49, 3002, 292, {0, 1}, "Light System Control Panel", "Flight Instrument Lights")
definePotentiometer("LCP_AUX_INST", 49, 3003, 293, {0, 1}, "Light System Control Panel", "Aux Instrument Lights")
defineToggleSwitch("LCP_SIGNAL_LIGHTS", 49, 3013, 294, "Light System Control Panel", "Signal Lights")
defineToggleSwitch("LCP_ACCEL_COMP", 49, 3004, 295, "Light System Control Panel", "Accelerometer and Compass Lights")
definePotentiometer("LCP_FLOOD", 49, 3005, 296, {0, 1}, "Light System Control Panel", "Flood Lights")
definePotentiometer("LCP_CONSOLE", 49, 3006, 297, {0, 1}, "Light System Control Panel", "Console Lights")
define3PosTumb1("LANDING_LIGHTS", 49, 3014, 655, "Landing Gear and Flap Control Panel", "Landing Lights TAXI/OFF/LAND")
definePotentiometer("ALCP_RSIL", 49, 3015, 193, {0, 1}, "Auxiliary Light Control Panel", "Refuel Status Indexer Lights")
definePotentiometer("ALCP_WPNSTA", 49, 3016, 195, {0, 1}, "Auxiliary Light Control Panel", "Weapon Station Lights (No Function)")
define3PosTumb1("ALCP_NVIS_LTS", 49, 3017, 194, "Auxiliary Light Control Panel", "Nightvision Lights")
definePotentiometer("ALCP_RCVR_LTS", 49, 3018, 116, {0, 1}, "Auxiliary Light Control Panel", "Refueling Lighting Dial")
defineToggleSwitch("ALCP_HARSSAS", 38, 3031, 196, "Auxiliary Light Control Panel", "HARS-SAS Override/Norm")
definePushButton("ALCP_FDBA_TEST", 24, 3004, 198, "Auxiliary Light Control Panel", "Fire Detect Bleed Air Test")
defineToggleSwitch("FIRE_LENG_PULL", 50, 3001, 102, "Glare Shield", "Left Engine Fire T-Handle")
defineToggleSwitch("FIRE_APU_PULL", 50, 3002, 103, "Glare Shield", "APU Fire T-Handle")
defineToggleSwitch("FIRE_RENG_PULL", 50, 3003, 104, "Glare Shield", "Right Engine Fire T-Handle")
define3PosTumb1("FIRE_EXT_DISCH", 50, 3004, 105, "Glare Shield", "Fire Extinguisher Discharge Left/Off/Right")
defineVariableStepTumb("HSI_CRS_KNOB", 45, 3002, 44, 1.0, "HSI", "Course Select Knob")
defineVariableStepTumb("HSI_HDG_KNOB", 45, 3001, 45, 1.0, "HSI", "Heading Select Knob")
definePotentiometer("ADI_PITCH_TRIM", 47, 3001, 22, {-0.5, 0.5}, "ADI", "ADI Pitch Trim")
definePushButton("SAI_CAGE", 48, 3002, 67, "Standby Attitude Indicator", "Cage SAI")
definePotentiometer("SAI_PITCH_TRIM", 48, 3003, 66, {-1, 1}, "Standby Attitude Indicator", "SAI Pitch Trim")
defineString("TACAN_CHANNEL", getTacanChannel, 4, "TACAN Panel", "TACAN Channel")
definePushButton("TACAN_TEST_BTN", 74, 3004, 259, "TACAN Panel", "TACAN Test Button")
definePotentiometer("TACAN_VOL", 74, 3005, 261, {0, 1}, "TACAN Panel", "TACAN Signal Volume")
defineFixedStepTumb("TACAN_10", 74, 3001, 256, 0.1, {0, 1}, {-0.1, 0.1}, nil, "TACAN Panel", "Left Channel Selector")
defineFixedStepTumb("TACAN_1", 74, 3002, 257, 0.1, {0, 1}, {-0.1, 0.1}, nil, "TACAN Panel", "Right Channel Selector")
defineToggleSwitch("TACAN_XY", 74, 3003, 258, "TACAN Panel", "TACAN Channel X/Y Toggle")
local docentry = moduleBeingDefined.documentation["TACAN Panel"]["TACAN_1"]
docentry.inputs[#docentry.inputs+1] = { interface = "action", argument = "TOGGLE_XY", description = "Toggle TACAN Channel X/Y" }
local oldInputHandler = moduleBeingDefined.inputProcessors["TACAN_1"]
moduleBeingDefined.inputProcessors["TACAN_1"] = function(args)
if args == "TOGGLE_XY" then
if GetDevice(0):get_argument_value(266) == 0 then
GetDevice(74):performClickableAction(3003, 1)
else
GetDevice(74):performClickableAction(3003, 0)
end
else
oldInputHandler(args)
end
end
defineTumb("TACAN_MODE", 74, 3006, 262, 0.1, {0.0, 0.4}, nil, false, "TACAN Panel", "TACAN Mode Dial")
definePotentiometer("STALL_VOL", 52, 3001, 704, nil, "Stall System Volume Controls", "Stall Volume")
definePotentiometer("STALL_PEAK_VOL", 52, 3002, 705, nil, "Stall System Volume Controls", "Peak Volume")
defineToggleSwitch("ILS_PWR", 53, 3001, 247, "ILS Panel", "ILS Power")
defineSetCommandTumb("ILS_MHZ", 53, 3002, 248, 0.1, {0.0, 0.3}, {"108", "109", "110", "111"}, false, "ILS Panel", "ILS Frequency MHz")
defineSetCommandTumb("ILS_KHZ", 53, 3003, 249, 0.1, {0.0, 0.9}, {"10", "15", "30", "35", "50", "55", "70", "75", "90", "95"}, false, "ILS Panel", "ILS Frequency KHz")
definePotentiometer("ILS_VOL", 53, 3004, 250, {0, 1}, "ILS Panel", "ILS Volume")