Adds a scratchpad output to the A10C II Profile

This commit is contained in:
Fred Damstra 2022-07-17 08:58:29 -04:00
parent 4624a4aea5
commit f2fd44395a
2 changed files with 15 additions and 0 deletions

View File

@ -805,6 +805,11 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
]]
-- Export ScratchPad
local lScratchPad = ExportScript.Tools.getListIndicatorValue(5)
ExportScript.Tools.SendData(2040, ExportScript.Tools.coerce_nil_to_string(lScratchPad.Scratch_PAD))
-- AN/ARC-164 UHF and UHF Preset Channel
---------------------------------------------------
local lUHF_RADIO = GetDevice(54)

View File

@ -833,6 +833,16 @@ function ExportScript.Tools.split(stringvalue, delimiter)
return result;
end
-- This function turns a 'nil' value into an empty string.
-- Courtesy of https://github.com/pet333r/pw-dev_script
function ExportScript.Tools.coerce_nil_to_string(value)
if value == nil then
return ""
else
return value
end
end
-- the function checks whether the cockpit light should be activated in ikarus on the basis of the parameters
-- functional parameters, a single ID, or a table with IDs
function ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, ExportIDs)