forked from s-d-a/DCS-ExportScripts
/
Mirage-F1CE.lua
2344 lines (1973 loc) · 85 KB
/
Mirage-F1CE.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
-- Mirage-F1CE
-- Symbols
-- https://www.i2symbol.com/symbols/
-- https://emojipedia.org/check-mark/
-- https://unicode-table.com/en/sets/arrow-symbols/
ExportScript.FoundDCSModule = true
ExportScript.Version.Mirage_F1CE = "1.2.1"
ExportScript.ConfigEveryFrameArguments =
{
--[[
every frames arguments
based of "mainpanel_init.lua"
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
[DeviceID] = "Format"
[4] = "%.4f", <- floating-point number with 4 digits after point
[19] = "%0.1f", <- floating-point number with 1 digit after point
[129] = "%1d", <- decimal number
[5] = "%.f", <- floating point number rounded to a decimal number
]]
}
ExportScript.ConfigArguments =
{
--[[
arguments for export in low tick interval
based on "clickabledata.lua"
]]
[0] = "%.4f", -- mirrors_draw
[1] = "%.4f", -- Canopy open/close
[2] = "%.4f", -- Mirrors
[3] = "%.4f", -- Canopy hinged handle
-- Unused <4-9>
[10] = "%.4f", -- Seat height position
[11] = "%.1f", -- Seat height adjustment control
[12] = "%.4f", -- Seat separation handle
[13] = "%.4f", -- Face blind firing handle
[14] = "%.4f", -- Alternative firing handle
[15] = "%.4f", -- Seat belt visibility
-- Unused <16-21>
[22] = "%.4f", -- Stick pitch
[23] = "%.4f", -- Stick roll
[24] = "%.4f", -- Trim roll
[25] = "%.4f", -- Trim pitch
[27] = "%0.1f", -- Stick Safety
[28] = "%0.1f", -- Stick weapon release
[29] = "%0.1f", -- Stick thumb button
[30] = "%0.1f", -- Stick side button
[31] = "%0.1f", -- Stick autopilot disconnect trigger
[34] = "%.4f", -- Stick visibility
-- Unused <35-51>
[52] = "%.4f", -- Rudder
[53] = "%.4f", -- Rudder brakes
[54] = "%.1f", -- Brake chute control
[55] = "%0.1f", -- Canopy lock control
[56] = "%0.1f", -- Canopy embrittle control
-- Unused <57-61>
[62] = "%.4f", -- Chronometer seconds hand
[63] = "%.4f", -- Chronometer minutes hand
[64] = "%.4f", -- Chronometer hours hand
[65] = "%.4f", -- Chronometer minutes timer
[66] = "%.4f", -- Map light rheostat
[67] = "%.4f", -- Chronometer starting control and clock winding/setting knob
[68] = "%.4f", -- Miscellaneous instrument integral lighting rheostat
-- Unused <69-75>
[76] = "%.4f",
[77] = "%.4f",
[78] = "%.4f",
[79] = "%.4f",
-- Unused <80-83>
[84] = "%0.1f", -- Emergency/Parking brake handle
[85] = "%1d", -- U/C safety lever
[86] = "%1d", -- U/C control lever
[87] = "%0.1f", -- Anti-retraction override button
[88] = "%0.1f", -- Hydraulic pressure selector switch
[89] = "%0.1f", -- Servo reset button
[90] = "%0.1f", -- Yaw/Anti-slip switch
[91] = "%0.1f", -- Pitch switch
[92] = "%0.1f", -- Standby receptacle light
[94] = "%0.1f", -- ARTHUR selector switch guard
[95] = "%0.1f", -- Stick uncouple switch guard
[96] = "%0.1f", -- ARTHUR selector switch
[97] = "%0.1f", -- Stick uncouple switch
[98] = "%0.1f", -- Incidence test switch
-- Unused <100-106>
[107] = "%0.1f", -- Emergency U/C handle
[108] = "%0.1f", -- Cannons too hot light
[111] = "%0.1f", -- Navigation light control
[112] = "%0.1f", -- Formation light control
[113] = "%0.1f", -- Battery switch
[114] = "%0.1f", -- Alternator 1 switch
[115] = "%0.1f", -- Alternator 2 switch
[116] = "%0.1f", -- TR reset button
[117] = "%0.1f", -- Inverter selector switch
[118] = "%0.1f", -- Failure warning panel T test button
[119] = "%0.1f", -- Failure warning panel O2 test button
[121] = "%0.1f", -- Warning Panel Light
[122] = "%0.1f", -- Warning Panel Light
[123] = "%0.1f", -- Warning Panel Light
[124] = "%0.1f", -- Warning Panel Light
[125] = "%0.1f", -- Warning Panel Light
[126] = "%0.1f", -- Warning Panel Light
[127] = "%0.1f", -- Warning Panel Light
[128] = "%0.1f", -- Warning Panel Light
[129] = "%0.1f", -- Warning Panel Light
[130] = "%0.1f", -- Warning Panel Light
[131] = "%0.1f", -- Warning Panel Light
[132] = "%0.1f", -- Warning Panel Light
[133] = "%0.1f", -- Warning Panel Light
[134] = "%0.1f", -- Warning Panel Light
[135] = "%0.1f", -- Warning Panel Light
[136] = "%0.1f", -- Warning Panel Light
[137] = "%0.1f", -- Warning Panel Light
[138] = "%0.1f", -- Warning Panel Light
[139] = "%0.1f", -- Warning Panel Light
[140] = "%0.1f", -- Warning Panel Light
[141] = "%0.1f", -- Warning Panel Light
[142] = "%0.1f", -- Warning Panel Light
[143] = "%0.1f", -- Warning Panel Light
[144] = "%0.1f", -- Warning Panel Light
[145] = "%0.1f", -- Warning Panel Light
[146] = "%0.1f", -- Warning Panel Light
[147] = "%0.1f", -- Warning Panel Light
[148] = "%0.1f", -- Warning Panel Light
[149] = "%0.1f", -- Warning Panel Light
[150] = "%0.1f", -- Warning Panel Light
[151] = "%0.1f", -- Warning Panel Light
[152] = "%0.1f", -- Warning Panel Light
-- Unused <153-193>
[194] = "%0.1f", -- Jammer detection light
[196] = "%0.1f", -- Jammer detection light brightness animation
[197] = "%0.1f", -- (C + M or SW) R light
[199] = "%0.1f", -- (C + M or SW) R light brightness animation
[200] = "%0.1f", -- Incidence indicator flag
[201] = "%0.1f", -- Incidence indicator lighting rheostat
[203] = "%0.2f", -- Incidence indicator aoa
-- Unused <204-207>
[208] = "%0.1f", -- Chaff/flares selector switch
[209] = "%0.2f", -- Program selector switch
[210] = "%0.1f", -- Chaff 10s rotary
[211] = "%0.1f", -- Chaff 1s rotary
[212] = "%0.1f", -- Chaff counter reset button
[213] = "%0.1f", -- Flares 10s rotary
[214] = "%0.1f", -- Flares 1s rotary
[215] = "%0.1f", -- Flares counter reset button
[216] = "%0.1f", -- Emergency jettisoning switch
[217] = "%.4f", -- Accelerometer max
[218] = "%.4f", -- Accelerometer current
[219] = "%.4f", -- Accelerometer min
-- Unused <220-227>
[228] = "%.4f",
-- Unused <229-230>
[231] = "%.4f", -- Clock winding/setting lever
[233] = "%.4f", -- Canopy seal valve control lever
[234] = "%.4f", -- Throttle
[235] = "%.4f", -- Throttle Thumb rocker
[239] = "%0.1f", -- Throttle cut/idle switch
[240] = "%.4f", -- In-flight relight control
-- Unused <241-247>
[248] = "%0.1f", -- Slat/Flap lever
-- Unused <249>
[257] = "%0.1f", -- Radar control stick scan selection
[258] = "%0.2f", -- Radar control stick scale selection
[259] = "%0.1f", -- Radar control stick elevation/altitude difference button
-- Unused <260-269>
[271] = "%0.1f", -- UHF test light
[272] = "%0.1f", -- Test selector switch
[273] = "%0.1f", -- SIL switch
[274] = "%0.1f", -- V/UHF Frequency select thumbwheel - Hundreds
[275] = "%0.1f", -- V/UHF Frequency select thumbwheel - Tens
[276] = "%0.1f", -- V/UHF Frequency select thumbwheel - Units
[277] = "%0.1f", -- V/UHF Frequency select thumbwheel - Tenths
[278] = "%.2f", -- V/UHF Frequency select thumbwheel - Thousandths
-- Unused <279>
[280] = "%.2f", -- Function selector
[281] = "%0.1f", -- 25W - 5W switch
[282] = "%0.1f", -- Frequency selector switch
[283] = "%0.2f", -- V/UHF Channel Selector
-- Unused <284-285>
-- Unused <288-305>
[306] = "%.4f", -- MISS potentiometer
[307] = "%.4f", -- TAC potentiometer
[308] = "%.4f", -- VOR potentiometer
[309] = "%0.1f", -- AMPLI 2-1 selector switch
[310] = "%.4f", -- U + V pushbutton
[311] = "%.4f", -- U + V pushbutton rotation
[312] = "%0.1f", -- U + V pushbutton light
[313] = "%.4f", -- U pushbutton
[314] = "%.4f", -- U pushbutton rotation
[315] = "%0.1f", -- U pushbutton light
[316] = "%.4f", -- RAP + CME pushbutton
[317] = "%.4f", -- RAP + CME pushbutton rotation
[318] = "%0.1f", -- RAP + CME pushbutton light
[319] = "%.4f", -- MKR + TP pushbutton
[320] = "%.4f", -- MKR + TP pushbutton rotation
[321] = "%0.1f", -- MKR + TP pushbutton light
-- Unused <322-339>
[340] = "%0.1f", -- 5W/25W selector switch
[341] = "%0.1f", -- Squelch switch
[342] = "%0.1f", -- Test selector switch
[343] = "%.4f", -- CDE button (not used)
[344] = "%.2f", -- UHF Function selector
[345] = "%.1f", -- UHF Test light
[348] = "%.2f", -- UHF Channel selector
[349] = "%.4f", -- IFF numbers
-- Unused <350>
[351] = "%.4f",
[352] = "%.4f",
[353] = "%.4f", -- Landing light control
[354] = "%.4f", -- Emergency regulation light
[356] = "%0.1f",-- Emergency regulation light brightness animation
[357] = "%0.1f", -- Emergency regulation switch guard
[358] = "%0.1f", -- Emergency regulation switch
[359] = "%.4f", -- Emergency regulation control lever
[360] = "%.4f", -- Telemeter/zone scanning switch
[361] = "%.4f", -- (C + M or SW) R deselection switch
-- Unused <362-367>
[368] = "%0.1f", -- Flight control test restart button
[369] = "%0.1f", -- Flight control test switch guard
[370] = "%0.1f", -- Flight control test switch
[374] = "%0.1f", -- Start button cover
[375] = "%0.1f", -- Start button
[376] = "%0.1f", -- Ignition/Ventilation selector switch
[377] = "%0.1f", -- Starting pump switch
[378] = "%0.1f", -- R/H LP pump switch
[379] = "%0.1f", -- L/H LP pump switch
[380] = "%0.1f", -- LP main cock switch guard
[381] = "%0.1f", -- LP main cock switch
[382] = "%0.1f", -- Day/Night selector switch
[383] = "%.4f", -- Light and panel lighting rheostat
[384] = "%.4f", -- Ultraviolet lighting rheostat
[385] = "%.4f", -- Dual instrument panel lighting rheostat (Floodlights)
[386] = "%.4f", -- Dual instrument panel lighting rheostat (Integral)
[387] = "%.4f", -- Dual console and pedestal lighting rheostat (Floodlights)
[388] = "%.4f", -- Dual console and pedestal lighting rheostat (Integral)
-- Unused <389-395>
[396] = "%0.1f", -- JPT emergency regulation switch
[397] = "%0.1f", -- A/B main cock switch guard
[398] = "%0.1f", -- A/B main cock switch
[399] = "%0.1f", -- High-lift device selector switch
-- Unused <400-401>
[402] = "%0.1f", -- Anti-skid (SPAD) switch guard
[403] = "%0.1f", -- Anti-skid (SPAD) switch
-- Unused <404>
[405] = "%.4f", -- Alternative PTT
[406] = "%0.1f", -- Rudder trim control switch
-- Unused <407>
[408] = "%0.1f", -- ANTENNA-GYRO switch
[410] = "%0.1f", -- Ram air switch guard
-- Unused <409>
[411] = "%0.1f", -- Ram air switch
[412] = "%0.1f", -- Demist switch
-- Unused <413-431>
[432] = "%0.1f", -- Armament master switch guard
[433] = "%0.1f", -- Armament master switch
-- Unused <434-469>
[470] = "%0.1f", -- Miscellaneous instrument lighting switch
-- Unused <471>
[474] = "%0.1f", -- Standby horizon switch
[475] = "%0.1f", -- Electro-pump switch
[476] = "%0.1f", -- Warning horn switch
[477] = "%0.1f", -- Probe heater switch
[478] = "%0.1f", -- Radar detector switch
[479] = "%.4f", -- Search light control
[480] = "%0.1f", -- TACAN test button
[481] = "%0.1f", -- TACAN X/Y mode display
[482] = "%0.1f", -- TACAN 100s display
[483] = "%0.1f", -- TACAN 10s mode display
[484] = "%0.1f", -- TACAN 1s mode display
[485] = "%.f", -- TACAN X/Y mode selector
[486] = "%0.4f", -- TACAN X/Y rotation animation
[487] = "%0.2f", -- TACAN mode selector
[488] = "%0.4f", -- TACAN 10s rotation animation
-- Unused <489-497>
[498] = "%0.1f", -- VOR-ILS control unit Xxx.xx
[499] = "%0.1f", -- VOR-ILS control unit xXx.xx
[500] = "%0.1f", -- VOR-ILS control unit xxX.xx
[501] = "%0.1f", -- VOR-ILS control unit xxx.Xx
[502] = "%0.1f", -- VOR-ILS control unit xxx.xX
[503] = "%0.1f", -- VOR-ILS control unit ON/OFF selector
[504] = "%0.4f", -- VOR-ILS control unit ON/OFF selector rotation animation
[505] = "%0.1f", -- VOR-ILS control unit test selector
[506] = "%0.4f", -- VOR-ILS control unit test selector rotation animation
-- Unused <507-515>
[516] = "%.4f", -- Oxygen needle
[517] = "%0.1f", -- Oxygen test button (T button)
[518] = "%.4f", -- Pilot oxygen indicator
[519] = "%0.1f", -- Pilot oxygen test button
-- Unused <220-523>
[524] = "%0.1f", -- Emergency cold switch
[525] = "%0.1f", -- Master valve control switch
[527] = "%.4f", -- Temperature control needle
[527] = "%.4f", -- Temperature control rheostat
[528] = "%.4f", -- Hot/Cold selector needle
[529] = "%0.1f", -- Auto/Manual selector switch
[530] = "%0.1f", -- Hot/Cold selector switch
[537] = "%0.1f", -- Heading and vertical reference system control switch
[538] = "%0.1f", -- Emergency gyromagnetic compass switch
[539] = "%.4f",
[540] = "%0.1f", -- Heading control unit erection button
[541] = "%0.1f", -- Omnibearing selector Heading control unit Xxx
[542] = "%0.1f", -- Omnibearing selector Heading control unit xXx
[543] = "%0.1f", -- Omnibearing selector Heading control unit xxX
[544] = "%.4f", -- VOR-ILS/OFF/TACAN selector
[545] = "%.4f", -- Omnibearing selector
[547] = "%.4f", -- Heading selection knob
[548] = "%0.1f", -- CB Gyro control unit power supply
[550] = "%0.1f", -- CB High-lift device servo unit power supply
[552] = "%0.1f", -- CB Indicator and failure detector power supply
[554] = "%0.1f", -- CB Inverter transfer unit power supply and control
[556] = "%0.1f", -- CB Dual hydraulic pressure gauge power supply
[558] = "%0.1f", -- CB Gun firing trigger power supply
[560] = "%0.1f", -- CB LP cock power supply
[562] = "%0.1f", -- CB Electro-pump relay power supply
[564] = "%0.1f", -- CB Flight refuelling system power supply
[566] = "%0.1f", -- CB Cabin pressurization system power supply
[568] = "%0.1f", -- CB Inverter 28 V power supply
[570] = "%0.1f", -- CB U/C normal operation power supply
[572] = "%0.1f", -- CB V/UHF power supply
[574] = "%0.1f", -- CB Starter and sequencing system power supply
[576] = "%0.1f", -- CB Refuelling probe control power supply
[578] = "%0.1f", -- CB Manual trim control power supply
[580] = "%0.1f", -- CB Valve position repeater, control valve and ground mode power supply
[582] = "%0.1f", -- CB Failure warning panel and master failure warning light power supply
[584] = "%0.1f", -- CB Configuration indicator (U/C section) and U/C warning light power supply
[586] = "%0.1f", -- CB IFF power supply
[588] = "%0.1f", -- CB Emergency regulation system and control lever power supply
-- Unused <589>
[590] = "%0.1f", -- Sight selector
[591] = "%0.1f", -- Firing fuel dipper switch
[592] = "%0.1f", -- Bomb/Rocket selector
[593] = "%0.1f", -- MATRA 550 or Sidewinder missile switch
[594] = "%0.1f", -- Fore/Aft selector switch
[595] = "%0.1f", -- Auto/Manual firing selector switch
[596] = "%0.1f", -- Single/Salvo selector
[597] = "%0.1f", -- Instantaneous/Delay/Safe selector switch
[598] = "%0.1f", -- Radar selector
[599] = "%0.1f", -- Radar emergency transmission button
[600] = "%0.1f", -- Radar 4 lines/1 line scan switch
[601] = "%0.1f", -- R 530 Missile Normal/Altitude difference selector switch
[602] = "%0.1f", -- Armament panel lights test
[603] = "%0.1f", -- Normal/Jammer pursuit switch (No function)
[604] = "%0.1f", -- EXT G Left MATRA R550 or sidewinder missile pushbutton
[605] = "%0.1f", -- EXT G Left MATRA R550 or sidewinder missile pushbutton light
[606] = "%0.1f", -- EXT D Left or fuselage MATRA R530 missile pushbutton
[607] = "%0.1f", -- EXT D Left or fuselage MATRA R530 missile pushbutton light
[608] = "%0.1f", -- CAN A Air to air pushbutton
[609] = "%0.1f", -- CAN A Air to air pushbutton light
[610] = "%0.1f", -- BOMB VOIL Wing bombs pushbutton
[611] = "%0.1f", -- BOMB VOIL Wing bombs pushbutton light
[612] = "%0.1f", -- EXT D Right MATRA R550 or sidewinder missile pushbutton
[613] = "%0.1f", -- EXT D Right MATRA R550 or sidewinder missile pushbutton light
[614] = "%0.1f", -- EXT D Right MATRA R530 missile pushbutton
[615] = "%0.1f", -- EXT D Right MATRA R530 missile pushbutton light
[616] = "%0.1f", -- CAN S ROQ Air to ground guns or rockets pushbutton
[617] = "%0.1f", -- CAN S ROQ Air to ground guns or rockets pushbutton light
[618] = "%0.1f", -- Fuselage bombs pushbutton
[619] = "%0.1f", -- Fuselage bombs pushbutton light
-- Unused <620-631>
[632] = "%0.2f", -- Indicator light brightness
[633] = "%0.2f", -- Strobe brightness
[634] = "%0.2f", -- Distance markers brightness
[635] = "%0.2f", -- Horizon and radial velocity marker brightness
[636] = "%0.2f", -- Horizon symbol vertical position
[708] = "%0.1f", -- Chaff/flares release button
[709] = "%0.1f", -- N-100%-EMG mode selector switch
[710] = "%0.1f", -- Oxygen overpressure button
[712] = "%0.1f", -- Anti-g connection cover
[713] = "%0.1f", -- Anti-g test button
[714] = "%0.1f", -- Anti-g valve cock
[719] = "%.4f", -- Pilot Oxygen Breath Pressure Indicator
[721] = "%.4f", -- Hydraulic 1 needle
[722] = "%.4f", -- Hydraulic 2 needle
[723] = "%.4f", -- Rudder trim indicator
[724] = "%.4f", -- Roll trim indicator
[725] = "%.4f", -- Pitch trim indicator
[726] = "%.4f", -- Cockpit pressurisation indicator needle
-- Unused <727-731>
[732] = "%0.3f", -- Mode 1 coding tens selector
[733] = "%0.3f", -- Mode 1 coding units selector
[734] = "%0.3f", -- Mode 3A coding thousands selector
[735] = "%0.3f", -- Mode 3A coding hundreds selector
[736] = "%0.3f", -- Mode 3A coding tens selector
[737] = "%0.3f", -- Mode 3A coding units selector
[738] = "%0.1f", -- IFF test button
[739] = "%0.2f", -- Function selector switch
[740] = "%0.1f", -- IFF Monitoring light press
[741] = "%.4f", -- IFF Monitoring light rotate
[742] = "%0.1f", -- IFF Monitoring light brightness
[743] = "%0.2f", -- Mode 4 selector switch
[744] = "%0.2f", -- Position identification selector
[745] = "%0.1f", -- IFF mode 4 switch
[746] = "%0.1f", -- IFF fault light
[747] = "%.4f", -- IFF Fault light rotate
[748] = "%0.1f", -- IFF Fault light brightness
[749] = "%0.1f", -- AUDIO-LIGHT switch
[750] = "%0.1f", -- M-1 mode switch
[751] = "%0.1f", -- M-2 mode switch
[752] = "%0.1f", -- M-3 mode switch
[753] = "%0.1f", -- M-4 mode switch
[754] = "%0.1f", -- Shock-cone manual control switch
[755] = "%0.1f", -- Shock-cone pushbutton
[756] = "%1d", -- Nose wheel steering high sensitivity button
[757] = "%0.1f", -- Nose wheel steering switch guard
[758] = "%0.1f", -- Nose wheel steering switch
-- Unused <759>
[760] = "%0.1f", -- AUTO/MAN intensity selector switch
[761] = "%0.1f", -- Lighting selector switch
[762] = "%.4f", --
[763] = "%.4f", --
[764] = "%.4f", --
[765] = "%.4f", --
[766] = "%.4f", -- Manual gravity drop selection Mrad Xxx
[767] = "%.4f", -- Manual gravity drop selection Mrad xXx
[768] = "%.4f", -- Manual gravity drop selection Mrad xxX
[769] = "%0.1f", -- Manual gravity drop selection thumbwheel
[770] = "%0.1f", -- Fixed Reticle intensity rheostat
[771] = "%0.1f", -- Moving and Target Reticles intensity rheostat
[772] = "%0.1f", -- Attitude Reticle intensity rheostat
[773] = "%0.1f", -- Sight system test button
[774] = "%0.4f", -- Exposure time repeater
[775] = "%0.1f", -- Overrun select thumbwheel
[776] = "%0.1f", -- Sight camera test switch
[777] = "%0.1f", -- 5/16 PPS framing rate selector switch
[836] = "%0.1f", -- Radar test button
[837] = "%.4f", -- Scope intensity adjustment
[838] = "%.1f", -- Radar function selection
[839] = "%.4f", -- Storage adjustment
[840] = "%.4f", -- Scope erasing
[841] = "%.4f", -- Scope turney thingie, Polaroid screen adjustment
[842] = "%0.1f", -- Scope HA Light
[843] = "%0.1f", -- Scope IC Light
[844] = "%0.1f", -- Scope TL Light
[845] = "%0.1f", -- Scope BZ Light
[846] = "%0.1f", -- Scope TS Light
[847] = "%0.1f", -- Scope V1 Light
[848] = "%0.1f", -- Scope V2 Light
[849] = "%0.1f", -- Scope DC Light
[850] = "%0.1f", -- Scope PR Light
[851] = "%0.1f", -- Scope AC Light
[852] = "%0.1f", -- Scope DB Light
[853] = "%0.1f", -- Scope yellow Light
[854] = "%0.1f", -- Scope green Light
[855] = "%0.1f", -- Scope red Light
[856] = "%0.1f", -- Scope 7 Light
[857] = "%0.1f", -- Scope 15 Light
[858] = "%0.1f", -- Scope 35 Light
[859] = "%0.1f", -- Scope 60 Light
[860] = "%0.1f", -- Scope AP Light
[861] = "%0.1f", -- Scope TCH Light
[862] = "%0.1f", -- Scope EMI Light
[863] = "%0.1f", -- Scope PNE Light
[864] = "%0.1f", -- Radar cover remove toggle
[865] = "%.4f", -- Scope left/right animation
[866] = "%.4f", -- Scope up/down animation
-- Unused <867-919>
[920] = "%.4f", -- Master failure warning light
[921] = "%0.1f", -- Master failure warning light warning brightness
[923] = "%0.1f", -- Master failure warning light caution brightness
[928] = "%.4f", -- U/C light
[929] = "%0.1f", -- U/C light brightness
[932] = "%.4f", -- Limit warning light + Horn
[933] = "%0.1f", -- Limit warning light + Horn brightness
[937] = "%0.1f", -- Fire warning light (ENG/AB) + Horn top brightness
[940] = "%.4f", -- Fire warning light (ENG/AB) + Horn
[941] = "%0.1f", -- Fire warning light (ENG/AB) + Horn bottom brightness
[944] = "%0.1f", -- Airbrake light press
[945] = "%.4f", -- Airbrake light twist
[946] = "%0.1f", -- Airbrake light light
[950] = "%0.1f", -- Nose wheel steering light press
[951] = "%.4f", -- Nose wheel steering light twist
[952] = "%0.1f", -- Nose wheel steering light light
[956] = "%0.1f", -- Combat flaps light press
[957] = "%.4f", -- Combat flaps light twist
[958] = "%0.1f", -- Combat flaps light light
[962] = "%0.1f", -- MATRA 550 or Sidewinder jettison button guard
[963] = "%0.1f", -- MATRA 550 or Sidewinder jettison button
[966] = "%0.1f", -- Emergency jettison button guard
[967] = "%0.1f", -- Emergency jettison button
[968] = "%0.1f", -- Selective jettison button guard
[969] = "%0.1f", -- Selective jettison button
[970] = "%0.1f", -- Jettisoning selector switch
[973] = "%0.1f", -- Autopilot control and indicator unit test button
[974] = "%0.1f", -- Autopilot PA button
[975] = "%0.1f", -- Autopilot PA button P light
[976] = "%0.1f", -- Autopilot PA button A light
[977] = "%0.1f", -- Autopilot ALT button
[978] = "%0.1f", -- Autopilot ALT button green light
[979] = "%0.1f", -- Autopilot ALT button red light
[980] = "%0.1f", -- Autopilot CAP button
[981] = "%0.1f", -- Autopilot CAP button light
[982] = "%0.1f", -- Autopilot R button
[983] = "%0.1f", -- Autopilot R button left red light
[984] = "%0.1f", -- Autopilot R button top red light
[985] = "%0.1f", -- Autopilot R button bottom green light
[986] = "%0.1f", -- Autopilot R button right red light
[987] = "%0.1f", -- Autopilot G button
[988] = "%0.1f", -- Autopilot G button left red light
[989] = "%0.1f", -- Autopilot G button top red light
[990] = "%0.1f", -- Autopilot G button bottom red green light
[991] = "%0.1f", -- Autopilot G button right green light
[992] = "%0.1f", -- Autopilot intensity control
[1021] = "%.4f", -- Mach airspeed cone needle
[1023] = "%.4f", -- Mach/Airspeed window and needle
[1025] = "%.4f", -- Vertical speed needle
[1027] = "%.4f", -- RPM thousands needle
[1028] = "%.4f", -- Engine temp needle
[1029] = "%0.1f", -- A/B INJ light
[1030] = "%0.1f", -- A/B INJ light brightness
[1031] = "%0.1f", -- A/B ON light
[1032] = "%0.1f", -- A/B ON light brightness
[1033] = "%0.1f", -- A/B SRL light
[1034] = "%0.1f", -- A/B SRL light brightness
[1043] = "%.4f", -- Altitude Needle
[1044] = "%0.1f", -- Altitude window flag
[1045] = "%0.1f", -- Altitude window Xx.xxx
[1046] = "%0.1f", -- Altitude window xX.xxx
[1047] = "%0.1f", -- Altitude window xx.Xxx
[1048] = "%0.1f", -- Altitude window xx.xXX
[1049] = "%0.1f", -- Slaved altimeter barometric pressure Xxxx
[1050] = "%0.1f", -- Slaved altimeter barometric pressure xXxx
[1051] = "%0.1f", -- Slaved altimeter barometric pressure xxXx
[1052] = "%0.1f", -- Slaved altimeter barometric pressure xxxX
[1053] = "%0.1f", -- Slaved altimeter barometric pressure setting knob
[1065] = "%.4f", -- Standby altimeter hundreds needle
[1066] = "%.4f", -- Standby altimeter thousands needle
[1067] = "%.4f", -- Standby altimeter tenthousands altitude needle
[1068] = "%0.1f", -- Standby altimeter barometric pressure Xxxx
[1069] = "%0.1f", -- Standby altimeter barometric pressure xXxx
[1070] = "%0.1f", -- Standby altimeter barometric pressure xxXx
[1071] = "%0.1f", -- Standby altimeter barometric pressure xxxX
[1072] = "%0.1f", -- Standby altimeter barometric pressure setting knob
[1081] = "%0.1f", -- BIP button
[1082] = "%0.1f", -- Configuration indicator test button
[1083] = "%0.1f", -- Slat green light
[1084] = "%0.1f", -- Slat yellow light
[1085] = "%0.1f", -- Slat red light
[1086] = "%0.1f", -- Flap red light
[1087] = "%0.1f", -- Flap yellow light
[1088] = "%0.1f", -- Flap green light
[1089] = "%0.1f", -- Fren light
[1090] = "%0.1f", -- U/C left green light
[1091] = "%0.1f", -- U/C transit red light
[1092] = "%0.1f", -- U/C center green light
[1093] = "%0.1f", -- U/C right green light
[1106] = "%.4f", -- Engine RPM hundreds needle
[1108] = "%.4f", -- Spherical indicator pitch bar
[1109] = "%.4f", -- Spherical indicator roll bar
[1110] = "%.4f", -- Spherical indicator pitch
[1111] = "%.4f", -- Spherical indicator roll
[1112] = "%.4f", -- Spherical indicator heading
[1113] = "%.4f", -- Spherical indicator coordination ball
[1115] = "%0.1f", -- Spherical indicator flag
[1116] = "%0.1f", -- Spherical indicator day/night selector switch
[1117] = "%0.1f", -- Spherical indicator pole setting and marker beacon light test
[1128] = "%.4f", -- Standby horizon roll
[1129] = "%.4f", -- Standby horizon angle of bank
[1130] = "%.4f", -- Standby horizon aircraft indicator
[1131] = "%.4f", -- Standby horizon flag
[1132] = "%.4f", -- Standby horizon uncage and aircraft model control
[1133] = "%.4f", -- Standby horizon control knob
[1134] = "%.4f", -- Standby horizon pitch
[1142] = "%0.1f", -- Fuel gauge G left
[1143] = "%0.1f", -- Fuel gauge D right
[1144] = "%0.1f", -- Feeder tank/Fuselage selector switch
[1145] = "%0.1f", -- Fuel gauge test button
[1146] = "%0.1f", -- Fuel quantity Xxxx
[1147] = "%0.1f", -- Fuel quantity xXxx
[1148] = "%0.1f", -- Fuel quantity xxXx
[1149] = "%0.1f", -- Fuel quantity xxxX
[1150] = "%.4f", -- Fuel quantity reset thumbwheel
[1151] = "%0.1f", -- Crossfeed switch
[1152] = "%0.1f", -- Emergency transfer switch
[1153] = "%0.1f", -- Fuel transfer sequence selector switch
[1154] = "%0.1f", -- Fuel transfer sequence 4 left
[1155] = "%0.1f", -- Fuel transfer sequence 2
[1156] = "%0.1f", -- Fuel transfer sequence 4 right
[1157] = "%0.1f", -- Fuel transfer sequence tank left
[1158] = "%0.1f", -- Fuel transfer sequence tank right
[1159] = "%0.1f", -- Fuel transfer sequence 1 left
[1160] = "%0.1f", -- Fuel transfer sequence tank center
[1161] = "%0.1f", -- Fuel transfer sequence 1 right
[1162] = "%0.1f", -- Fuel transfer sequence 3 left
[1163] = "%0.1f", -- Fuel transfer sequence 3 right
[1164] = "%0.1f", -- Fuel transfer sequence 5 left
[1165] = "%0.1f", -- Fuel transfer sequence 5 right
[1166] = "%0.1f", -- Fuel transfer indicator test
[1189] = "%.4f", -- HSI heading
[1190] = "%.4f", -- HSI heading bug
[1191] = "%.4f", -- HSI needle 2
[1192] = "%.4f", -- HSI needle 1
[1193] = "%.4f", -- HSI distance Xxx
[1194] = "%.4f", -- HSI distance xXx
[1195] = "%.4f", -- HSI distance xxX
[1196] = "%.4f", -- HSI distance flag
[1197] = "%.4f", -- HSI bearing Xxx
[1198] = "%.4f", -- HSI bearing xXx
[1199] = "%.4f", -- HSI bearing xxX
[1200] = "%.4f", -- HSI distance Xxx
[1201] = "%.4f", -- HSI distance xXx
[1202] = "%.4f", -- HSI distance xxX
[1203] = "%0.1f", -- HSI flag left
[1204] = "%0.2f", -- HSI Mode selector switch
[1205] = "%0.1f", -- HSI Normal/Additional vector selector switch
[1206] = "%0.1f", -- HSI Additional target selector switch
[1207] = "%0.1f", -- HSI bearing/distance selector knob
[1208] = "%.4f", -- HSI Test button
[1228] = "%.4f", --
[1229] = "%.4f", -- RWR red button 1 twist
[1230] = "%0.1f", -- RWR red button 1 light
[1231] = "%.4f", --
[1232] = "%.4f", -- RWR red button 2 twist
[1233] = "%0.1f", -- RWR red button 2 light
[1234] = "%.4f", --
[1235] = "%.4f", -- RWR red button 3 twist
[1236] = "%0.1f", -- RWR red button 3 light
[1237] = "%0.1f", -- Indicator light intensity adjusting switch and lights 'T' test button
[1238] = "%0.1f", -- Radar detector indicator test switch
[1239] = "%0.1f", -- RWR arrow top
[1240] = "%0.1f", -- RWR arrow left
[1241] = "%0.1f", -- RWR arrow right
[1242] = "%0.1f", -- RWR arrow down
[1270] = "%.4f", -- Mach/Airspeed indicator reference airspeed knob
[1288] = "%0.1f", -- Accelerometer reset button and rheostat
[1294] = "%.4f", -- Instrument backlighting
[1300] = "%0.1f", -- AoA lighting red
[1301] = "%0.1f", -- AoA lighting yellow
[1302] = "%0.1f", -- AoA lighting green
[1309] = "%.4f", -- Canopy Light Move
[1315] = "%.4f", -- TO/FROM Indicator
[1316] = "%.4f", -- Ejection handle safety pin
[1318] = "%.4f", -- Airspeed something window
}
-----------------------------
-- HIGH IMPORTANCE EXPORTS --
-- done every export event --
-----------------------------
-- Pointed to by ProcessIkarusDCSHighImportance
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
end
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
--ExportScript.DeviceMetaTableLogDump(mainPanelDevice) -- comment this to prevent log flooding
--ExportScript.ListIndicationLogDump(mainPanelDevice) -- comment this to prevent log flooding
ExportScript.VorIlsTacanOmnibearing(mainPanelDevice)
ExportScript.CockpitInstruments(mainPanelDevice)
ExportScript.qfeCalculator(mainPanelDevice)
ExportScript.clockTimer(mainPanelDevice)
ExportScript.Radios(mainPanelDevice)
ExportScript.AutopilotLightLogic(mainPanelDevice)
ExportScript.WeaponPushbuttonLogic(mainPanelDevice)
ExportScript.GearSlatLogic(mainPanelDevice)
ExportScript.EngineRestartLogic(mainPanelDevice)
ExportScript.CountermeasureReadouts(mainPanelDevice)
ExportScript.AoaIndicator(mainPanelDevice)
ExportScript.AccelerometerReadout(mainPanelDevice)
ExportScript.HsiReadouts(mainPanelDevice)
ExportScript.DepressionAngleTables(mainPanelDevice)
ExportScript.FlowBlinker(mainPanelDevice)
ExportScript.OxygenIndicator(mainPanelDevice)
ExportScript.ChuteLimitLogic(mainPanelDevice)
ExportScript.MaxCeiling(mainPanelDevice)
ExportScript.AlternatorEnvelope(mainPanelDevice)
ExportScript.DecentReadout(mainPanelDevice)
ExportScript.MaxAirspeed(mainPanelDevice)
ExportScript.TrimReadout(mainPanelDevice)
ExportScript.RadarCalculators(mainPanelDevice)
ExportScript.ClimbSchedulesReadout(mainPanelDevice)
ExportScript.FuelCalculator(mainPanelDevice)
ExportScript.IffPanel(mainPanelDevice)
ExportScript.BaroPressureConverter(mainPanelDevice)
end
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
end
-----------------------------
-- Custom functions --
-----------------------------
function ExportScript.BaroPressureConverter(mainPanelDevice)
-- Altimeter Pressure window
local altBaroPress_Xxxx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1049) * 10, 0)
local altBaroPress_xXxx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1050) * 10, 0)
local altBaroPress_xxXx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1051) * 10, 0)
local altBaroPress_xxxX = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1052) * 10, 0)
if altBaroPress_Xxxx > 9 then altBaroPress_Xxxx = 0 end
if altBaroPress_xXxx > 9 then altBaroPress_xXxx = 0 end
if altBaroPress_xxXx > 9 then altBaroPress_xxXx = 0 end
if altBaroPress_xxxX > 9 then altBaroPress_xxxX = 0 end
--result is millibar
local altBaroPressMb = altBaroPress_Xxxx .. altBaroPress_xXxx .. altBaroPress_xxXx .. altBaroPress_xxxX
-- convert to mmhg
local altBaroPressMmhg = string.format("%.2f", altBaroPressMb / 1.333)
-- Convert to inhg
local altBaroPressInhg = string.format("%.2f", altBaroPressMb / 33.864)
ExportScript.Tools.SendData(8079, 'Pressure'
.. '\n' .. altBaroPressMb .. " mbar"
.. '\n' .. round(altBaroPressMmhg,0) .. ' mmhg'
.. '\n' .. altBaroPressInhg .. ' inhg')
end
function ExportScript.IffPanel(mainPanelDevice)
local mode1_10s = {[0.000]="0",[0.125]="1",[0.250]="2",[0.375]="3",[0.500]="4",[0.625]="5",[0.750]="6",[0.875]="7",[1.000]="0"}
mode1_10s = mode1_10s[ExportScript.Tools.round(mainPanelDevice:get_argument_value(732), 3)]
local mode1_1s = {[0.000]="0",[0.125]="1",[0.250]="2",[0.375]="3",[0.500]="4",[0.625]="5",[0.750]="6",[0.875]="7",[1.000]="0"}
mode1_1s = mode1_1s[ExportScript.Tools.round(mainPanelDevice:get_argument_value(733), 3)]
local mode1 = mode1_10s .. mode1_1s
ExportScript.Tools.SendData(8076, 'IFF M1\n' .. mode1_10s .. mode1_1s)
local mode3A1000s = {[0.000]="0",[0.125]="1",[0.250]="2",[0.375]="3",[0.500]="4",[0.625]="5",[0.750]="6",[0.875]="7",[1.000]="0"}
mode3A1000s = mode3A1000s[ExportScript.Tools.round(mainPanelDevice:get_argument_value(734), 3)]
local mode3A100s = {[0.000]="0",[0.125]="1",[0.250]="2",[0.375]="3",[0.500]="4",[0.625]="5",[0.750]="6",[0.875]="7",[1.000]="0"}
mode3A100s = mode3A100s[ExportScript.Tools.round(mainPanelDevice:get_argument_value(735), 3)]
local mode3A10s = {[0.000]="0",[0.125]="1",[0.250]="2",[0.375]="3",[0.500]="4",[0.625]="5",[0.750]="6",[0.875]="7",[1.000]="0"}
mode3A10s = mode3A10s[ExportScript.Tools.round(mainPanelDevice:get_argument_value(736), 3)]
local mode3A1s = {[0.000]="0",[0.125]="1",[0.250]="2",[0.375]="3",[0.500]="4",[0.625]="5",[0.750]="6",[0.875]="7",[1.000]="0"}
mode3A1s = mode3A1s[ExportScript.Tools.round(mainPanelDevice:get_argument_value(737), 3)]
local mode3A = mode3A1000s .. mode3A100s .. mode3A10s .. mode3A1s
ExportScript.Tools.SendData(8077, 'IFF M3A\n' .. mode3A)
ExportScript.Tools.SendData(8078, 'IFF\nM1 ' .. mode1 .. '\nM3A ' .. mode3A)
end
function ExportScript.FuelCalculator(mainPanelDevice)
-- a rough estimate of instantaneous remaining fuel time
-- 10 second sample period
-- get how many L were used
-- from then do more math to get amount of fuel remaining in hrs
local measurementTime = 10 -- seconds
local clockHour = ExportScript.Tools.round(mainPanelDevice:get_argument_value(64), 4) -- 0.25
clockHour = clockHour * 12 -- 3
clockHour = clockHour * 60 -- 180
clockHour = clockHour * 60 -- 10,800
clockHour = formatTime(clockHour)
local clockTimer = ExportScript.Tools.round(mainPanelDevice:get_argument_value(65), 4)
-- up to 15 minutes
-- .333 is about 5 minutes
clockTimer = clockTimer * 15 -- 4.995
clockTimer = clockTimer * 60 -- 299.7
clockTimer = formatTime2(clockTimer)
-- Manual gravity drop selection Mrad to input the amount of fuel used
local mrad_Xxx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(766) * 10, 0)
local mrad_xXx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(767) * 10, 0)
local mrad_xxX = ExportScript.Tools.round(mainPanelDevice:get_argument_value(768) * 10, 0)
if mrad_Xxx > 9 then mrad_Xxx = 0 end
if mrad_xXx > 9 then mrad_xXx = 0 end
if mrad_xxX > 9 then mrad_xxX = 0 end
local fuelUsed = tonumber(mrad_Xxx .. mrad_xXx .. mrad_xxX)
if fuelUsed == 0 then
fuelUsed = 0.1 -- place holder to not divide by 0
end
local fuelPerHour = 60 * 60 / measurementTime * fuelUsed
-- we can use the roller for the fuel amount TODO: make the fuel function to get more accurate results
-- Fuel quantity indicator
local fuelQty_Xxxx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1146) * 10, 0)
local fuelQty_xXxx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1147) * 10, 0)
local fuelQty_xxXx = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1148) * 10, 0)
local fuelQty_xxxX = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1149) * 10, 0)
if fuelQty_Xxxx > 9 then fuelQty_Xxxx = 0 end
if fuelQty_xXxx > 9 then fuelQty_xXxx = 0 end
if fuelQty_xxXx > 9 then fuelQty_xxXx = 0 end
if fuelQty_xxxX > 9 then fuelQty_xxxX = 0 end
local fuelQtyTotal = fuelQty_Xxxx .. fuelQty_xXxx .. fuelQty_xxXx .. fuelQty_xxxX
local fuelHrs = fuelQtyTotal/fuelPerHour
local fuelMin = fuelHrs * 60
local fuelSec = fuelMin * 60
local fuelTimeReadout = formatTime3(fuelSec)
local fuelString = ''
if fuelUsed == 0.1 then -- place holder to not divide by 0
--[[
fuelString = 'Fuel Calc'
.. '\nSet Mrad'
.. '\nwith fuel'
.. '\nuse over'
.. '\n10 sec'
]]
fuelString = 'Fuel Calc'
.. '\nSet Mrad w/'
.. '\n10s fuel'
.. '\nT - ' .. clockTimer
.. '\nFuel ' .. fuelQtyTotal
else
fuelString = 'Fuel Calc'
.. '\nT - ' .. clockTimer
.. '\nRate - ' .. fuelUsed
.. '\nFuel ' .. fuelQtyTotal
.. '\n'.. fuelTimeReadout
end
ExportScript.Tools.SendData(8075, fuelString)
end
function ExportScript.ClimbSchedulesReadout(mainPanelDevice)
local climbText1 = 'SUB CLMB\nCLEAN MIL\n470/0.92'
local climbText2 = 'SUB CLMB\nCLEAN MAX\n500/0.95'
local climbText3 = 'SUB CLMB\nTANK MIL\n422/0.84'
local climbText4 = 'SUB CLMB\nTANK MAX\n475/0.92'
local climbText5 = 'SUPER\nSUB to 30K\n610 to 36K\nM1.8 to ALT'
ExportScript.Tools.SendData(8070, climbText1)
ExportScript.Tools.SendData(8071, climbText2)
ExportScript.Tools.SendData(8072, climbText3)
ExportScript.Tools.SendData(8073, climbText4)
ExportScript.Tools.SendData(8074, climbText5)
end
function ExportScript.RadarCalculators(mainPanelDevice)
local scanDistance = ExportScript.Tools.round(mainPanelDevice:get_argument_value(258) * 100, 0)
if scanDistance > 70 then
scanDistance = 60
elseif scanDistance > 40 then
scanDistance = 35
elseif scanDistance > 20 then
scanDistance = 15
else -- default distance
scanDistance = 7
end
local lineScanAngle = ExportScript.Tools.round(mainPanelDevice:get_argument_value(600) * 100, 0)
if lineScanAngle > 50 then
lineScanAngle = 8
else
lineScanAngle = 4
end
local altBaroStandby = ExportScript.Tools.round(mainPanelDevice:get_argument_value(1067) * 100000, 0)
-- ((scanDistance/SIN((180-90-lineScanAngle)*PI()/180)) * (SIN(lineScanAngle*PI()/180))) * 6076 + altBaroStandby
-- the above will be the top of the radar detection limit at range. for the bottom add a negative at the beginning
local radarHiFull = ((scanDistance/math.sin((180-90-lineScanAngle)*math.pi/180))
* (math.sin(lineScanAngle*math.pi/180)))
* 6076 + altBaroStandby
radarHiFull = round(radarHiFull,-2)
local radarLoFull = -((scanDistance/math.sin((180-90-lineScanAngle)*math.pi/180))
* (math.sin(lineScanAngle*math.pi/180)))
* 6076 + altBaroStandby
radarLoFull = round(radarLoFull,-2)
-- Calculate the half of the distance. This is the center of the radar screen
local radarHiHalf = (((scanDistance/2)/math.sin((180-90-lineScanAngle)*math.pi/180))
* (math.sin(lineScanAngle*math.pi/180)))
* 6076 + altBaroStandby
radarHiHalf = round(radarHiHalf,-2)
local radarLoHalf = -(((scanDistance/2)/math.sin((180-90-lineScanAngle)*math.pi/180))
* (math.sin(lineScanAngle*math.pi/180)))
* 6076 + altBaroStandby
radarLoHalf = round(radarLoHalf,-2)
radarHiFull = string.format("%.0f",round(format_int(radarHiFull / 1000,2)),0)