Use new ExportScript.ProcessIkarusDCSConfigLowImportance().

This commit is contained in:
mcmicha 2016-03-16 00:56:45 +01:00
parent 6644993e64
commit 06b33c4ed2
5 changed files with 88 additions and 64 deletions

View File

@ -69,11 +69,15 @@ ExportScript.ConfigEveryFrameArguments =
[715] = "%.4f", -- Standby Attitude Indicator manual pitch adjustment
-- Engine Gauges
[70] = "%.4f", -- Left Engine Temperature
[71] = "%.4f", -- Left Engine TemperatureUnits
[73] = "%.4f", -- Right Engine Temperature
[74] = "%.4f", -- Right Engine TemperatureUnits
[76] = "%.4f", -- EngineLeftFanSpeed
[77] = "%.4f", -- EngineRightFanSpeed
[78] = "%.4f", -- EngineLeftCoreSpeedTenth
[79] = "%.4f", -- EngineLeftCoreSpeedUnits
[80] = "%.4f", -- EngineRightCoreSpeedTenth
[81] = "%.4f", -- EngineRightCoreSpeedUnits
[82] = "%.4f", -- Left Engine Oil Pressure
[83] = "%.4f", -- Right Engine Oil Pressure
[84] = "%.4f", -- EngineLeftFuelFlow
@ -765,6 +769,10 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.Tools.SendData(2006, "") -- txt_JMR
ExportScript.Tools.SendData(2007, "") -- txt_MWS
end
-- Cockpit Light
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {290,292,293})
-- Engine Instruments Lights, Flight Instruments Lights, Auxiliary Instruments Lights
end
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
@ -954,7 +962,7 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
ExportScript.genericRadioConf[3]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
ExportScript.genericRadioConf[3]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
ExportScript.genericRadioConf[3]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
ExportScript.genericRadio(nil, nil)
-- NOT FOR ARCAZE

View File

