From 06b33c4ed2614de2e31c429d27e7105f829ca84a Mon Sep 17 00:00:00 2001 From: mcmicha Date: Wed, 16 Mar 2016 00:56:45 +0100 Subject: [PATCH] Use new ExportScript.ProcessIkarusDCSConfigLowImportance(). --- .../DCS-ExportScript/ExportsModules/A-10C.lua | 10 +- .../DCS-ExportScript/ExportsModules/Ka-50.lua | 127 +++++++++--------- .../ExportsModules/Mi-8MT.lua | 5 + .../ExportsModules/MiG-15bis.lua | 4 + .../DCS-ExportScript/ExportsModules/UH-1H.lua | 6 +- 5 files changed, 88 insertions(+), 64 deletions(-) diff --git a/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua b/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua index 1c57e75..0e72acf 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua @@ -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 diff --git a/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua b/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua index 8fd6d77..421a05c 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua @@ -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) diff --git a/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua b/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua index a38f923..a1c633e 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua @@ -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) diff --git a/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua index f72d81c..b4cddb9 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua @@ -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 diff --git a/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua b/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua index 757a9d2..40fa412 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua @@ -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)