Merge pull request #17 from ExoLightFR/Tiger

Add F-5E profile & improve Lua exports
This commit is contained in:
Bailey 2024-04-23 13:06:48 +09:00 committed by GitHub
commit 79dc5f9e5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 253 additions and 188 deletions

View File

@ -526,6 +526,9 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.TacanRadio(mainPanelDevice) -- TACAN Channel
ExportScript.FuelQuantityIndicator(mainPanelDevice) -- Fuel Quantity Indicator (Dual)
ExportScript.UhfRadioKnobs(mainPanelDevice) -- AN/ARC-164 UHF
ExportScript.RWRControlPanel(mainPanelDevice)
ExportScript.flapPositionIndicator(mainPanelDevice)
ExportScript.pitchTrimPosition(mainPanelDevice)
if LoIsObjectExportAllowed() then -- returns true if world objects data is available
if LoIsOwnshipExportAllowed() then -- returns true if ownship data is available
@ -1348,6 +1351,67 @@ function ExportScript.FlowBlinker(mainPanelDevice)
ExportScript.Tools.SendData(9000, blink)
end
function ExportScript.RWRControlPanel(mainPanelDevice)
-- 4003 & 4008 are reserved for logical alignment. LAUNCH & ACT/PWR lights INOP.
ExportScript.Tools.SendData(4000, getRWRButtonLights(mainPanelDevice, 552, 553))
ExportScript.Tools.SendData(4001, getRWRButtonLights(mainPanelDevice, 555))
ExportScript.Tools.SendData(4002, getRWRButtonLights(mainPanelDevice, 557, 558))
ExportScript.Tools.SendData(4004, getRWRButtonLights(mainPanelDevice, 562, 563))
ExportScript.Tools.SendData(4005, getRWRButtonLights(mainPanelDevice, 565, 566))
ExportScript.Tools.SendData(4006, getRWRButtonLights(mainPanelDevice, 568, 569))
ExportScript.Tools.SendData(4007, getRWRButtonLights(mainPanelDevice, 571, 572))
local pwr_on = mainPanelDevice:get_argument_value(576) > 0.0
ExportScript.Tools.SendData(4009, pwr_on and "SYSTEM\n\n\nPOWER" or "")
end
function getRWRButtonLights(mainPanelDevice, first_id, second_id)
-- Associate argument IDs with their text representation, which
-- will be returned as a string for StreamDeck
local labels_map = {
[552] = "PRIORITY",
[553] = "OPEN",
[555] = "█ S █",
[557] = "█ ◆︎ █",
[558] = "█ H █",
[562] = "LOW",
[563] = "ALT",
[565] = "TGT SEP",
[566] = "TGT SEP",
[568] = "ON",
[569] = "SYS TEST",
[571] = "█ U █",
[572] = "UNKNOWN",
}
local first_on = mainPanelDevice:get_argument_value(first_id) > 0.0
local second_on = mainPanelDevice:get_argument_value(second_id) > 0.0
local first_label = first_on and labels_map[first_id] or " "
local second_label = second_on and labels_map[second_id] or " "
return first_label.."\n\n\n"..second_label
end
function ExportScript.flapPositionIndicator(mainPanelDevice)
local flapIndicatorPositions = {
[0.1] = "UP",
[0.2] = "AUTO",
[0.3] = "FXD",
[0.4] = "FULL"
}
local currentPos = mainPanelDevice:get_argument_value(51)
currentPos = math.floor(currentPos * 10) / 10 -- Cut off excess decimal digits
local indicatorText = flapIndicatorPositions[currentPos] or ""
ExportScript.Tools.SendData(4010, indicatorText)
ExportScript.Tools.SendData(4011, string.len(indicatorText)) -- If != 0, flaps in transition
end
function ExportScript.pitchTrimPosition(mainPanelDevice)
local trimValue = mainPanelDevice:get_argument_value(52)
trimValue = math.floor(trimValue * 100) / 10
ExportScript.Tools.SendData(4012, string.format("%+.1f", trimValue))
end
----------------------
-- Helper Functions --
----------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

View File

@ -0,0 +1 @@
To get this profile, install Exo's F-5E StreamDeck profile located in "docu\StreamDeck Examples".

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Binary file not shown.