@ -769,10 +769,14 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
--ExportScript.Tools.WriteToLog('lEKRANtxtqueue: '..ExportScript.Tools.dump(lEKRANtxtqueue))
--ExportScript.Tools.WriteToLog('lEKRANtxt1: '..ExportScript.Tools.dump(lEKRANtxt1))
--ExportScript.Tools.WriteToLog('lEKRANtxt2: '..ExportScript.Tools.dump(lEKRANtxt2))
lEkranSendString = string.sub(lEKRANtxt2,1,9).."\n"..string.sub(lEKRANtxt2,11,19).."\n"..string.sub(lEKRANtxt2,21,29).."\n"..string.sub(lEKRANtxt2,31,39)
ExportScript.Tools.SendData(2001, string.format("%s", lEkranSendString))
ExportScript.Tools.SendData(2004, string.format("%s", lEKRANtxtqueue))
-- Cockpit Light
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {300, 299, 298})
-- Lighting cockpit panel switch, Lighting night vision cockpit switch, Lighting ADI and SAI switch
end
-- Pointed to by ProcessDACLowImportance, if the player aircraft is a Ka-50
@ -800,7 +804,7 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
-- R_828 Channel
local lR_828 = {[0.0]="1",[0.1]="2",[0.2]="3",[0.3]="4",[0.4]="5",[0.5]="6",[0.6]="7",[0.7]="8",[0.8]="9",[0.9]="10"}
ExportScript.Tools.SendDataDAC("2002", lR_828[ExportScript.Tools.round(mainPanelDevice:get_argument_value(371), 1)])
-- R_828 Frequency
local lR_828_F = GetDevice(49)
if lR_828_F:is_on() then
@ -850,10 +854,9 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
lUV26 = lUV26:gsub("-----------------------------------------", "")
lUV26 = lUV26:gsub("txt_digits", "")
lUV26 = lUV26:gsub("%c", "")
ExportScript.Tools.SendDataDAC("2007", string.format("%s", lUV26))
local lPVI800 = list_indication(5)
--[[
txt_VIT Inhalt obere Zeile
@ -920,7 +923,7 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
if pos2 ~= nil then
ltxt_NIT_apostrophe2 = true
end
if ltxt_VIT ~= nil then
ltxt_VIT = ltxt_VIT:gsub("%c", "")
ltxt_upper_row = ltxt_VIT:sub(1, 3)
@ -933,7 +936,7 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
end
ltxt_upper_row = ltxt_upper_row..ltxt_VIT:sub(6)
end
if ltxt_NIT ~= nil then
ltxt_NIT = ltxt_NIT:gsub("%c", "")
ltxt_lower_row = ltxt_NIT:sub(1, 3)
@ -946,85 +949,36 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
end
ltxt_lower_row = ltxt_lower_row..ltxt_NIT:sub(6)
end
if ltxt_VIT ~= nil then
ltxt_upper_row = ltxt_upper_row..string.rep(" ", 7 - ltxt_VIT:len())
else
ltxt_upper_row = string.rep(" ", 7)
end
if ltxt_OIT_PPM ~= nil then
ltxt_OIT_PPM = ltxt_OIT_PPM:gsub("%c", "")
ltxt_upper_row = ltxt_upper_row..ltxt_OIT_PPM
else
ltxt_upper_row = ltxt_upper_row.." "
end
if ltxt_NIT ~= nil then
ltxt_lower_row = ltxt_lower_row..string.rep(" ", 7 - ltxt_NIT:len())
else
ltxt_lower_row = string.rep(" ", 7)
end
if ltxt_OIT_NOT ~= nil then
ltxt_OIT_NOT = ltxt_OIT_NOT:gsub("%c", "")
ltxt_lower_row = ltxt_lower_row..ltxt_OIT_NOT
else
ltxt_lower_row = ltxt_lower_row.." "
end
ExportScript.Tools.SendDataDAC("2008", string.format("%s", ltxt_upper_row))
ExportScript.Tools.SendDataDAC("2009", string.format("%s", ltxt_lower_row))
--[[
--ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
local ltmp1 = 0
for ltmp2 = 1, 14, 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
]]
end
-----------------------------
-- 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
]]
ExportScript.Tools.SendData(44, string.format("%.1f", mainPanelDevice:get_argument_value(44))) -- lamp_MasterWarning {0.0,0.3}
ExportScript.Tools.SendData(46, string.format("%.1f", mainPanelDevice:get_argument_value(46))) -- lamp_RotorRPM {0.0,0.1}
end
-- Pointed to by ProcessDACHighImportance, if the player aircraft is a Ka-50
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
--[[
every frame export to hardware
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.SendDataDAC("44", mainPanelDevice:get_argument_value(44) > 0.0 and 1 or 0) -- lamp_MasterWarning {0.0,0.3}
ExportScript.Tools.SendDataDAC("46", mainPanelDevice:get_argument_value(46) > 0.0 and 1 or 0) -- lamp_RotorRPM {0.0,0.1}
-- generic Radio display and frequency rotarys
-------------------------------------------------
-- genericRadioConf
@ -1100,9 +1054,58 @@ function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
-- ExportScript.genericRadioConf[2]['ManualPreset']['ButtonID'] = 0 -- ManualPreset button id from cklickable.lua
-- ExportScript.genericRadioConf[2]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
-- ExportScript.genericRadioConf[2]['ManualPreset']['ValuePreset'] = 0.0-- ManualPreset Preset value from cklickable.lua
ExportScript.genericRadio(nil, nil)
--[[
--ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
local ltmp1 = 0
for ltmp2 = 1, 14, 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
]]
end
-----------------------------
-- 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
]]
ExportScript.Tools.SendData(44, string.format("%.1f", mainPanelDevice:get_argument_value(44))) -- lamp_MasterWarning {0.0,0.3}
ExportScript.Tools.SendData(46, string.format("%.1f", mainPanelDevice:get_argument_value(46))) -- lamp_RotorRPM {0.0,0.1}
end
-- Pointed to by ProcessDACHighImportance, if the player aircraft is a Ka-50
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
--[[
every frame export to hardware
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.SendDataDAC("44", mainPanelDevice:get_argument_value(44) > 0.0 and 1 or 0) -- lamp_MasterWarning {0.0,0.3}
ExportScript.Tools.SendDataDAC("46", mainPanelDevice:get_argument_value(46) > 0.0 and 1 or 0) -- lamp_RotorRPM {0.0,0.1}
--[[
-- ENGINE_INTERFACE
local lENGINE_INTERFACE = GetDevice(4)

View File

@ -1019,6 +1019,11 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.Tools.SendData("ExportID", "Format")
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
-- Cockpit Light
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {280, 281, 491, 492, 894, 895, 914})
-- Lh RedLights Brightness Rst gr.1, Lh RedLights Brightness Rst gr.2, Rh RedLights Brightness Rst gr.1, Rh RedLights Brightness Rst gr.2, Central RedLights Brightness Rst gr.1, Central RedLights Brightness Rst gr.2, 5.5V Lights Brightness Rheostat
--[[
-- AGB_3K_LEFT
local lAGB_3K_LEFT = GetDevice(6)

View File

@ -322,6 +322,10 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.Tools.SendData("ExportID", "Format")
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
-- Cockpit Light
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, 220)
-- Panels Light Rheostat
end

View File

@ -439,7 +439,7 @@ ExportScript.ConfigArguments =
[201] = "%1d", -- Search Light
[205] = "%1d", -- Landing Light Ctrl
-- Light System
[230] = "%.4f", -- "Overhead Console Panel Lights Brightness Rheostat, Axis
[230] = "%.4f", -- Overhead Console Panel Lights Brightness Rheostat, Axis
[231] = "%.4f", -- Pedestal Lights Brightness Rheostat, Axis
[232] = "%.4f", -- Secondary Instrument Lights Brightness Rheostat, Axis
[233] = "%.4f", -- Engine Instrument Lights Brightness Rheostat, Axis
@ -546,6 +546,10 @@ function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
ExportScript.Tools.SendData("ExportID", "Format")
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
-- Cockpit Light
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {230, 231, 232, 233, 234, 235})
-- Overhead Console Panel Lights Brightness Rheostat, Pedestal Lights Brightness Rheostat, Secondary Instrument Lights Brightness Rheostat, Engine Instrument Lights Brightness Rheostat, Copilot Instrument Lights Brightness Rheostat, Pilot Instrument Lights Brightness Rheostat, Axis
end
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)