mirror of
https://github.com/weyne85/DCS-ExportScripts.git
synced 2025-10-29 16:58:18 +00:00
Add first implementation of Spitfire LFMkIX export script.
This commit is contained in:
parent
64fc4773d3
commit
c06aa57912
148
Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua
Normal file
148
Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua
Normal file
@ -0,0 +1,148 @@
|
||||
-- Spitfire LFMk IX
|
||||
-- Version 0.0.1
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Flight Instruments
|
||||
[11] = "%.4f", -- OxygenDeliveryGauge {0.0, 0.4}{0.0, 4000.0}
|
||||
[12] = "%.4f", -- OxygenSupplyGauge
|
||||
[17] = "%.4f", -- TrimGauge {-1.0, 1.0}
|
||||
[18] = "%.4f", -- PneumaticPressureGauge {0.0, 1.0}{0.0, 600.0}
|
||||
--[[
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", --
|
||||
[] = "%.4f", -- ]]
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 13, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 73, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
Loading…
x
Reference in New Issue
Block a user