feat(F-5): RWR panel for SD, autoformat Lua file

Add RWR control panel code & StreamDeck profile. Add source images.
This commit is contained in:
ExoLight 2024-01-20 02:28:28 +01:00
parent ca7329ba89
commit a438c73a65
17 changed files with 232 additions and 188 deletions

View File

@ -526,6 +526,7 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.TacanRadio(mainPanelDevice) -- TACAN Channel ExportScript.TacanRadio(mainPanelDevice) -- TACAN Channel
ExportScript.FuelQuantityIndicator(mainPanelDevice) -- Fuel Quantity Indicator (Dual) ExportScript.FuelQuantityIndicator(mainPanelDevice) -- Fuel Quantity Indicator (Dual)
ExportScript.UhfRadioKnobs(mainPanelDevice) -- AN/ARC-164 UHF ExportScript.UhfRadioKnobs(mainPanelDevice) -- AN/ARC-164 UHF
ExportScript.RWRControlPanel(mainPanelDevice)
if LoIsObjectExportAllowed() then -- returns true if world objects data is available if LoIsObjectExportAllowed() then -- returns true if world objects data is available
if LoIsOwnshipExportAllowed() then -- returns true if ownship data is available if LoIsOwnshipExportAllowed() then -- returns true if ownship data is available
@ -1348,6 +1349,47 @@ function ExportScript.FlowBlinker(mainPanelDevice)
ExportScript.Tools.SendData(9000, blink) ExportScript.Tools.SendData(9000, blink)
end 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
---------------------- ----------------------
-- Helper Functions -- -- Helper Functions --
---------------------- ----------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

@ -0,0 +1,2 @@
To get this, install the F-5 RWR StreamDeck profile located in "docu\StreamDeck Examples".
For the text to work correctly, make sure it is set to Tahoma font, 9pt, horizontally-centered, and green coloured.

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: 9.7 KiB

Binary file not shown.

Binary file not shown.