forked from HeliosVirtualCockpit/HeliosInterfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helios.M2000C.hif.lua
70 lines (66 loc) · 3.52 KB
/
Helios.M2000C.hif.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
function driver.processHighImportance(mainPanelDevice)
-- Send Altimeter Values
helios.send(2051, string.format("%0.4f;%0.4f;%0.4f", mainPanelDevice:get_argument_value(306), mainPanelDevice:get_argument_value(307), mainPanelDevice:get_argument_value(305)))
helios.send(2059, string.format("%0.2f;%0.2f;%0.2f;%0.3f", mainPanelDevice:get_argument_value(310), mainPanelDevice:get_argument_value(311), mainPanelDevice:get_argument_value(312), mainPanelDevice:get_argument_value(313)))
end
function driver.processLowImportance(mainPanelDevice)
-- PCA_UR structured data
li = helios.parseIndication(4) -- 4 for PCA_UR
if li then
helios.send(2060, string.format("%-3s%-3s%-3s%-3s%-3s", helios.ensureString(li.PCA_LCD_1_0), helios.ensureString(li.PCA_LCD_1_1), helios.ensureString(li.PCA_LCD_1_2), helios.ensureString(li.PCA_LCD_1_3), helios.ensureString(li.PCA_LCD_1_4)))
end
-- PCA_BR structured data
li = helios.parseIndication(5) -- 5 for PCA_BR
if li then
helios.send(2061, string.format("%-3s%-3s%-3s%-3s%-3s", helios.ensureString(li.PCA_LCD_2_0), helios.ensureString(li.PCA_LCD_2_1), helios.ensureString(li.PCA_LCD_2_2), helios.ensureString(li.PCA_LCD_2_3), helios.ensureString(li.PCA_LCD_2_4)))
end
-- VHF Comm structured data
li = helios.parseIndication(8)
if li then
helios.send(2062, string.format("%-8s", helios.ensureString(li.text_COM_VHF)))
end
-- UHF Comm structured data
li = helios.parseIndication(7)
if li then
helios.send(2063, string.format("%-8s", helios.ensureString(li.text_COM_UHF1)))
helios.send(2064, string.format("%-8s", helios.ensureString(li.text_COM_UHF2)))
end
-- PPA structured data
li = helios.parseIndication(6)
if li then
helios.send(2065, string.format("%-2s", helios.ensureString(li.text_PPA_QTY)))
helios.send(2066, string.format("%-2s", helios.ensureString(li.text_PPA_INT)))
end
-- Fuel structured data
li = helios.parseIndication(3)
if li then
helios.send(2067, string.format("%-3s", helios.ensureString(li.txt_fuel_g)))
end
-- PCN U structured data
li = helios.parseIndication(9)
if li then
helios.send(2068, string.format("%6s", helios.ensureString(li.PCN_UL_DIGITS)))
helios.send(2069, string.format("%6s", helios.ensureString(li.PCN_UL_POINTS)))
helios.send(2070, string.format("%6s", helios.ensureString(li.PCN_UR_DIGITS)))
helios.send(2071, string.format("%6s", helios.ensureString(li.PCN_UR_POINTS)))
helios.send(2072, string.format("%1d", li["PCN_UL_N"] and 1 or 0))
helios.send(2073, string.format("%1d", li["PCN_UL_S"] and 1 or 0))
helios.send(2074, string.format("%1d", li["PCN_UR_E"] and 1 or 0))
helios.send(2075, string.format("%1d", li["PCN_UR_W"] and 1 or 0))
helios.send(2076, string.format("%1d", li["PCN_UL_P"] and 1 or 0))
helios.send(2077, string.format("%1d", li["PCN_UL_M"] and 1 or 0))
helios.send(2078, string.format("%1d", li["PCN_UR_P"] and 1 or 0))
helios.send(2079, string.format("%1d", li["PCN_UR_M"] and 1 or 0))
end
-- PCN B structured data
li = helios.parseIndication(10)
if li then
helios.send(2080, string.format("%s", helios.ensureString(li.PCN_BL_DIGITS)))
helios.send(2081, string.format("%s", helios.ensureString(li.PCN_BR_DIGITS)))
end
-- EVF structured data
li = helios.parseIndication(11)
if li then
helios.send(2082, string.format("%-2s", helios.ensureString(li["evf-digits"])))
end
end