updated gazelle M
See wiki (https://github.com/asherao/DCS-ExportScripts/wiki/Gazelle) - Added IDs 2006-2011 - Added StreamDeck Pics
@ -428,6 +428,8 @@ function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||
end
|
||||
end
|
||||
ExportScript.Tools.SendData(102, string.format("%.4f", ADF_Aiguille_large))
|
||||
|
||||
ExportScript.ADF(mainPanelDevice)
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
@ -740,4 +742,297 @@ end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
-----------------------------
|
||||
|
||||
|
||||
function ExportScript.ADF(mainPanelDevice)
|
||||
|
||||
local ADF_nav1_centaine = mainPanelDevice:get_argument_value(158)
|
||||
local ADF_nav1_dizaine = mainPanelDevice:get_argument_value(159)
|
||||
local ADF_nav1_unite = mainPanelDevice:get_argument_value(160)
|
||||
local ADF_nav1_dec = mainPanelDevice:get_argument_value(161)
|
||||
|
||||
if ADF_nav1_centaine < 0.05 then
|
||||
ADF_nav1_centaine = 0
|
||||
elseif ADF_nav1_centaine < 0.15 then
|
||||
ADF_nav1_centaine = 1
|
||||
elseif ADF_nav1_centaine < 0.25 then
|
||||
ADF_nav1_centaine = 2
|
||||
elseif ADF_nav1_centaine < 0.35 then
|
||||
ADF_nav1_centaine = 3
|
||||
elseif ADF_nav1_centaine < 0.45 then
|
||||
ADF_nav1_centaine = 4
|
||||
elseif ADF_nav1_centaine < 0.55 then
|
||||
ADF_nav1_centaine = 5
|
||||
elseif ADF_nav1_centaine < 0.65 then
|
||||
ADF_nav1_centaine = 6
|
||||
elseif ADF_nav1_centaine < 0.75 then
|
||||
ADF_nav1_centaine = 7
|
||||
elseif ADF_nav1_centaine < 0.85 then
|
||||
ADF_nav1_centaine = 8
|
||||
elseif ADF_nav1_centaine < 0.95 then
|
||||
ADF_nav1_centaine = 9
|
||||
else
|
||||
ADF_nav1_centaine = 0
|
||||
end
|
||||
|
||||
if ADF_nav1_dizaine < 0.05 then
|
||||
ADF_nav1_dizaine = 0
|
||||
elseif ADF_nav1_dizaine < 0.15 then
|
||||
ADF_nav1_dizaine = 1
|
||||
elseif ADF_nav1_dizaine < 0.25 then
|
||||
ADF_nav1_dizaine = 2
|
||||
elseif ADF_nav1_dizaine < 0.35 then
|
||||
ADF_nav1_dizaine = 3
|
||||
elseif ADF_nav1_dizaine < 0.45 then
|
||||
ADF_nav1_dizaine = 4
|
||||
elseif ADF_nav1_dizaine < 0.55 then
|
||||
ADF_nav1_dizaine = 5
|
||||
elseif ADF_nav1_dizaine < 0.65 then
|
||||
ADF_nav1_dizaine = 6
|
||||
elseif ADF_nav1_dizaine < 0.75 then
|
||||
ADF_nav1_dizaine = 7
|
||||
elseif ADF_nav1_dizaine < 0.85 then
|
||||
ADF_nav1_dizaine = 8
|
||||
elseif ADF_nav1_dizaine < 0.95 then
|
||||
ADF_nav1_dizaine = 9
|
||||
else
|
||||
ADF_nav1_dizaine = 0
|
||||
end
|
||||
|
||||
if ADF_nav1_unite < 0.05 then
|
||||
ADF_nav1_unite = 0
|
||||
elseif ADF_nav1_unite < 0.15 then
|
||||
ADF_nav1_unite = 1
|
||||
elseif ADF_nav1_unite < 0.25 then
|
||||
ADF_nav1_unite = 2
|
||||
elseif ADF_nav1_unite < 0.35 then
|
||||
ADF_nav1_unite = 3
|
||||
elseif ADF_nav1_unite < 0.45 then
|
||||
ADF_nav1_unite = 4
|
||||
elseif ADF_nav1_unite < 0.55 then
|
||||
ADF_nav1_unite = 5
|
||||
elseif ADF_nav1_unite < 0.65 then
|
||||
ADF_nav1_unite = 6
|
||||
elseif ADF_nav1_unite < 0.75 then
|
||||
ADF_nav1_unite = 7
|
||||
elseif ADF_nav1_unite < 0.85 then
|
||||
ADF_nav1_unite = 8
|
||||
elseif ADF_nav1_unite < 0.95 then
|
||||
ADF_nav1_unite = 9
|
||||
else
|
||||
ADF_nav1_unite = 0
|
||||
end
|
||||
|
||||
if ADF_nav1_dec < 0.05 then
|
||||
ADF_nav1_dec = 0
|
||||
elseif ADF_nav1_dec < 0.15 then
|
||||
ADF_nav1_dec = 1
|
||||
elseif ADF_nav1_dec < 0.25 then
|
||||
ADF_nav1_dec = 2
|
||||
elseif ADF_nav1_dec < 0.35 then
|
||||
ADF_nav1_dec = 3
|
||||
elseif ADF_nav1_dec < 0.45 then
|
||||
ADF_nav1_dec = 4
|
||||
elseif ADF_nav1_dec < 0.55 then
|
||||
ADF_nav1_dec = 5
|
||||
elseif ADF_nav1_dec < 0.65 then
|
||||
ADF_nav1_dec = 6
|
||||
elseif ADF_nav1_dec < 0.75 then
|
||||
ADF_nav1_dec = 7
|
||||
elseif ADF_nav1_dec < 0.85 then
|
||||
ADF_nav1_dec = 8
|
||||
elseif ADF_nav1_dec < 0.95 then
|
||||
ADF_nav1_dec = 9
|
||||
else
|
||||
ADF_nav1_dec = 0
|
||||
end
|
||||
|
||||
local ADF_nav2_centaine = mainPanelDevice:get_argument_value(162)
|
||||
local ADF_nav2_dizaine = mainPanelDevice:get_argument_value(163)
|
||||
local ADF_nav2_unite = mainPanelDevice:get_argument_value(164)
|
||||
local ADF_nav2_dec = mainPanelDevice:get_argument_value(165)
|
||||
|
||||
if ADF_nav2_centaine < 0.05 then
|
||||
ADF_nav2_centaine = 0
|
||||
elseif ADF_nav2_centaine < 0.15 then
|
||||
ADF_nav2_centaine = 1
|
||||
elseif ADF_nav2_centaine < 0.25 then
|
||||
ADF_nav2_centaine = 2
|
||||
elseif ADF_nav2_centaine < 0.35 then
|
||||
ADF_nav2_centaine = 3
|
||||
elseif ADF_nav2_centaine < 0.45 then
|
||||
ADF_nav2_centaine = 4
|
||||
elseif ADF_nav2_centaine < 0.55 then
|
||||
ADF_nav2_centaine = 5
|
||||
elseif ADF_nav2_centaine < 0.65 then
|
||||
ADF_nav2_centaine = 6
|
||||
elseif ADF_nav2_centaine < 0.75 then
|
||||
ADF_nav2_centaine = 7
|
||||
elseif ADF_nav2_centaine < 0.85 then
|
||||
ADF_nav2_centaine = 8
|
||||
elseif ADF_nav2_centaine < 0.95 then
|
||||
ADF_nav2_centaine = 9
|
||||
else
|
||||
ADF_nav2_centaine = 0
|
||||
end
|
||||
|
||||
if ADF_nav2_dizaine < 0.05 then
|
||||
ADF_nav2_dizaine = 0
|
||||
elseif ADF_nav2_dizaine < 0.15 then
|
||||
ADF_nav2_dizaine = 1
|
||||
elseif ADF_nav2_dizaine < 0.25 then
|
||||
ADF_nav2_dizaine = 2
|
||||
elseif ADF_nav2_dizaine < 0.35 then
|
||||
ADF_nav2_dizaine = 3
|
||||
elseif ADF_nav2_dizaine < 0.45 then
|
||||
ADF_nav2_dizaine = 4
|
||||
elseif ADF_nav2_dizaine < 0.55 then
|
||||
ADF_nav2_dizaine = 5
|
||||
elseif ADF_nav2_dizaine < 0.65 then
|
||||
ADF_nav2_dizaine = 6
|
||||
elseif ADF_nav2_dizaine < 0.75 then
|
||||
ADF_nav2_dizaine = 7
|
||||
elseif ADF_nav2_dizaine < 0.85 then
|
||||
ADF_nav2_dizaine = 8
|
||||
elseif ADF_nav2_dizaine < 0.95 then
|
||||
ADF_nav2_dizaine = 9
|
||||
else
|
||||
ADF_nav2_dizaine = 0
|
||||
end
|
||||
|
||||
if ADF_nav2_unite < 0.05 then
|
||||
ADF_nav2_unite = 0
|
||||
elseif ADF_nav2_unite < 0.15 then
|
||||
ADF_nav2_unite = 1
|
||||
elseif ADF_nav2_unite < 0.25 then
|
||||
ADF_nav2_unite = 2
|
||||
elseif ADF_nav2_unite < 0.35 then
|
||||
ADF_nav2_unite = 3
|
||||
elseif ADF_nav2_unite < 0.45 then
|
||||
ADF_nav2_unite = 4
|
||||
elseif ADF_nav2_unite < 0.55 then
|
||||
ADF_nav2_unite = 5
|
||||
elseif ADF_nav2_unite < 0.65 then
|
||||
ADF_nav2_unite = 6
|
||||
elseif ADF_nav2_unite < 0.75 then
|
||||
ADF_nav2_unite = 7
|
||||
elseif ADF_nav2_unite < 0.85 then
|
||||
ADF_nav2_unite = 8
|
||||
elseif ADF_nav2_unite < 0.95 then
|
||||
ADF_nav2_unite = 9
|
||||
else
|
||||
ADF_nav2_unite = 0
|
||||
end
|
||||
|
||||
if ADF_nav2_dec < 0.05 then
|
||||
ADF_nav2_dec = 0
|
||||
elseif ADF_nav2_dec < 0.15 then
|
||||
ADF_nav2_dec = 1
|
||||
elseif ADF_nav2_dec < 0.25 then
|
||||
ADF_nav2_dec = 2
|
||||
elseif ADF_nav2_dec < 0.35 then
|
||||
ADF_nav2_dec = 3
|
||||
elseif ADF_nav2_dec < 0.45 then
|
||||
ADF_nav2_dec = 4
|
||||
elseif ADF_nav2_dec < 0.55 then
|
||||
ADF_nav2_dec = 5
|
||||
elseif ADF_nav2_dec < 0.65 then
|
||||
ADF_nav2_dec = 6
|
||||
elseif ADF_nav2_dec < 0.75 then
|
||||
ADF_nav2_dec = 7
|
||||
elseif ADF_nav2_dec < 0.85 then
|
||||
ADF_nav2_dec = 8
|
||||
elseif ADF_nav2_dec < 0.95 then
|
||||
ADF_nav2_dec = 9
|
||||
else
|
||||
ADF_nav2_dec = 0
|
||||
end
|
||||
|
||||
local ADF_RADIO_Select = mainPanelDevice:get_argument_value(166)
|
||||
local isADF1Selected = 1
|
||||
if ADF_RADIO_Select > 0.01 then
|
||||
isADF1Selected = 0
|
||||
end
|
||||
ExportScript.Tools.SendData(2006, isADF1Selected)
|
||||
|
||||
local ADF_display
|
||||
if isADF1Selected == 1 then
|
||||
ADF_freqDisplay = (ADF_nav1_centaine .. ADF_nav1_dizaine .. ADF_nav1_unite .. "." .. ADF_nav1_dec)
|
||||
else
|
||||
ADF_freqDisplay = (ADF_nav2_centaine .. ADF_nav2_dizaine .. ADF_nav2_unite .. "." .. ADF_nav2_dec)
|
||||
end
|
||||
|
||||
ExportScript.Tools.SendData(2007, "ADF\n\n" .. ADF_freqDisplay)
|
||||
ExportScript.Tools.SendData(2008, "ADF\n" .. ADF_freqDisplay)
|
||||
|
||||
ExportScript.Tools.SendData(2009, "ADF\n" .. ADF_nav1_centaine .. ADF_nav1_dizaine .. ADF_nav1_unite .. "." .. ADF_nav1_dec .. "\n" .. ADF_nav2_centaine .. ADF_nav2_dizaine .. ADF_nav2_unite .. "." .. ADF_nav2_dec)
|
||||
|
||||
--helpers for the knob readouts
|
||||
ExportScript.Tools.SendData(2010, ADF_nav1_unite .. "." .. ADF_nav1_dec)
|
||||
ExportScript.Tools.SendData(2011, ADF_nav2_unite .. "." .. ADF_nav2_dec)
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
------------------------------
|
||||
-- General Helper Functions --
|
||||
------------------------------
|
||||
|
||||
function ExportScript.Linearize(current_value, raw_tab, final_tab)
|
||||
-- (c) scoobie
|
||||
if current_value <= raw_tab[1] then
|
||||
return final_tab[1]
|
||||
end
|
||||
for index, value in pairs(raw_tab) do
|
||||
if current_value <= value then
|
||||
local ft = final_tab[index]
|
||||
local rt = raw_tab[index]
|
||||
return (current_value - rt) * (ft - final_tab[index - 1]) / (rt - raw_tab[index - 1]) + ft
|
||||
end
|
||||
end
|
||||
-- we shouldn't be here, so something went wrong - return arbitrary max. final value, maybe the user will notice the problem:
|
||||
return final_tab[#final_tab]
|
||||
end
|
||||
|
||||
|
||||
function round(num, numDecimalPlaces) --http://lua-users.org/wiki/SimpleRound
|
||||
local mult = 10^(numDecimalPlaces or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
|
||||
function format_int(number) --https://stackoverflow.com/questions/10989788/format-integer-in-lua
|
||||
|
||||
local i, j, minus, int, fraction = tostring(number):find('([-]?)(%d+)([.]?%d*)')
|
||||
|
||||
-- reverse the int-string and append a comma to all blocks of 3 digits
|
||||
int = int:reverse():gsub("(%d%d%d)", "%1,")
|
||||
|
||||
-- reverse the int-string back remove an optional comma and put the
|
||||
-- optional minus and fractional part back
|
||||
return minus .. int:reverse():gsub("^,", "") .. fraction
|
||||
end
|
||||
|
||||
function trim(s) --http://lua-users.org/wiki/CommonFunctions
|
||||
-- from PiL2 20.4
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Notes
|
||||
|
||||
--[[
|
||||
local a = ExportScript.Tools.split(list_indication(3), "%c")
|
||||
return a
|
||||
contains the nav screen output
|
||||
|
||||
add ADF radio output
|
||||
|
||||
add radar altimeter with warning
|
||||
|
||||
]]--
|
||||
BIN
docu/Pics/Gazelle/1.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docu/Pics/Gazelle/2.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docu/Pics/Gazelle/ADF Radio Arrow Left.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
docu/Pics/Gazelle/ADF Radio Arrow Right.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
docu/Pics/Gazelle/ADF Radio Arrow.psd
Normal file
BIN
docu/Pics/Gazelle/IconsRadio_0001_Layer 2.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0002_Layer 3.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0003_Layer 4.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0004_Layer 5.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0005_Layer 6.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0006_Layer 7.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0007_Layer 8.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0008_Layer 9.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0009_Layer 10.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0010_Layer 11.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docu/Pics/Gazelle/IconsRadio_0011_Layer 12.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docu/Pics/Gazelle/Icons_0000_Layer 1.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
docu/Pics/Gazelle/Icons_0001_Layer 2.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docu/Pics/Gazelle/Icons_0002_Layer 3.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docu/Pics/Gazelle/Icons_0003_Layer 4.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docu/Pics/Gazelle/Icons_0004_Layer 5.jpg
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
docu/Pics/Gazelle/Icons_0005_Layer 6.jpg
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
docu/Pics/Gazelle/Icons_0006_Layer 7.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docu/Pics/Gazelle/Icons_0007_Layer 8.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docu/Pics/Gazelle/Icons_0008_Layer 9.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docu/Pics/Gazelle/Icons_0009_Layer 10.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
docu/Pics/Gazelle/Icons_0010_Layer 11.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
docu/Pics/Gazelle/Icons_0011_Layer 12.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
docu/Pics/Gazelle/Icons_0012_Layer 13.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
docu/Pics/Gazelle/Icons_0013_Layer 14.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
docu/Pics/Gazelle/Icons_0014_Layer 15.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docu/Pics/Gazelle/Icons_0015_Layer 16.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docu/Pics/Gazelle/Icons_0016_Layer 17.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docu/Pics/Gazelle/Icons_0017_Layer 18.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docu/Pics/Gazelle/Icons_0018_Layer 19.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docu/Pics/Gazelle/Icons_0019_Layer 20.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docu/Pics/Gazelle/Icons_0020_Layer 21.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
docu/Pics/Gazelle/Icons_0021_Layer 22.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
docu/Pics/Gazelle/Icons_0022_Layer 23.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
docu/Pics/Gazelle/Icons_0023_Layer 24.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docu/Pics/Gazelle/Icons_0024_Layer 25.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docu/Pics/Gazelle/Icons_0025_Layer 26.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
docu/Pics/Gazelle/Icons_0026_Layer 27.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |