diff --git a/README.md b/README.md index 74e1af0..f29057c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Zur Zeit werden folgende Export-Formate unterstützt. Der Export von Daten wird für folgende Module unterstützt: - A-10C - AJS37 +- AV-8B N/A - Bf-109K-4 +- F/A-18C Hornet - F-5E-3 - F-86F - FW-190D9 @@ -19,6 +21,7 @@ Der Export von Daten wird für folgende Module unterstützt: - Mi-8MT - MiG-15bis - MiG-21Bis +- Mirage 2000 - P-51D - SA342L/M/Mistral - SpitfireLFMkIX @@ -27,7 +30,7 @@ Der Export von Daten wird für folgende Module unterstützt: - UH-1H - alle Flaming Cliffs Flugzeuge -Kompatibel zur DCS World 1.5.8 und DCS World 2.5.0 +Kompatibel zur DCS World 2.5.2 und BETA Version # English --- @@ -40,7 +43,9 @@ At present the following export formats are supported: Following moduls are supported: - A-10C - AJS37 +- AV-8B N/A - Bf-109K-4 +- F/A-18C Hornet - F-5E-3 - F-86F - FW-190D9 @@ -49,6 +54,7 @@ Following moduls are supported: - Mi-8MT - MiG-15bis - MiG-21Bis +- Mirage 2000 - P-51D - SA342L/M/Mistral - SpitfireLFMkIX @@ -57,7 +63,7 @@ Following moduls are supported: - UH-1H - all Flaming Cliffs aircrafts -Compatible with DCS World 1.5.8 and DCS World 2.5.0 +Compatible with DCS World 2.5.2 and BETA version # Wiki --- diff --git a/Scripts/DCS-ExportScript/Config.lua b/Scripts/DCS-ExportScript/Config.lua index 39e7b53..26a61b3 100644 --- a/Scripts/DCS-ExportScript/Config.lua +++ b/Scripts/DCS-ExportScript/Config.lua @@ -1,5 +1,4 @@ -- Ikarus and D.A.C. Export Script --- Version 1.0.2 -- -- Config File -- @@ -7,6 +6,7 @@ -- Contact dcs2arcaze.micha@farbpigmente.org ExportScript.Config = {} +ExportScript.Version.Config = "1.1.0" -- Ikarus a Glass Cockpit Software ExportScript.Config.IkarusExport = true -- false for not use @@ -38,5 +38,6 @@ ExportScript.Config.ExportLowTickInterval = 0.5 -- export evry 0.5 secounds ExportScript.Config.LogPath = lfs.writedir()..[[Logs\Export.log]] ExportScript.Config.ExportModulePath = lfs.writedir()..[[Scripts\DCS-ExportScript\ExportsModules\]] ExportScript.Config.Debug = false +ExportScript.Config.SocketDebug = false ExportScript.Config.FirstNewDataSend = true ExportScript.Config.FirstNewDataSendCount = 5 \ No newline at end of file diff --git a/Scripts/DCS-ExportScript/ExportScript.lua b/Scripts/DCS-ExportScript/ExportScript.lua index 71580a9..6fad0cf 100644 --- a/Scripts/DCS-ExportScript/ExportScript.lua +++ b/Scripts/DCS-ExportScript/ExportScript.lua @@ -1,12 +1,13 @@ -- Ikarus and D.A.C. Export Script --- Version 1.0.1 -- --- Copyright by Michael aka McMicha 2014 - 2017 +-- Copyright by Michael aka McMicha 2014 - 2018 -- Contact dcs2arcaze.micha@farbpigmente.org -- Main Table ExportScript = {} +ExportScript.Version = {} +ExportScript.Version.ExportScript = "1.1.0" -- Simulation id ExportScript.SimID = string.format("%08x*",os.time()) @@ -54,23 +55,11 @@ ExportScript.FoundNoModul = true function LuaExportStart() -- Works once just before mission start. -- (and before player selects their aircraft, if there is a choice!) - + -- 2) Setup udp sockets to talk to GlassCockpit package.path = package.path..";.\\LuaSocket\\?.lua" package.cpath = package.cpath..";.\\LuaSocket\\?.dll" - ExportScript.socket = require("socket") - - ExportScript.UDPsender = ExportScript.socket.udp() - ExportScript.UDPsender:setsockname("*", 0) - ExportScript.UDPsender:settimeout(.004) -- set the timeout for reading the socket; 250 fps - - if ExportScript.Config.Listener then - ExportScript.UDPListener = ExportScript.socket.udp() - ExportScript.UDPListener:setsockname("*", ExportScript.Config.ListenerPort) - ExportScript.UDPListener:settimeout(.004) -- set the timeout for reading the socket; 250 fps - end - --local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old") ExportScript.logFile = io.open(ExportScript.Config.LogPath, "wa") -- "W+" if ExportScript.logFile then @@ -80,6 +69,9 @@ function LuaExportStart() -- ExportScript.Tools.WriteToLog("Rename Error: "..lrename2) --end + ExportScript.Tools.createUDPSender() + ExportScript.Tools.createUDPListner() + ExportScript.AF = {} -- Table for Auxiliary functions ExportScript.NoLuaExportBeforeNextFrame = false diff --git a/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua b/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua index 8298fcc..18e637a 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua @@ -1,7 +1,7 @@ --- A-10A Export --- Version 1.0.2 +-- A-10A ExportScript.FoundFCModule = true +ExportScript.Version.A10A = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua b/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua index c2e6922..cd569f7 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua @@ -1,7 +1,7 @@ --- A-10C Export --- Version 1.0.2 +-- A-10C ExportScript.FoundDCSModule = true +ExportScript.Version.A10C = "1.1.0" ExportScript.ConfigEveryFrameArguments = { @@ -1064,12 +1064,12 @@ function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) local ltmp1 = 0 - for ltmp2 = 0, 20, 1 do + 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 -]] + ]] --[[ -- LITENING_INTERFACE local lLITENING_INTERFACE = GetDevice(11) diff --git a/Scripts/DCS-ExportScript/ExportsModules/AJS37.lua b/Scripts/DCS-ExportScript/ExportsModules/AJS37.lua index f1212a0..0f45b4f 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/AJS37.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/AJS37.lua @@ -1,7 +1,7 @@ --- AJS37 Export --- Version 1.0.2 +-- AJS37 ExportScript.FoundDCSModule = true +ExportScript.Version.AJS37 = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/AV8BNA.lua b/Scripts/DCS-ExportScript/ExportsModules/AV8BNA.lua new file mode 100644 index 0000000..a187806 --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/AV8BNA.lua @@ -0,0 +1,1433 @@ +-- AV8BNA + +ExportScript.FoundDCSModule = true +ExportScript.Version.AV8BNA = "1.1.0" + +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 + ]] + -- LAMPS -------------------------------------- + --MIP INNER LEFT SIDE + [196] = "%.f", --Master Caution (yellow) + [326] = "%.f", --L FUEL + [327] = "%.f", --R FUEL + [328] = "%.f", --15 Sek + [329] = "%.f", --MFS + [330] = "%.f", --BINGO + [331] = "%.f", --H2O + --MIP RIGHT SIDE + [197] = "%.f", --Master Warning (red) + [334] = "%.f", --FIRE + [335] = "%.f", --LAW + [336] = "%.f", --FLAPS + [337] = "%.f", --L TANK + [338] = "%.f", --R TANK + [339] = "%.f", --HHYD + [340] = "%.f", --GEAR + [341] = "%.f", --OT + [342] = "%.f", --JPTL + [343] = "%.f", --EFC + [344] = "%.f", --GEN + --EYEBROW LIGHTS RIGHT SIGHT + [276] = "%.f", --SAM + [277] = "%.f", --CW + [278] = "%.f", --AI + [279] = "%.f", --AAA + --MIP OUTER LEFT SIDE + [283] = "%.f", --NAV + [285] = "%.f", --VSTOL + [281] = "%.f", --A/G + [451] = "%.f", --SEL + [452] = "%.f", --CMBT + [453] = "%.f", --STO + --CANOPY FRAME + [750] = "%.f", --LEFT + [751] = "%.f", --READY + [752] = "%.f", --RIGHT + --GEAR LEVER + [446] = "%.f", --(red warning light) + --CAUTION PANEL (from upper left to lower right) + [560] = "%.f", --OXY + [561] = "%.f", --WSLD + [562] = "%.f", --HYD 1 + [563] = "%.f", --HYD 2 + [564] = "%.f", --L PUMP + [565] = "%.f", --R PUMP + [566] = "%.f", --L TRANS + [567] = "%.f", --R TRANS + [568] = "%.f", --FLAPS 1 + [569] = "%.f", --FLAPS 2 + [570] = "%.f", --AUT FLP + [571] = "%.f", --PROP + [572] = "%.f", --LIDS + [573] = "%.f", --OIL + [574] = "%.f", --APU GEN + [575] = "%.f", --"--" + [576] = "%.f", --GPS + [577] = "%.f", --DEP RES + [578] = "%.f", --DC + [579] = "%.f", --STBY TR + [580] = "%.f", --CS COOL + [581] = "%.f", --LOAD + [582] = "%.f", --CANOPY + [583] = "%.f", --INS + [584] = "%.f", --SKID + [585] = "%.f", --EFC + [586] = "%.f", --NWS + [587] = "%.f", --AFC + [588] = "%.f", --C AUT + [589] = "%.f", --H2O SEL + [590] = "%.f", --APU + [591] = "%.f", --PITCH + [592] = "%.f", --IFF + [593] = "%.f", --SPD BRK + [594] = "%.f", --DROOP + [595] = "%.f", --ROLL + [596] = "%.f", --AFT BAY + [597] = "%.f", --AV BIT -----MAYBE NOT WORKING !----- + [598] = "%.f", --"--" + [599] = "%.f", --YAW + [600] = "%.f", --CW NOGO + [601] = "%.f", --P JAM + [602] = "%.f", --JAM HOT + [603] = "%.f", --ENG EXC + [604] = "%.f", --P NOGO + [605] = "%.f", --CW JAM + [606] = "%.f", --REPLY + --ENGINE DISPLAY + [253] = "%.4f", --DUCT 1. DRUM + [254] = "%.4f", --DUCT 2. + [255] = "%.4f", --DUCT 3. + [256] = "%.4f", --RPM 1. DRUM + [257] = "%.4f", --RPM 2. + [258] = "%.4f", --RPM 3. + [259] = "%.4f", --RPM 4. + [260] = "%.4f", --FF 1. DRUM + [261] = "%.4f", --FF 2. + [262] = "%.4f", --FF 3. + [263] = "%.4f", --JPT 1. DRUM + [264] = "%.4f", --JPT 2. + [265] = "%.4f", --JPT 3. + [266] = "%.4f", --STAB(Arrow up/down) + [267] = "%.4f", --STAB 1. Number, 2.DRUM + [268] = "%.4f", --STAB 2. Number, 3. DRUM + [269] = "%.4f", --H2O 1. Number + [270] = "%.4f", --H2O 2. Number -----3. Number is fix !!---- + [179] = "%.f", --H2O CONTROLL LAMP + [271] = "%.4f", --NOZZLE POINTER + --FUEL PANEL DISPLAY + [365] = "%.4f", --ON/OFF FLAG + [366] = "%.4f", --TOT FUEL 1. DRUM + [367] = "%.4f", --TOT FUEL 2. + [368] = "%.4f", --TOT FUEL 3. + [369] = "%.4f", --TOT FUEL 4. + [370] = "%.4f", --TOT FUEL 5. + [371] = "%.4f", --LBS L 1. DRUM + [372] = "%.4f", --LBS L 2. + [373] = "%.4f", --LBS L 3. + [374] = "%.4f", --LBS L 4. + [375] = "%.4f", --LBS R 1. DRUM + [376] = "%.4f", --LBS R 2. + [377] = "%.4f", --LBS R 3. + [378] = "%.4f", --LBS R 4. + [381] = "%.4f", --BINGO 1. DRUM + [382] = "%.4f", --BINGO 2. + [383] = "%.4f", --BINGO 3. + [384] = "%.4f", --BINGO 4. + --UPPER AMARMENT PANEL + [385] = "%.4f", --MODE + [386] = "%.4f", --FUZ 1. DRUM + [387] = "%.4f", --FUR 2. + [392] = "%.4f", --InVT x 10 1. DRUM + [393] = "%.4f", --InVT x 10 2. + [394] = "%.4f", --InVT x 10 3. + [391] = "%.4f", --MULT + [389] = "%.4f", --QTY 1. Drum + [390] = "%.4f", --QTY 2. + --LOWER AMARMENT PANEL + [406] = "%.4f", --SET FLAG 1 + [408] = "%.4f", --SET FLAG 2 + [410] = "%.4f", --SET FLAG 3 + [412] = "%.4f", --SET FLAG 4 + [414] = "%.4f", --SET FLAG 5 + [416] = "%.4f", --SET FLAG 6 + [418] = "%.4f", --SET FLAG 7 + --GEAR PANEL DISPLAY --STATUS LIGHTS-- + [462] = "%.f", --NOSE GEAR (YELLOW) + [463] = "%.f", --NOSE GEAR (GREEN) + [464] = "%.f", --LEFR GEAR (YELLOW) + [465] = "%.f", --LEFT GEAR (GREEN) + [466] = "%.f", --RIGHT GEAR (YELLOW) + [467] = "%.f", --RIGHT GEAR (GREEN) + [469] = "%.f", --MAIN GEAR (YELLOW) + [468] = "%.f", --MAIN GEAR (GREEN) + --BRAKE/ HYD DISPLAY + [550] = "%.4f", --BRAKE 1. DRUM + [551] = "%.4f", --BRAKE 2. + [552] = "%.4f", --BRAKE 3. + [553] = "%.4f", --HYD1 1. DRUM + [554] = "%.4f", --HYD1 2. + [555] = "%.4f", --HYD1 3. + [556] = "%.4f", --HYD2 1. DRUM + [557] = "%.4f", --HYD2 2. + [558] = "%.4f", --HYD2 3. + --FLAP POSITION DISPLAY + [455] = "%.4f", --FLAP POS 1. DRUM + [456] = "%.4f", --FLAP POS 2. DRUM + -- INSTRUMENTS ------------------------------------------------ + ---STBY MIP + --ADI + [349] = "%.4f", --ADI DRUM UO/DWN CLIMB/DESCEND + [348] = "%.4f", --ADI DRUM LEFR RIGHT (BANK) + [347] = "%.4f", --OFF FLAG + --AIRSPEED + [346] = "%.4f", --KNT POINTER SHORT + [345] = "%.4f", --KNT POINTER LONG + --ALTIMETER + [352] = "%.4f", --ALT POINTER + [355] = "%.4f", --ALT DIGITAL 1. NUMBER + [354] = "%.4f", --ALT DIGITAL 2. + [353] = "%.4f", --ALT DIGITAL 3. + [356] = "%.4f", --IN HG 1. NUMBER + [357] = "%.4f", --IN HG 2. + [358] = "%.4f", --IN HG 3. + [359] = "%.4f", --IN HG 4. + --AOA + [360] = "%.4f", --AOA FLAG + [361] = "%.4f", --AOA POINTER + --VVI + [362] = "%.4f", --VVI POINTER + --SLIP INDICATOR + [363] = "%.4f", --BALL + ---SIDE PANELS LEFT + --AILERON METER + [473] = "%.4f", --AILERON NEEDLE + --RUDDER + [474] = "%.4f", --RUDDER NEEDLE + ---SIDE PANELS RIGHT + --ACCU METER + [559] = "%.4f", --ACCU POINTER + --CABIN PRESSURE + [607] = "%.4f", --CABIN PRESS POINTER + --BATTERY (VOLT METER) + [608] = "%.4f", --VOLT METER POINTER + ---Compass + [753] = "%.4f", --Compassrose N-> S (rotate) + [754] = "%.4f", --Compassrose Up / Down + [755] = "%.4f", --Compassrose bank + ---CLOCK + [759] = "%.4f", --POINTER HOUR + [760] = "%.4f", --POINTER MINUTE + [761] = "%.4f", --POINTER SECOND + ---STOPWATCH + --NOTHING FOUND YET + --CABIN LIGHTNING + [180] = "%.f", --FLOOD + [182] = "%.f", --MIP BACKLIGHTING + [183] = "%.f", --LEFT AND RIGHT SIDEPANEL LIGHTING + [184] = "%.f", --WHISKEY COMPASS BACKLIGHT (LEFT CANOPY FRAME) +} + +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- Master Modes Panel + [282] = "%.1f", --Nav Master Mode selector + [284] = "%.1f", --VSTOL Master Mode Selector + [280] = "%.1f", --AG Master Mode Selector + -- Engine Display Panel + [272] = "%.4f", --EDP Brightness Control + [655] = "%1d", --EDP BIT Button + -- HUD Control Panel + [288] = "%.4f", --HUD + [289] = "%.4f", --HUD Off/Brightness Control + [290] = "%.1f", --HUD Display Mode Switch + [291] = "%.4f", --HUD Video Brightness Control + [292] = "%.4f", --HUD Video Contrast Control + [293] = "%1d", --HUD Altitude Selector Switch + -- UFC Panel + [302] = "%1d", --UFC Button 1 + [303] = "%1d", --UFC Button 2/N + [304] = "%1d", --UFC Button 3 + [306] = "%1d", --UFC Button 4/W + [307] = "%1d", --UFC Button 5 + [308] = "%1d", --UFC Button 6/E + [310] = "%1d", --UFC Button 7 + [311] = "%1d", --UFC Button 8/S + [312] = "%1d", --UFC Button 9 + [315] = "%1d", --UFC Button 0 + [316] = "%1d", --UFC Button . + [313] = "%1d", --UFC Button - + [314] = "%1d", --ENTER Data Button + [305] = "%1d", --Clear Entry Button + [294] = "%1d", --Timer Function Selector + [324] = "%1d", --Altitude Function Selector + [318] = "%1d", --IFF Function Selector + [319] = "%1d", --TACAN Function Selector + [320] = "%1d", --All Weather Landing Function Selector + [317] = "%1d", --Radalt/TACAN/AWL/IFF ON/OFF Toggle + [325] = "%1d", --EMCON ON/OFF Toggle + [296] = "%1d", --Target-Of-Opportunity Selector + [322] = "%1d", --Waypoint Overfly INS Update Selector + [321] = "%1d", --Weapons Function Selector + [323] = "%1d", --Radar Beacon Function Selector + [297] = "%1d", --I/P Button + [309] = "%1d", --Save Data Button + [295] = "%1d", --Display Brightness Control + [298] = "%.4f", --Comm 1 Volume Control + [299] = "%.4f", --Comm 2 Volume Control + [300] = "%.4f", --Comm 1 Channel Selector + [301] = "%.4f", --Comm 2 Channel Selector + -- ODU Panel + [250] = "%1d", --ODU Option1 + [251] = "%1d", --ODU Option2 + [252] = "%1d", --ODU Option3 + [248] = "%1d", --ODU Option4 + [249] = "%1d", --ODU Option5 + -- Master Caution/Warning Panel + [198] = "%1d", --Master Caution + [199] = "%1d", --Master Warning + -- Fuel Quantity Indicator + [379] = "%.1f", --Fuel Totalizer Selector + [380] = "%.4f", --Bingo Fuel Set Knob + -- MPCD left + [200] = "%1d", --MPCD Left Button 1 + [201] = "%1d", --MPCD Left Button 2 + [202] = "%1d", --MPCD Left Button 3 + [203] = "%1d", --MPCD Left Button 4 + [204] = "%1d", --MPCD Left Button 5 + [205] = "%1d", --MPCD Left Button 6 + [206] = "%1d", --MPCD Left Button 7 + [207] = "%1d", --MPCD Left Button 8 + [208] = "%1d", --MPCD Left Button 9 + [209] = "%1d", --MPCD Left Button 10 + [210] = "%1d", --MPCD Left Button 11 + [211] = "%1d", --MPCD Left Button 12 + [212] = "%1d", --MPCD Left Button 13 + [213] = "%1d", --MPCD Left Button 14 + [214] = "%1d", --MPCD Left Button 15 + [215] = "%1d", --MPCD Left Button 16 + [216] = "%1d", --MPCD Left Button 17 + [217] = "%1d", --MPCD Left Button 18 + [218] = "%1d", --MPCD Left Button 19 + [219] = "%1d", --MPCD Left Button 20 + [220] = "%1d", --MPCD Left Display DAY/NIGHT Mode + [221] = "%1d", --MPCD Left Display Symbology + [222] = "%1d", --MPCD Left Display Gain + [223] = "%1d", --MPCD Left Display Contrast + [194] = "%.4f", --MPCD Left Off/Brightness Control + -- MPCD Right + [224] = "%1d", --MPCD Right Button 1 + [225] = "%1d", --MPCD Right Button 2 + [226] = "%1d", --MPCD Right Button 3 + [227] = "%1d", --MPCD Right Button 4 + [228] = "%1d", --MPCD Right Button 5 + [229] = "%1d", --MPCD Right Button 6 + [230] = "%1d", --MPCD Right Button 7 + [231] = "%1d", --MPCD Right Button 8 + [232] = "%1d", --MPCD Right Button 9 + [233] = "%1d", --MPCD Right Button 10 + [234] = "%1d", --MPCD Right Button 11 + [235] = "%1d", --MPCD Right Button 12 + [236] = "%1d", --MPCD Right Button 13 + [237] = "%1d", --MPCD Right Button 14 + [238] = "%1d", --MPCD Right Button 15 + [239] = "%1d", --MPCD Right Button 16 + [240] = "%1d", --MPCD Right Button 17 + [241] = "%1d", --MPCD Right Button 18 + [242] = "%1d", --MPCD Right Button 19 + [243] = "%1d", --MPCD Right Button 20 + [244] = "%1d", --MPCD Right Display DAY/NIGHT Mode + [245] = "%1d", --MPCD Right Display Symbology + [246] = "%1d", --MPCD Right Display Gain + [247] = "%1d", --MPCD Right Display Contrast + [195] = "%.4f", --MPCD Right Off/Brightness Control + -- Armament Control Panel ACP + [395] = "%.1f", --Manual Release Control Knob + [396] = "%1d", --Armament Mode Control + [397] = "%1d", --Fuzing Control + [398] = "%1d", --Quantity Selector (Tens) + [399] = "%1d", --Quantity Selector (Units) + [400] = "%1d", --Multiple Release Control + [401] = "%1d", --Release Interval Control (Hundreds) + [402] = "%1d", --Release Interval Control (Tens) + [403] = "%1d", --Release Interval Control (Units) + [404] = "%1d", --Jettison Mode Selector + [405] = "%1d", --Jettison Stores + [407] = "%1d", --Select Station 1 Toggle + [409] = "%1d", --Select Station 2 Toggle + [411] = "%1d", --Select Station 3 Toggle + [413] = "%1d", --Select Station 4 Toggle + [415] = "%1d", --Select Station 5 Toggle + [417] = "%1d", --Select Station 6 Toggle + [419] = "%1d", --Select Station 7 Toggle + [420] = "%1d", --Ground IR Cool Switch + -- Master Armament Panel + [286] = "%1d", --Launch Flare Salvo + [287] = "%1d", --Master Arm Switch + -- ECM Control Panel + [273] = "%.1f", --RWR Power/Volume Button + [274] = "%.1f", --Decoy Dispenser Control + [275] = "%.1f", --Jammer Control + -- Landing Gear/Flaps Control Panel + [447] = "%1d", --Emergency Landing Gear Lever + [448] = "%1d", --Gear Down Lock Override Button + [454] = "%.1f", --Flaps Mode Switch + [457] = "%.1f", --Flaps Power Switch + [458] = "%1d", --Emergency Jettison Button + [459] = "%.1f", --Anti-Skid Switch + [460] = "%1d", --Flaps BIT Button + [461] = "%1d", --Landing Gear Lever + [470] = "%1d", --Landing Gear Emergency Battery Lever + -- Combat/Water Panel + [449] = "%.1f", --H2O Mode Switch + [450] = "%1d", --CMBT Thrust Button + -- Bulkhead Switches + [501] = "%1d", --MFS Emergency Lever + [1121] = "%1d", --Stopwatch Start/Stop + [1122] = "%1d", --Stopwatch Lap/Reset + -- Seat + [800] = "%1d", --Seat Ground Safety Lever + + ------------------------------------------------------------------- + -- CENTER CONSOLE: + ------------------------------------------------------------------- +-- Flights Instruments Panel + [364] = "%.4f", --NAV Course Setting + [653] = "%.4f", --Barometric Pressure Calibration + [351] = "%1d", --Backup ADI Cage/Pitch Adjust Knob +-- Miscelaneous Switch Panel + [422] = "%1d", --Video Recorder System Mode Switch + [423] = "%1d", --Video Recorder System Display Selector Switch + [424] = "%1d", --DMT Toggle On/Off + [425] = "%.1f", --Dual Processor Mode Selector Switch + [426] = "%1d", --Probe Heat Mode Switch + [427] = "%.1f", --Mission Computer Mode Switch + [429] = "%1d", --FLIR Power Switch + -- INS Panel + [421] = "%.1f", --INS Mode Knob + ------------------------------------------------------------------- +-- LEFT CONSOLE: +------------------------------------------------------------------- +-- Trim Panel + [471] = "%.1f", --RPS/YAW Trim Switch + [472] = "%.1f", --Trim Mode Switch +-- SAAHS Panel + [476] = "%1d", --Alt Hold Switch + [475] = "%1d", --Q Feel Switch + [477] = "%.1f", --AFC Switch + [478] = "%1d", --SAS Yaw Switch" + [479] = "%1d", --SAS Roll Switch + [480] = "%1d", --SAS Pitch Switch +-- Throttle Quadrant + [481] = "%1d", --JPTL Switch + [483] = "%1d", --Rudder Trim Switch + [482] = "%1d", --EMS Button + [484] = "%1d", --Manual Fuel Switch + [485] = "%,4f", --Throttle Lever Friction Knob + [486] = "%.4f", --Nozzle Lever Friction Knob + [490] = "%1d", --Throttle Cutoff Lever + [489] = "%1d", --Parking Brake Lever + [487] = "%.4f", --Nozzle Control Lever + [488] = "%.4f", --STO Stop Lever + --[491] = "%1d", --Air Brake Switch +-- Fuel Panel + [504] = "%1d", --Fuel Proportioner + [505] = "%.1f", --Fuel Pump L Switch + [506] = "%.1f", --Fuel Pump R Switch + [507] = "%.1f", --Air Refueling Probe Switch + [508] = "%1d", --Fuel Dump L Switch + [509] = "%1d", --Fuel Dump R Switch" +-- External Lights Panel + [472] = "%.1f", --Landing/Taxi Lights Switch + [503] = "%.1f", --External Lights Mode Switch" + [510] = "%.4f", --Formation Lights Knob + [511] = "%1d", --Position Lights Switch + [512] = "%1d", --Anti-Collision Lights Switch + [513] = "%1d", --External Auxiliary Lights Switch +-- Pilot Service Panel + [514] = "%1d", --"Oxygen Switch + [515] = "%1d", --H2O Dump Switch + [516] = "%1d", --LIDS Switch + [517] = "%1d", --ENG RPM Switch + [518] = "%1d", --EFC Switch +-- Bulkhead Switches + [502] = "%1d", --Seat Adjustment Switch + [519] = "%1d", --Fuel Shutoff Lever + [520] = "%1d", --DECS Switch +------------------------------------------------------------------- +-- RIGHT CONSOLE: +------------------------------------------------------------------- +-- Electrical Panel + [609] = "%.1f", --DC Test Switch + [610] = "%.1f", --APU Generator Switch + [611] = "%1d", --Engine Start Switch + [612] = "%.1f", --Generator Switch + [613] = "%.1f", --Battery Switch +-- V/UHF Radio Panel + [614] = "%.4f", --V/UHF RSC Volume Knob + [615] = "%.3f", --V/UHF RSC Chan/Freq Knob + [616] = "%.1f", --V/UHF RSC Operational Mode Switch + [617] = "%1d", --V/UHF RSC Ancillary Mode Pointer + [618] = "%1d", --V/UHF RSC Ancillary Mode Switch + [619] = "%.1f", --V/UHF RSC Frequency Mode Switch + [620] = "%1d", --V/UHF RSC LOAD/OFST Switch +-- ACNIP + [621] = "%1d", --ACNIP Mode Switch + [622] = "%1d", --KY-1 Cipher Type Selector Switch + [623] = "%1d", --KY-2 Cipher Type Selector Switch + [624] = "%1d", --KY-1 Code/Mode Switch + [625] = "%1d", --KY-2 Code/Mode Switch + [626] = "%1d", --ACNIP Radio Selector Switch + [627] = "%1d", --KY-58 Codes Clear Switch + [628] = "%1d", --KY-58 Remote Codes Load Switch +-- ICS + [629] = "%.4f", --ICS Aux Volume Knob + [630] = "%.4f", --ICS Ground Volume Knob + [631] = "%.1f", --ICS Mic Operational Mode Switch +-- IFF + [632] = "%1d", --IFF Operational Mode Switch + [633] = "%1d", --IFF Crypto Mode Switch +-- Interior Lights Panel + [634] = "%1d", --Compass Light/Test Lights + [635] = "%.4f", --Instruments Lights + [636] = "%.4f", --Console Lights + [637] = "%.4f", --Flood Lights + [638] = "%.4f", --Annunciator Lights +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(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 + 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)) + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025)) + ]] +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 + 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)) + ]] + + --ENGINE DISPLAY + + --[253] = "%.4f", --DUCT 1. DRUM + --[254] = "%.4f", --DUCT 2. + --[255] = "%.4f", --DUCT 3. + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(253) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(254) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(255) * 10) + + ExportScript.Tools.SendData(2001, digits[1]..digits[2]..digits[3]) + + --[256] = "%.4f", --RPM 1. DRUM + --[257] = "%.4f", --RPM 2. + --[258] = "%.4f", --RPM 3. + --[259] = "%.4f", --RPM 4. + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(256) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(257) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(258) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(259) * 10) + + ExportScript.Tools.SendData(2002, digits[1]..digits[2]..digits[3]..digits[4]) + + --[260] = "%.4f", --FF 1. DRUM + --[261] = "%.4f", --FF 2. + --[262] = "%.4f", --FF 3. + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(260) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(261) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(262) * 10) + + ExportScript.Tools.SendData(2003, digits[1]..digits[2]..digits[3]) + + --[263] = "%.4f", --JPT 1. DRUM + --[264] = "%.4f", --JPT 2. + --[265] = "%.4f", --JPT 3. + --[266] = "%.4f", --STAB(Arrow up/down) + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(263) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(264) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(265) * 10) + + ExportScript.Tools.SendData(2004, digits[1]..digits[2]..digits[3]) + + --[267] = "%.4f", --STAB 1. Number, 2. DRUM + --[268] = "%.4f", --STAB 2. Number, 3. DRUM + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(267) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(268) * 10) + + ExportScript.Tools.SendData(2005, digits[1]..digits[2]) + + --[269] = "%.4f", --H2O 1. Number + --[270] = "%.4f", --H2O 2. Number -----3. Number is fix !!---- + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(269) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(270) * 10) + + ExportScript.Tools.SendData(2006, digits[1]..digits[2]) + + -- Fuel Total + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(366) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(367) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(368) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(369) * 10) + digits[5] = string.format("%1.0f",mainPanelDevice:get_argument_value(370) * 10) + + ExportScript.Tools.SendData(2010, digits[1]..digits[2]..digits[3]..digits[4]..digits[5]) + + --[371] = "%.4f", --LBS L 1. DRUM + --[372] = "%.4f", --LBS L 2. + --[373] = "%.4f", --LBS L 3. + --[374] = "%.4f", --LBS L 4. + + -- Fuel Left + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(371) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(372) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(373) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(374) * 10) + + ExportScript.Tools.SendData(2011, digits[1]..digits[2]..digits[3]..digits[4]) + + --[375] = "%.4f", --LBS R 1. DRUM + --[376] = "%.4f", --LBS R 2. + --[377] = "%.4f", --LBS R 3. + --[378] = "%.4f", --LBS R 4. + + -- Fuel Right + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(375) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(376) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(377) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(378) * 10) + + ExportScript.Tools.SendData(2012, digits[1]..digits[2]..digits[3]..digits[4]) + + --[381] = "%.4f", --BINGO 1. DRUM + --[382] = "%.4f", --BINGO 2. + --[383] = "%.4f", --BINGO 3. + --[384] = "%.4f", --BINGO 4. + + -- Fuel Bingo + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(381) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(382) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(383) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(384) * 10) + + ExportScript.Tools.SendData(2013, digits[1]..digits[2]..digits[3]..digits[4]) + + --FLAP POSITION DISPLAY + --[455] = "%.4f", --FLAP POS 1. DRUM + --[456] = "%.4f", --FLAP POS 2. DRUM + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(455) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(456) * 10) + + ExportScript.Tools.SendData(2014, digits[1]..digits[2]) + + --BRAKE/HYD DISPLAY + --[550] = "%.4f", --BRAKE 1. DRUM + --[551] = "%.4f", --BRAKE 2. + --[552] = "%.4f", --BRAKE 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(550) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(551) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(552) * 10) + + ExportScript.Tools.SendData(2015, digits[1]..digits[2]..digits[3]) + + --[553] = "%.4f", --HYD1 1. DRUM + --[554] = "%.4f", --HYD1 2. + --[555] = "%.4f", --HYD1 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(553) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(554) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(555) * 10) + + ExportScript.Tools.SendData(2016, digits[1]..digits[2]..digits[3]) + + --[556] = "%.4f", --HYD2 1. DRUM + --[557] = "%.4f", --HYD2 2. + --[558] = "%.4f", --HYD2 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(556) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(557) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(558) * 10) + + ExportScript.Tools.SendData(2017, digits[1]..digits[2]..digits[3]) + + --UPPER AMARMENT PANEL + --[385] = "%.4f", --MODE + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(385) * 10) + + if digits[1] == "0" then + ExportScript.Tools.SendData(2018, " - ") + elseif digits[1] == "2" then + ExportScript.Tools.SendData(2018, "AUT") + elseif digits[1] == "4" then + ExportScript.Tools.SendData(2018, "CP ") + elseif digits[1] == "6" then + ExportScript.Tools.SendData(2018, "DSL") + elseif digits[1] == "8" then + ExportScript.Tools.SendData(2018, "DR ") + elseif digits[1] == "10" then + ExportScript.Tools.SendData(2018, "AGM") + end + + --[386] = "%.4f", --FUZ 1. DRUM + --[387] = "%.4f", --FUR 2. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(386) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(387) * 10) + + ExportScript.Tools.SendData(2019, digits[1]..digits[2]) + + --[392] = "%.4f", --InVT x 10 1. DRUM + --[393] = "%.4f", --InVT x 10 2. + --[394] = "%.4f", --InVT x 10 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(392) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(393) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(394) * 10) + + ExportScript.Tools.SendData(2020, digits[1]..digits[2]..digits[3]) + + --[391] = "%.4f", --MULT + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(391) * 10) + + ExportScript.Tools.SendData(2021, digits[1]) + + --[389] = "%.4f", --QTY 1. Drum + --[390] = "%.4f", --QTY 2. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(389) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(390) * 10) + + ExportScript.Tools.SendData(2022, digits[1]..digits[2]) + + --> McMicha + + -- UFC Displays + local lUfcDisplays = list_indication(3) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lUfcDisplays : '..ExportScript.Tools.dump(lUfcDisplays)) + end + + local to1, to2, from1, from2, lUFC_Chnl1, lUFC_Chnl2, lUFC_Left_Position, lUFC_Right_Position, lUFC_Display = nil, nil, nil, nil, "", "", "", "", "" + to1, to2 = lUfcDisplays:find("UFC_DISPLAY") + if (to1 ~= nil) then + from1, from2 = lUfcDisplays:find("ufc_chnl_1_.%c") + if (from2 ~= nill) then + to1, to2 = lUfcDisplays:find("%c", from2+2) + if (to1 ~= nil) then + lUFC_Chnl1 = lUfcDisplays:sub(from2+1, to1-1) + end + end + + from1, from2 = lUfcDisplays:find("ufc_chnl_2_.%c", to2) + if (from2 ~= nill) then + to1, to2 = lUfcDisplays:find("%c", from2+2) + if (to1 ~= nil) then + lUFC_Chnl2 = lUfcDisplays:sub(from2+1, to1-1) + end + end + + from1, from2 = lUfcDisplays:find("ufc_left_position%c", to2) + if (from2 ~= nill) then + to1, to2 = lUfcDisplays:find("%c", from2+2) + if (to1 ~= nil) then + lUFC_Left_Position = lUfcDisplays:sub(from2+1, to1-1) + end + end + + from1, from2 = lUfcDisplays:find("ufc_right_position%c", to2) + if (from2 ~= nill) then + if (from2 ~= nil) then + lUFC_Right_Position = lUfcDisplays:sub(from2+1) + lUFC_Right_Position = lUFC_Right_Position:gsub("%c", "") + end + end + end + + local lRep = 8 - lUFC_Left_Position:len() - lUFC_Right_Position:len() + + lUFC_Display = lUFC_Left_Position..string.rep(" ", lRep)..lUFC_Right_Position + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("lUFC_Chnl1: "..string.format("%s", lUFC_Chnl1)) -- string with max 2 charachters + ExportScript.Tools.WriteToLog("lUFC_Chnl2: "..string.format("%s", lUFC_Chnl2)) -- string with max 2 charachters + ExportScript.Tools.WriteToLog("lUFC_Left_Position: "..string.format("%s", lUFC_Left_Position)) + ExportScript.Tools.WriteToLog("lUFC_Right_Position: "..string.format("%s", lUFC_Right_Position)) + ExportScript.Tools.WriteToLog("lUFC_Display: "..string.format("%s", lUFC_Display)) -- string with max 8 charachters + end + ExportScript.Tools.SendData(2023, string.format("%s", lUFC_Chnl1)) -- string with max 2 charachters + ExportScript.Tools.SendData(2024, string.format("%s", lUFC_Chnl2)) -- string with max 2 charachters + ExportScript.Tools.SendData(2025, string.format("%s", lUFC_Display)) -- string with max 8 charachters + + -- ODU Display + local lODUDisplays = list_indication(4) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lODUDisplays : '..ExportScript.Tools.dump(lODUDisplays)) + end + + local to1, to2, from1, from2 = nil, nil, nil, nil + local lODU_Text = {"","","","",""} + local lODU_select = " " + + to1, to2 = lODUDisplays:find("ODU_DISPLAY") + if (to1 ~= nil) then + for lIndex = 1, 5, 1 do + lODU_select = " " + + from1, from2 = lODUDisplays:find("ODU_Option_"..lIndex.."_Slc%c") + if (from2 ~= nill) then + to1, to2 = lODUDisplays:find("%c", from2+2) + if (to1 ~= nil) then + lODU_select = lODUDisplays:sub(from2+1, to1-1) + lODU_select = lODU_select:gsub(":", "¦") + end + end + + from1, from2 = lODUDisplays:find("ODU_Option_"..lIndex.."_Text%c") + if (from2 ~= nill) then + to1, to2 = lODUDisplays:find("%c", from2+2) + if (to1 ~= nil) then + lODU_Text[lIndex] = lODUDisplays:sub(from2+1, to1-1) + end + end + + lODU_Text[lIndex] = lODU_select..lODU_Text[lIndex] + end -- for + end + + -- string with max 5 characters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("lODU_Text1: "..string.format("%s", lODU_Text[1])) + ExportScript.Tools.WriteToLog("lODU_Text2: "..string.format("%s", lODU_Text[2])) + ExportScript.Tools.WriteToLog("lODU_Text3: "..string.format("%s", lODU_Text[3])) + ExportScript.Tools.WriteToLog("lODU_Text4: "..string.format("%s", lODU_Text[4])) + ExportScript.Tools.WriteToLog("lODU_Text5: "..string.format("%s", lODU_Text[5])) + end + ExportScript.Tools.SendData(2026, string.format("%s", lODU_Text[1])) + ExportScript.Tools.SendData(2027, string.format("%s", lODU_Text[2])) + ExportScript.Tools.SendData(2028, string.format("%s", lODU_Text[3])) + ExportScript.Tools.SendData(2029, string.format("%s", lODU_Text[4])) + ExportScript.Tools.SendData(2030, string.format("%s", lODU_Text[5])) + + -- UVHF Display + local lUVHFDisplay = list_indication(5) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lUVHFDisplay : '..ExportScript.Tools.dump(lUVHFDisplay)) + end + + local to1, to2, from1, from2, lUVHF_Channel, lUHF_Freq_Left, lacnip_1_label_mode, lacnip_1_mode, lacnip_1_label_code, lacnip_1_code, lacnip_2_label_mode, lacnip_2_mode, lacnip_2_label_code, lacnip_2_code = nil, nil, nil, nil, "", "", "", "", "", "", "", "", "", "" + local lacnip_line = {"", "", "", ""} + + to1, to2 = lUVHFDisplay:find("UVHF_DISPLAY") + if (to1 ~= nil) then + from1, from2 = lUVHFDisplay:find("uvhf_channel%c") + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lUVHF_Channel = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("uvhf_freq_left%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lUHF_Freq_Left = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_label_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_label_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_label_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_label_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_label_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_label_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_label_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_label_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + end + + lacnip_line[1] = lacnip_1_label_mode.." "..lacnip_2_label_mode + local lRep1 = 4 - lacnip_1_mode:len() + local lRep2 = 4 - lacnip_2_mode:len() + lacnip_line[2] = string.rep(" ", lRep1)..lacnip_1_mode.." "..lacnip_2_mode..string.rep(" ", lRep2) + lacnip_line[3] = lacnip_1_label_code.." "..lacnip_2_label_code + lRep1 = 4 - lacnip_1_code:len() + lRep2 = 4 - lacnip_2_code:len() + lacnip_line[4] = string.rep(" ", lRep1)..lacnip_1_code.." "..lacnip_2_code..string.rep(" ", lRep2) + + if ExportScript.Config.Debug then + -- string with max 2 charachters + ExportScript.Tools.WriteToLog("lUVHF_Channel: "..string.format("%s", lUVHF_Channel)) + -- string with max 7 charachters + ExportScript.Tools.WriteToLog("lUHF_Freq_Left: "..string.format("%s", lUHF_Freq_Left)) + -- string with max 10 charachters + ExportScript.Tools.WriteToLog("lacnip_line1: '"..string.format("%s", lacnip_line[1]).."'") + ExportScript.Tools.WriteToLog("lacnip_line2: '"..string.format("%s", lacnip_line[2]).."'") + ExportScript.Tools.WriteToLog("lacnip_line3: '"..string.format("%s", lacnip_line[3]).."'") + ExportScript.Tools.WriteToLog("lacnip_line4: '"..string.format("%s", lacnip_line[4]).."'") + end + -- string with max 2 charachters + ExportScript.Tools.SendData(2031, string.format("%s", lUVHF_Channel)) + -- string with max 7 charachters + ExportScript.Tools.SendData(2032, string.format("%s", lUHF_Freq_Left)) + -- string with max 10 charachters + ExportScript.Tools.SendData(2033, string.format("%s", lacnip_line[1])) + ExportScript.Tools.SendData(2034, string.format("%s", lacnip_line[2])) + ExportScript.Tools.SendData(2035, string.format("%s", lacnip_line[3])) + ExportScript.Tools.SendData(2036, string.format("%s", lacnip_line[4])) + +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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025)) + ]] + + --===================================================================================== + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + -- list_indication get tehe value of cockpit displays + local ltmp1 = 0 + for ltmp2 = 0, 20, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + end + ]] +--[[ + -- getmetatable get function name from devices + local ltmp1 = 0 + for ltmp2 = 1, 70, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] + --ENGINE DISPLAY + + --[253] = "%.4f", --DUCT 1. DRUM + --[254] = "%.4f", --DUCT 2. + --[255] = "%.4f", --DUCT 3. + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(253) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(254) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(255) * 10) + + ExportScript.Tools.SendDataDAC(2001, digits[1]..digits[2]..digits[3]) + + --[256] = "%.4f", --RPM 1. DRUM + --[257] = "%.4f", --RPM 2. + --[258] = "%.4f", --RPM 3. + --[259] = "%.4f", --RPM 4. + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(256) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(257) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(258) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(259) * 10) + + ExportScript.Tools.SendDataDAC(2002, digits[1]..digits[2]..digits[3]..digits[4]) + + --[260] = "%.4f", --FF 1. DRUM + --[261] = "%.4f", --FF 2. + --[262] = "%.4f", --FF 3. + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(260) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(261) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(262) * 10) + + ExportScript.Tools.SendDataDAC(2003, digits[1]..digits[2]..digits[3]) + + --[263] = "%.4f", --JPT 1. DRUM + --[264] = "%.4f", --JPT 2. + --[265] = "%.4f", --JPT 3. + --[266] = "%.4f", --STAB(Arrow up/down) + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(263) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(264) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(265) * 10) + + ExportScript.Tools.SendDataDAC(2004, digits[1]..digits[2]..digits[3]) + + --[267] = "%.4f", --STAB 1. Number, 2. DRUM + --[268] = "%.4f", --STAB 2. Number, 3. DRUM + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(267) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(268) * 10) + + ExportScript.Tools.SendDataDAC(2005, digits[1]..digits[2]) + + --[269] = "%.4f", --H2O 1. Number + --[270] = "%.4f", --H2O 2. Number -----3. Number is fix !!---- + + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(269) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(270) * 10) + + ExportScript.Tools.SendDataDAC(2006, digits[1]..digits[2]) + + -- Fuel Total + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(366) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(367) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(368) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(369) * 10) + digits[5] = string.format("%1.0f",mainPanelDevice:get_argument_value(370) * 10) + + ExportScript.Tools.SendDataDAC(2010, digits[1]..digits[2]..digits[3]..digits[4]..digits[5]) + + --[371] = "%.4f", --LBS L 1. DRUM + --[372] = "%.4f", --LBS L 2. + --[373] = "%.4f", --LBS L 3. + --[374] = "%.4f", --LBS L 4. + + -- Fuel Left + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(371) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(372) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(373) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(374) * 10) + + ExportScript.Tools.SendDataDAC(2011, digits[1]..digits[2]..digits[3]..digits[4]) + + --[375] = "%.4f", --LBS R 1. DRUM + --[376] = "%.4f", --LBS R 2. + --[377] = "%.4f", --LBS R 3. + --[378] = "%.4f", --LBS R 4. + + -- Fuel Right + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(375) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(376) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(377) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(378) * 10) + + ExportScript.Tools.SendDataDAC(2012, digits[1]..digits[2]..digits[3]..digits[4]) + + --[381] = "%.4f", --BINGO 1. DRUM + --[382] = "%.4f", --BINGO 2. + --[383] = "%.4f", --BINGO 3. + --[384] = "%.4f", --BINGO 4. + + -- Fuel Bingo + ------------------------------------------------- + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(381) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(382) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(383) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(384) * 10) + + ExportScript.Tools.SendDataDAC(2013, digits[1]..digits[2]..digits[3]..digits[4]) + + --FLAP POSITION DISPLAY + --[455] = "%.4f", --FLAP POS 1. DRUM + --[456] = "%.4f", --FLAP POS 2. DRUM + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(455) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(456) * 10) + + ExportScript.Tools.SendDataDAC(2014, digits[1]..digits[2]) + + --BRAKE/HYD DISPLAY + --[550] = "%.4f", --BRAKE 1. DRUM + --[551] = "%.4f", --BRAKE 2. + --[552] = "%.4f", --BRAKE 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(550) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(551) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(552) * 10) + + ExportScript.Tools.SendDataDAC(2015, digits[1]..digits[2]..digits[3]) + + --[553] = "%.4f", --HYD1 1. DRUM + --[554] = "%.4f", --HYD1 2. + --[555] = "%.4f", --HYD1 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(553) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(554) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(555) * 10) + + ExportScript.Tools.SendDataDAC(2016, digits[1]..digits[2]..digits[3]) + + --[556] = "%.4f", --HYD2 1. DRUM + --[557] = "%.4f", --HYD2 2. + --[558] = "%.4f", --HYD2 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(556) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(557) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(558) * 10) + + ExportScript.Tools.SendDataDAC(2017, digits[1]..digits[2]..digits[3]) + + --UPPER AMARMENT PANEL + --[385] = "%.4f", --MODE + --[[ + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(385) * 10) + + if digits[1] == "0" then + ExportScript.Tools.SendDataDAC(2018, " - ") + elseif digits[1] == "2" then + ExportScript.Tools.SendDataDAC(2018, "AUT") + elseif digits[1] == "4" then + ExportScript.Tools.SendDataDAC(2018, "CP ") + elseif digits[1] == "6" then + ExportScript.Tools.SendDataDAC(2018, "DSL") + elseif digits[1] == "8" then + ExportScript.Tools.SendDataDAC(2018, "DR ") + elseif digits[1] == "10" then + ExportScript.Tools.SendDataDAC(2018, "AGM") + end + ]] + + --[386] = "%.4f", --FUZ 1. DRUM + --[387] = "%.4f", --FUR 2. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(386) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(387) * 10) + + ExportScript.Tools.SendDataDAC(2019, digits[1]..digits[2]) + + --[392] = "%.4f", --InVT x 10 1. DRUM + --[393] = "%.4f", --InVT x 10 2. + --[394] = "%.4f", --InVT x 10 3. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(392) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(393) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(394) * 10) + + ExportScript.Tools.SendDataDAC(2020, digits[1]..digits[2]..digits[3]) + + --[391] = "%.4f", --MULT + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(391) * 10) + + ExportScript.Tools.SendDataDAC(2021, digits[1]) + + --[389] = "%.4f", --QTY 1. Drum + --[390] = "%.4f", --QTY 2. + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(389) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(390) * 10) + + ExportScript.Tools.SendDataDAC(2022, digits[1]..digits[2]) + + +--> McMicha + + local lUVHFDisplay = list_indication(5) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lUVHFDisplay : '..ExportScript.Tools.dump(lUVHFDisplay)) + end + + local to1, to2, from1, from2, lUVHF_Channel, lUHF_Freq_Left, lacnip_1_label_mode, lacnip_1_mode, lacnip_1_label_code, lacnip_1_code, lacnip_2_label_mode, lacnip_2_mode, lacnip_2_label_code, lacnip_2_code = nil, nil, nil, nil, "-", "-", "", "", "", "", "", "", "", "" + local lacnip_line = {"", "", "", ""} + + to1, to2 = lUVHFDisplay:find("UVHF_DISPLAY") + if (to1 ~= nil) then + from1, from2 = lUVHFDisplay:find("uvhf_channel%c") + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lUVHF_Channel = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("uvhf_freq_left%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lUHF_Freq_Left = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_label_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_label_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_label_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_label_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_1_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_1_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_label_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_label_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_mode%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_mode = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_label_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_label_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + + from1, from2 = lUVHFDisplay:find("acnip_2_code%c", to2) + if (from2 ~= nil) then + to1, to2 = lUVHFDisplay:find("%c", from2+2) + if (to1 ~= nil) then + lacnip_2_code = lUVHFDisplay:sub(from2+1, to1-1) + end + end + end + + lacnip_line[1] = lacnip_1_label_mode.." "..lacnip_2_label_mode + local lRep1 = 4 - lacnip_1_mode:len() + local lRep2 = 4 - lacnip_2_mode:len() + lacnip_line[2] = string.rep(" ", lRep1)..lacnip_1_mode.." "..lacnip_2_mode..string.rep(" ", lRep2) + lacnip_line[3] = lacnip_1_label_code.." "..lacnip_2_label_code + lRep1 = 4 - lacnip_1_code:len() + lRep2 = 4 - lacnip_2_code:len() + lacnip_line[4] = string.rep(" ", lRep1)..lacnip_1_code.." "..lacnip_2_code..string.rep(" ", lRep2) + + if ExportScript.Config.Debug then + -- string with max 2 charachters + ExportScript.Tools.WriteToLog("lUVHF_Channel: "..string.format("%s", lUVHF_Channel)) + -- string with max 7 charachters + ExportScript.Tools.WriteToLog("lUHF_Freq_Left: "..string.format("%s", lUHF_Freq_Left)) + -- string with max 10 charachters + ExportScript.Tools.WriteToLog("lacnip_line1: '"..string.format("%s", lacnip_line[1]).."'") + ExportScript.Tools.WriteToLog("lacnip_line2: '"..string.format("%s", lacnip_line[2]).."'") + ExportScript.Tools.WriteToLog("lacnip_line3: '"..string.format("%s", lacnip_line[3]).."'") + ExportScript.Tools.WriteToLog("lacnip_line4: '"..string.format("%s", lacnip_line[4]).."'") + end + -- string with max 2 charachters + ExportScript.Tools.SendDataDAC(2031, string.format("%s", lUVHF_Channel)) + -- string with max 7 charachters + ExportScript.Tools.SendDataDAC(2032, string.format("%s", lUHF_Freq_Left)) + +--[[ + local TmpDevice1 = GetDevice(1) + if TmpDevice1 ~= nil then + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC get_DC_Bus_1_voltage: '..ExportScript.Tools.dump(TmpDevice1:get_DC_Bus_1_voltage())) + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC get_DC_Bus_2_voltage: '..ExportScript.Tools.dump(TmpDevice1:get_DC_Bus_2_voltage())) + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC get_AC_Bus_1_voltage: '..ExportScript.Tools.dump(TmpDevice1:get_AC_Bus_1_voltage())) + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC AC_Generator_1_on: '..ExportScript.Tools.dump(TmpDevice1:AC_Generator_1_on())) + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC AC_Generator_2_on: '..ExportScript.Tools.dump(TmpDevice1:AC_Generator_2_on())) + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC get_AC_Bus_2_voltage: '..ExportScript.Tools.dump(TmpDevice1:get_AC_Bus_2_voltage())) + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC DC_Battery_on: '..ExportScript.Tools.dump(TmpDevice1:DC_Battery_on())) + else + ExportScript.Tools.WriteToLog('TmpDevice1 ELECTRIC ist NIL') + end + + local TmpDevice2 = GetDevice(2) + if TmpDevice2 ~= nil then + ExportScript.Tools.WriteToLog('TmpDevice2 COMM1: '..ExportScript.Tools.dump(TmpDevice2:get_frequency())) + else + ExportScript.Tools.WriteToLog('TmpDevice2 COMM1 ist NIL') + end + + local TmpDevice3 = GetDevice(3) + if TmpDevice3 ~= nil then + ExportScript.Tools.WriteToLog('TmpDevice3 COMM2: '..ExportScript.Tools.dump(TmpDevice3:get_frequency())) + else + ExportScript.Tools.WriteToLog('TmpDevice3 COMM2 ist NIL') + end + + local TmpDevice29 = GetDevice(29) + if TmpDevice29 ~= nil then + ExportScript.Tools.WriteToLog('TmpDevice29 SMC get_station_info: '..ExportScript.Tools.dump(TmpDevice29:get_station_info())) + ExportScript.Tools.WriteToLog('TmpDevice29 SMC get_ECM_status: '..ExportScript.Tools.dump(TmpDevice29:get_ECM_status())) + ExportScript.Tools.WriteToLog('TmpDevice29 SMC get_chaff_count: '..ExportScript.Tools.dump(TmpDevice29:get_chaff_count())) + ExportScript.Tools.WriteToLog('TmpDevice29 SMC get_flare_count: '..ExportScript.Tools.dump(TmpDevice29:get_flare_count())) + ExportScript.Tools.WriteToLog('TmpDevice29 SMC get_target_range: '..ExportScript.Tools.dump(TmpDevice29:get_target_range())) + ExportScript.Tools.WriteToLog('TmpDevice29 SMC get_target_span: '..ExportScript.Tools.dump(TmpDevice29:get_target_span())) + else + ExportScript.Tools.WriteToLog('TmpDevice29 SMC ist NIL') + end + + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) +]] +--[[ funktion get_power() gibt es nicht.... + local TmpDevice17 = GetDevice(17) + if TmpDevice17 ~= nil then + ExportScript.Tools.WriteToLog('TmpDevice17 RWR: '..ExportScript.Tools.dump(TmpDevice3:get_power())) + else + ExportScript.Tools.WriteToLog('TmpDevice17 RWR ist NIL') + end +]] + +end + +----------------------------- +-- Custom functions -- +----------------------------- \ No newline at end of file diff --git a/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua b/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua index f09c269..d0c0cf1 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua @@ -1,7 +1,7 @@ -- Bf-109K-4 Kurfrst --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.Bf109K4 = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua b/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua index e504459..c6cdd18 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua @@ -1,7 +1,7 @@ -- Module Name Export --- Version ExportScript.FoundDCSModule = true +ExportScript.Version. = "1.1.X" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/F-15C.lua b/Scripts/DCS-ExportScript/ExportsModules/F-15C.lua index e95eac5..51ecffe 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/F-15C.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/F-15C.lua @@ -1,7 +1,7 @@ --- F-15C Export --- Version 1.0.2 +-- F-15C ExportScript.FoundFCModule = true +ExportScript.Version.F15C = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/F-5E-3.lua b/Scripts/DCS-ExportScript/ExportsModules/F-5E-3.lua index dae39a1..7a0218d 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/F-5E-3.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/F-5E-3.lua @@ -1,7 +1,7 @@ -- F-5E-3 --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.F5E3 = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua b/Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua index 6f678bd..315c574 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua @@ -1,7 +1,7 @@ -- F-86 Export --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.F86 = "1.1.0" --ExportScript.NoLuaExportBeforeNextFrame = true ExportScript.ConfigEveryFrameArguments = diff --git a/Scripts/DCS-ExportScript/ExportsModules/FA-18C_hornet.lua b/Scripts/DCS-ExportScript/ExportsModules/FA-18C_hornet.lua new file mode 100644 index 0000000..ee3d61a --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/FA-18C_hornet.lua @@ -0,0 +1,729 @@ +-- F/A-18C Export + +ExportScript.FoundDCSModule = true +ExportScript.Version.FA18C_hornet = "1.1.0" + +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 + ]] + -- Controlls + --[71] = "%.4f", -- StickPitch {-1, 0, 0.137, 0.5} {1, 0.12, 0, -0.726} + --[74] = "%.4f", -- StickRoll {-1, 1} + --[500] = "%.4f", -- Rudder {-1, 1} + --[501] = "%.4f", -- LeftWheelBrake + --[502] = "%.4f", -- RightWheelBrake + --[104] = "%.4f", -- LeftThrottle + --[105] = "%.4f", -- RightThrottle + --[495] = "%.4f", -- LeftFingerLift + --[496] = "%.4f", -- RightFingerLift + -- Electric Interface + [400] = "%.4f", -- VoltmeterU {16.0, 30.0}{0.0, 1.0} + [401] = "%.4f", -- VoltmeterE {16.0, 30.0}{0.0, 1.0} + -- Hydraulic Interface + [310] = "%.4f", -- HydIndLeft {0.0, 5000.0} {0.0, 1.0} + [311] = "%.4f", -- HydIndRight {0.0, 5000.0} {0.0, 1.0} + [242] = "%.4f", -- HydIndBrake {0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0}{0.0, 0.036, 0.338, 0.636, 0.924, 1.0} + -- Gear Interface + [228] = "%.4f", -- EmergGearDownHandle + [240] = "%.4f", -- EmergParkBrakeHandle + -- Instruments -------------------------- + -- Standby Pressure Altimeter AAU-52/A + [218] = "%.4f", -- Altimeter_100_footPtr {0.0, 1000.0} {0.0, 1.0} + [220] = "%.4f", -- Altimeter_10000_footCount {0.0, 9.0} {0.0, 1.0} + [219] = "%.4f", -- Altimeter_1000_footCount {0.0, 9.0} {0.0, 1.0} + [221] = "%.4f", -- pressure_setting_0 {0.0, 10.0} {0.0, 1.0} + [222] = "%.4f", -- pressure_setting_1 {0.0, 10.0} {0.0, 1.0} + [223] = "%.4f", -- pressure_setting_2 {0.0, 10.0} {0.0, 1.0} + -- Indicated Airspeed Indicator AVU-35/A + [217] = "%.4f", -- Airspeed {0.0, 60.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0} {0.0, 0.0445, 0.15, 0.348, 0.586, 0.636, 0.673, 0.715, 0.748, 0.782, 0.819, 0.849, 0.870, 0.898, 0.922, 0.950, 0.976, 1.0} + -- Vertical Speed Indicator AVU-53/A + [225] = "%.4f", -- Variometer {-6000.0, -4000.0, -3000.0, -2000.0, -1000.0, -500.0, 0.0, 500.0, 1000.0, 2000.0, 3000.0, 4000.0, 6000.0} { -1.0, -0.83, -0.73, -0.605, -0.40, -0.22, 0.0, 0.22, 0.40, 0.605, 0.73, 0.83, 1.0} + -- Clock + [278] = "%.4f", -- CLOCK_currtime_hour {0.0, 12.0} {0.0, 1.0} + [279] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} {0.0, 1.0} + [281] = "%.4f", -- CLOCK_elapsed_time_minutes {0.0, 60.0} {0.0, 1.0} + [280] = "%.4f", -- CLOCK_elapsed_time_seconds {0.0, 60.0} {0.0, 1.0} + -- ID-2163/A + [287] = "%.4f", -- Min_Height_Indicator_ID2163A {-0.03, 0.0, 0.5, 0.8, 1.0} {0.0, 0.031, 0.525, 0.802, 0.982} + [286] = "%.4f", -- Altitude_Pointer_ID2163A {-10.0, 0.0, 100.0, 200.0, 300.0, 400.0, 600.0, 800.0, 1000.0, 3000.0, 5000.0, 5100.0} {0.0, 0.048, 0.171, 0.296, 0.416, 0.530, 0.616, 0.706, 0.799, 0.886, 0.974, 0.98} + [288] = "%.4f", -- OFF_Flag_ID2163A + [290] = "%1d", -- Red_Lamp_ID2163A + [289] = "%1d", -- Green_Lamp_ID2163A + -- SAI + [205] = "%.4f", -- SAI_Pitch {-1.0, 1.0} + [206] = "%.4f", -- SAI_Bank {-1.0, 1.0} + [209] = "%.4f", -- SAI_attitude_warning_flag + [210] = "%.4f", -- SAI_manual_pitch_adjustment {0.0, 1.0} {-1.0, 1.0} + [207] = "%.4f", -- SAI_SlipBall {-1.0, 1.0} + [208] = "%.4f", -- SAI_RateOfTurn {-3.0, 3.0} {-1.0, 1.0} + [211] = "%.4f", -- SAI_vertical_pointer {-1.0, 1.0} + [212] = "%.4f", -- SAI_horisontal_pointer {-1.0, 1.0} + -- Cockpit Pressure Altimeter + [285] = "%.4f", -- CockpitPressureAltimeter {0.0, 5000.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 35000.0, 40000.0, 45000.0, 50000.0} {0.0, 0.117, 0.2245, 0.3225, 0.411, 0.506, 0.609, 0.717, 0.823, 0.914, 1.0} + -- Caution Light Indicator Panel + [298] = "%1d", -- CPT_LTS_CK_SEAT + [299] = "%1d", -- CPT_LTS_APU_ACC + [300] = "%1d", -- CPT_LTS_BATT_SW + [301] = "%1d", -- CPT_LTS_FCS_HOT + [302] = "%1d", -- CPT_LTS_GEN_TIE + [303] = "%1d", -- CPT_LTS_SPARE_CTN1 + [304] = "%1d", -- CPT_LTS_FUEL_LO + [305] = "%1d", -- CPT_LTS_FCES + [306] = "%1d", -- CPT_LTS_SPARE_CTN2 + [307] = "%1d", -- CPT_LTS_L_GEN + [308] = "%1d", -- CPT_LTS_R_GEN + [309] = "%1d", -- CPT_LTS_SPARE_CTN3 + -- LH Advisory and Threat Warning Indicator Panel + [13] = "%1d", -- CPT_LTS_MASTER_CAUTION + [10] = "%1d", -- CPT_LTS_FIRE_LEFT + [15] = "%1d", -- CPT_LTS_GO + [16] = "%1d", -- CPT_LTS_NO_GO + [17] = "%1d", -- CPT_LTS_L_BLEED + [18] = "%1d", -- CPT_LTS_R_BLEED + [19] = "%1d", -- CPT_LTS_SPD_BRK + [20] = "%1d", -- CPT_LTS_STBY + [21] = "%1d", -- CPT_LTS_L_BAR_RED + [22] = "%1d", -- CPT_LTS_REC + [23] = "%1d", -- CPT_LTS_L_BAR_GREEN + [24] = "%1d", -- CPT_LTS_XMIT + [25] = "%1d", -- CPT_LTS_ASPJ_OH + -- RH Advisory and Threat Warning Indicator Panel + [29] = "%1d", -- CPT_LTS_FIRE_APU + [26] = "%1d", -- CPT_LTS_FIRE_RIGHT + [31] = "%1d", -- CPT_LTS_RCDR_ON + [32] = "%1d", -- CPT_LTS_DISP + [38] = "%1d", -- CPT_LTS_SAM + [39] = "%1d", -- CPT_LTS_AI + [40] = "%1d", -- CPT_LTS_AAA + [41] = "%1d", -- CPT_LTS_CW + [33] = "%1d", -- CPT_LTS_SPARE_RH1 + [34] = "%1d", -- CPT_LTS_SPARE_RH2 + [35] = "%1d", -- CPT_LTS_SPARE_RH3 + [36] = "%1d", -- CPT_LTS_SPARE_RH4 + [37] = "%1d", -- CPT_LTS_SPARE_RH5 + -- Flaps, Landing Gear and Stores Indicator Panel + [152] = "%1d", -- CPT_LTS_CTR + [154] = "%1d", -- CPT_LTS_LI + [156] = "%1d", -- CPT_LTS_LO + [158] = "%1d", -- CPT_LTS_RI + [160] = "%1d", -- CPT_LTS_RO + [166] = "%1d", -- CPT_LTS_NOSE_GEAR + [165] = "%1d", -- CPT_LTS_LEFT_GEAR + [167] = "%1d", -- CPT_LTS_RIGHT_GEAR + [163] = "%1d", -- CPT_LTS_HALF_FLAPS + [164] = "%1d", -- CPT_LTS_FULL_FLAPS + [162] = "%1d", -- CPT_LTS_FLAPS + -- Lock/Shoot Light Assy + [1] = "%1d", -- CPT_LTS_LOCK + [2] = "%1d", -- CPT_LTS_SHOOT + [3] = "%1d", -- CPT_LTS_SHOOT_STROBE + -- Master Arm Control + [47] = "%1d", -- CPT_LTS_AA + [48] = "%1d", -- CPT_LTS_AG + [45] = "%1d", -- CPT_LTS_DISCH + [44] = "%1d", -- CPT_LTS_READY + -- Arresting Hook Control Handle + [294] = "%1d", -- CPT_LTS_HOOK + -- Landing Gear + --[] = "%1d", -- CPT_LTS_LDG_GEAR_HANDLE + -- APU Control Panel + [376] = "%1d", -- CPT_LTS_APU_READY + -- ECM Control Panel Assy + --[] = "%1d", -- CPT_LTS_SEL + -- Map Gain Control Panel Assy + [137] = "%1d", -- CPT_LTS_SPN + -- Height Indicator + [290] = "%1d", -- CPT_LTS_LOW_ALT_WARN + -- AoA Indexer Lights + [4] = "%1d", -- CPT_LTS_AOA_HIGH + [5] = "%1d", -- CPT_LTS_AOA_CENTER + [6] = "%1d", -- CPT_LTS_AOA_LOW + -- Internal Lights + --[460] = "%.1f", -- Console + --[461] = "%.1f", -- Flood + --[462] = "%.1f", -- NvgFlood + --[464] = "%.1f", -- EmerInstr + --[465] = "%.1f", -- EngInstFlood + --[466] = "%.1f", -- Instrument + --[467] = "%.1f", -- StbyCompass + --[810] = "%.1f", -- Utility + --[463] = "%.1f", -- Chart + -- WCAGroupLightness + --[521] = "%.1f", -- WCAGroupLightness 1 + --[522] = "%.1f", -- WCAGroupLightness 2 + --[523] = "%.1f", -- WCAGroupLightness 3 + -- IFEI + [468] = "%1d", -- IFEI + [469] = "%1d", -- IFEI_buttons + -- RWR + [276] = "%1d", -- Lower + [273] = "%1d", -- Limit + [274] = "%1d", -- Display + --[270] = "%1d", -- SpecialEn + [271] = "%1d", -- Special + [267] = "%1d", -- Enable + [268] = "%1d", -- Offset + [264] = "%1d", -- Fail + [265] = "%1d", -- Bit + [520] = "%.1f", -- RwrLightsBrightness + -- CMDS + [516] = "%1d" -- ecmJett +} +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- Control System + [345] = "%.2f", -- RUD TRIM Control (Axis) {-1.0, 1.0} in 0.05 Steps + [346] = "%1d", -- T/O TRIM Button + [349] = "%1d", -- FCS RESET Button + [347] = "%1d", -- GAIN Switch, NORM/ORIDE + [234] = "%1d", -- FLAP Switch, AUTO/HALF/FULL {-1.0,0.0,1.0} + [138] = "%1d", -- Spin Recovery Switch, RCVY/NORM + [470] = "%1d", -- FCS BIT Switch + [295] = "%1d", -- Wing Fold Control Handle, (RMB)CW/(LMB)CCW + [296] = "%1d", -- Wing Fold Control Handle, (MW)PULL/STOW + [504] = "%.1f", -- Throttles Friction Adjusting Lever (Axis) {0.0, 1.0} in 0.1 Steps + -- Electric system + [404] = "%1d", -- Battery Switch, ON/OFF/ORIDE {-1.0,0.0,1.0} + [402] = "%1d", -- Left Generator Control Switch, NORM/OFF + [403] = "%1d", -- Right Generator Control Switch, NORM/OFF + [378] = "%1d", -- Generator TIE Control Switch, NORM/RESET + [336] = "%1d", -- External Power Switch, RESET/NORM/OFF {-1.0,0.0,1.0} + [332] = "%1d", -- Ground Power Switch 1, A ON/AUTO/B ON {-1.0,0.0,1.0} + [333] = "%1d", -- Ground Power Switch 2, A ON/AUTO/B ON {-1.0,0.0,1.0} + [334] = "%1d", -- Ground Power Switch 3, A ON/AUTO/B ON {-1.0,0.0,1.0} + [335] = "%1d", -- Ground Power Switch 4, A ON/AUTO/B ON {-1.0,0.0,1.0} + -- Anti-Ice + [409] = "%1d", -- Pitot Heater Switch, ON/AUTO + [410] = "%1d", -- Engine Anti-Ice Switch, ON/OFF/TEST {-1.0,0.0,1.0} + -- CB + [381] = "%1d", -- CB FCS CHAN 1, ON/OFF + [382] = "%1d", -- CB FCS CHAN 2, ON/OFF + [383] = "%1d", -- CB SPD BRK, ON/OFF + [384] = "%1d", -- CB LAUNCH BAR, ON/OFF + [454] = "%1d", -- CB FCS CHAN 3, ON/OFF + [455] = "%1d", -- CB FCS CHAN 4, ON/OFF + [456] = "%1d", -- CB HOOK, ON/OFF + [457] = "%1d", -- CB LG, ON/OFF + -- + [368] = "%1d", -- MC Switch, 1 OFF/NORM/2 OFF {-1.0,0.0,1.0} + -- Power Plant + [375] = "%1d", -- APU Control Switch, ON/OFF + [377] = "%1d", -- Engine Crank Switch, LEFT/OFF/RIGHT {-1.0,0.0,1.0} + [331] = "%1d", -- Fire and Bleed Air Test Switch, (RMB) TEST A/(LMB) TEST B {-1.0,0.0,1.0} + -- Hydraulic system + [369] = "%1d", -- Hydraulic Isolate Override Switch, NORM/ORIDE + -- Gear system + [226] = "%1d", -- Landing Gear Control Handle, (RMB)UP/(LMB)DOWN {-1.0,0.0} ??? + [228] = "%1d", -- Landing Gear Control Handle, (MW)EMERGENCY DOWN {0.0,1.0} ??? + [229] = "%1d", -- Down Lock Override Button - Push to unlock + [238] = "%1d", -- Anti Skid Switch, ON/OFF + [240] = "%.3f", -- Emergency/Parking Brake Handle, (MW)Pull-Stow {0.0,1.0} in 0.001 Steps ??? + [241] = "%.3f", -- Emergency/Parking Brake Handle, (LMB)Rotate Left/(RMB)Rotate Right ??? + [233] = "%1d", -- Launch Bar Control Switch, EXTEND/RETRACT + [293] = "%1d", -- Arresting Hook Handle, UP/DOWN + -- Fuel system + [340] = "%1d", -- Internal Wing Tank Fuel Control Switch, INHIBIT/NORM + [341] = "%1d", -- Probe Control Switch, EXTEND/RETRACT/EMERG EXTD {-1.0,0.0} + [344] = "%1d", -- Fuel Dump Switch, ON/OFF + [343] = "%1d", -- External Centerline Tank Fuel Control Switch, STOP/NORM/ORIDE {-1.0,0.0} + [342] = "%1d", -- External Wing Tanks Fuel Control Switch, STOP/NORM/ORIDE {-1.0,0.0} + -- Cockpit Mechanics + [453] = "%1d", -- Canopy Control Switch, OPEN/HOLD/CLOSE {-1.0,0.0,1.0} + [43] = "%1d", -- Canopy Jettison Handle Unlock Button - Press to unlock + [42] = "%1d", -- Canopy Jettison Handle - Pull to jettison + [510] = "%1d", -- Ejection Control Handle (3 times) + [511] = "%1d", -- Ejection Seat SAFE/ARMED Handle, SAFE/ARMED + [512] = "%1d", -- Ejection Seat Manual Override Handle, PULL/PUSH + [513] = "%1d", -- Shoulder Harness Control Handle, LOCK/UNLOCK + [514] = "%1d", -- Seat Height Adjustment Switch, UP/HOLD/DOWN {-1.0,0.0,1.0} + [260] = "%1d", -- Rudder Pedal Adjust Lever + [575] = "%1d", -- Hide Stick toggle + -- Exterior Lights + [338] = "%.2f", -- POSITION Lights Dimmer Control {0.0,1.0} in 0.15 Steps + [337] = "%.2f", -- FORMATION Lights Dimmer Control {0.0,1.0} in 0.15 Steps + [339] = "%1d", -- STROBE Lights Switch, BRT/OFF/DIM {-1.0,0.0,1.0} + [237] = "%1d", -- LDG/TAXI LIGHT Switch, ON/OFF + -- Cockpit Lights + [413] = "%.2f", -- CONSOLES Lights Dimmer Control {0.0,1.0} in 0.15 Steps + [414] = "%.2f", -- INST PNL Dimmer Control {0.0,1.0} in 0.15 Steps + [415] = "%.2f", -- FLOOD Light Dimmer Control {0.0,1.0} in 0.15 Steps + [419] = "%1d", -- MODE Switch, NVG/NITE/DAY {-1.0,0.0,1.0} + [418] = "%.2f", -- CHART Light Dimmer Control {0.0,1.0} in 0.15 Steps + [417] = "%.2f", -- WARN/CAUTION Dimmer Control {0.0,1.0} in 0.15 Steps + [416] = "%1d", -- Lights Test Switch, TEST/OFF + [14] = "%1d", -- MASTER CAUTION Reset Button - Press to reset + [239] = "%1d", -- HOOK BYPASS Switch, FIELD/CARRIER + -- Oxygen System + [365] = "%1d", -- OBOGS Control Switch, ON/OFF + [366] = "%.2f", -- OXY Flow Knob {0.0,1.0} in 0.5 Steps + -- ECS + [411] = "%.1f", -- Bleed Air Knob, R OFF/NORM/L OFF/OFF {0.0,0.1,0.2,0.3} + [412] = "%1d", -- Bleed Air Knob, AUG PULL + [405] = "%1d", -- ECS Mode Switch, AUTO/MAN/ OFF/RAM {-1.0,0.0,1.0} + [408] = "%1d", -- Cabin Pressure Switch, NORM/DUMP/ RAM/DUMP {-1.0,0.0,1.0} + [451] = "%.2f", -- Defog Handle {0.0,1.0} in 0.1 Steps + [407] = "%.2f", -- Cabin Temperature Knob {0.0,1.0} in 0.1 Steps + [406] = "%.2f", -- Suit Temperature Knob {0.0,1.0} in 0.1 Steps + [297] = "%1d", -- AV COOL Switch, NORM/EMERG + [452] = "%1d", -- Windshield Anti-Ice/Rain Switch, ANTI ICE/OFF/RAIN {-1.0,0.0,1.0} + [505] = "%.2f", -- Left Louver {0.0,1.0} in 0.1 Steps + [506] = "%.2f", -- Right Louver {0.0,1.0} in 0.1 Steps + -- HOTAS + [494] = "%1d", -- Exterior Lights Switch, ON/OFF + -- Master Arm Panel + [458] = "%1d", -- Master Mode Button, A/A + [459] = "%1d", -- Master Mode Button, A/G + [49] = "%1d", -- Master Arm Switch, ARM/SAFE + [50] = "%1d", -- Emergency Jettison Button + [258] = "%1d", -- Auxiliary Release Switch, ENABLE/NORM + [153] = "%1d", -- Station Jettison Select Button, CENTER + [155] = "%1d", -- Station Jettison Select Button, LEFT IN + [157] = "%1d", -- Station Jettison Select Button, LEFT OUT + [159] = "%1d", -- Station Jettison Select Button, RIGHT IN + [161] = "%1d", -- Station Jettison Select Button, RIGHT OUT + [235] = "%1d", -- Selective Jettison Pushbutton + [236] = "%1d", -- Selective Jettison Knob, L FUS MSL/SAFE/R FUS MSL/ RACK/LCHR /STORES {0.0,0.1,0.2,0.3,0.4} + [135] = "%.1f", -- IR Cooling Switch, ORIDE/NORM/OFF {0.0,0.1,0.2} + -- Fire Systems + [46] = "%1d", -- Fire Extinguisher Pushbutton + [30] = "%1d", -- APU Fire Warning/Extinguisher Light + [11] = "%1d", -- Left Engine/AMAD Fire Warning/Extinguisher Light - (LMB) depress + [12] = "%1d", -- Left Engine/AMAD Fire Warning/Extinguisher Light - (RMB) cover control + [27] = "%1d", -- Right Engine/AMAD Fire Warning/Extinguisher Light - (LMB) depress + [28] = "%1d", -- Right Engine/AMAD Fire Warning/Extinguisher Light - (RMB) cover control + -- Multipurpose Display Group ----------- + -- Head-Up Display + [140] = "%1d", -- HUD Symbology Reject Switch, NORM/REJ 1/REJ 2 {0.0,0.1,0.2} + [141] = "%.2f", -- HUD Symbology Brightness Control Knob {0.0,1.0} in 0.1 Steps + [142] = "%1d", -- HUD Symbology Brightness Selector Knob, DAY/NIGHT + [143] = "%.2f", -- HUD Black Level Control Knob {0.0,1.0} in 0.1 Steps + [144] = "%1d", -- HUD Video Control Switch, W/B /VID/OFF {0.0,0.1,0.2} + [145] = "%.2f", -- HUD Balance Control Knob {0.0,1.0} in 0.1 Steps + [146] = "%.2f", -- HUD AOA Indexer Control Knob {0.0,1.0} in 0.1 Steps + [147] = "%1d", -- HUD Altitude Switch, BARO/RDR + [148] = "%1d", -- HUD Attitude Selector Switch, INS/AUTO/STBY {-1.0,0.0,1.0} + -- Left MDI + [51] = "%1d", -- Left MDI Brightness Selector Knob, OFF/NIGHT/DAY {0.0,0.1,0.2} + [52] = "%.2f", -- Left MDI Brightness Control Knob {0.0,1.0} in 0.1 Steps + [53] = "%.2f", -- Left MDI Contrast Control Knob {0.0,1.0} in 0.1 Steps + [54] = "%1d", -- Left MDI PB 1 + [55] = "%1d", -- Left MDI PB 2 + [56] = "%1d", -- Left MDI PB 3 + [57] = "%1d", -- Left MDI PB 4 + [58] = "%1d", -- Left MDI PB 5 + [59] = "%1d", -- Left MDI PB 6 + [60] = "%1d", -- Left MDI PB 7 + [61] = "%1d", -- Left MDI PB 8 + [62] = "%1d", -- Left MDI PB 9 + [63] = "%1d", -- Left MDI PB 10 + [64] = "%1d", -- Left MDI PB 11 + [65] = "%1d", -- Left MDI PB 12 + [66] = "%1d", -- Left MDI PB 13 + [67] = "%1d", -- Left MDI PB 14 + [68] = "%1d", -- Left MDI PB 15 + [69] = "%1d", -- Left MDI PB 16 + [70] = "%1d", -- Left MDI PB 17 + [72] = "%1d", -- Left MDI PB 18 + [73] = "%1d", -- Left MDI PB 19 + [75] = "%1d", -- Left MDI PB 20 + [312] = "%1d", -- Heading Set Switch + [313] = "%1d", -- Course Set Switch + -- Right MDI + [76] = "%.1f", -- Right MDI Brightness Selector Knob, OFF/NIGHT/DAY {0.0,0.1,0.2} + [77] = "%.2f", -- Right MDI Brightness Control Knob {0.0,1.0} in 0.1 Steps + [78] = "%.2f", -- Right MDI Contrast Control Knob {0.0,1.0} in 0.1 Steps + [79] = "%1d", -- Right MDI PB 1 + [80] = "%1d", -- Right MDI PB 2 + [81] = "%1d", -- Right MDI PB 3 + [82] = "%1d", -- Right MDI PB 4 + [83] = "%1d", -- Right MDI PB 5 + [84] = "%1d", -- Right MDI PB 6 + [85] = "%1d", -- Right MDI PB 7 + [86] = "%1d", -- Right MDI PB 8 + [87] = "%1d", -- Right MDI PB 9 + [88] = "%1d", -- Right MDI PB 10 + [89] = "%1d", -- Right MDI PB 11 + [90] = "%1d", -- Right MDI PB 12 + [91] = "%1d", -- Right MDI PB 13 + [92] = "%1d", -- Right MDI PB 14 + [93] = "%1d", -- Right MDI PB 15 + [94] = "%1d", -- Right MDI PB 16 + [95] = "%1d", -- Right MDI PB 17 + [96] = "%1d", -- Right MDI PB 18 + [97] = "%1d", -- Right MDI PB 19 + [98] = "%1d", -- Right MDI PB 20 + -- AMPCD + [203] = "%.2f", -- AMPCD Off/Brightness Control Knob {0.0,1.0} in 0.1 Steps + [177] = "%1d", -- AMPCD Night/Day Brightness Selector, DAY/NGT {1.0,0.0,-1.0} + [179] = "%1d", -- AMPCD Symbology Control Switch, UP/DOWN {1.0,0.0,-1.0} + [182] = "%1d", -- AMPCD Contrast Control Switch, UP/DOWN {1.0,0.0,-1.0} + [180] = "%1d", -- AMPCD Gain Control Switch, UP/DOWN {1.0,0.0,-1.0} + [183] = "%1d", -- AMPCD PB 1 + [184] = "%1d", -- AMPCD PB 2 + [185] = "%1d", -- AMPCD PB 3 + [186] = "%1d", -- AMPCD PB 4 + [187] = "%1d", -- AMPCD PB 5 + [188] = "%1d", -- AMPCD PB 6 + [189] = "%1d", -- AMPCD PB 7 + [190] = "%1d", -- AMPCD PB 8 + [191] = "%1d", -- AMPCD PB 9 + [192] = "%1d", -- AMPCD PB 10 + [193] = "%1d", -- AMPCD PB 11 + [194] = "%1d", -- AMPCD PB 12 + [195] = "%1d", -- AMPCD PB 13 + [196] = "%1d", -- AMPCD PB 14 + [197] = "%1d", -- AMPCD PB 15 + [198] = "%1d", -- AMPCD PB 16 + [199] = "%1d", -- AMPCD PB 17 + [200] = "%1d", -- AMPCD PB 18 + [201] = "%1d", -- AMPCD PB 19 + [202] = "%1d", -- AMPCD PB 20 + -- Instruments -------------------------- + -- Standby Pressure Altimeter AAU-52/A + [224] = "%.2f", -- AAU-52 Altimeter Pressure Setting Knob {0.0,1.0} in 0.04 Steps + -- Radar Altimeter Height Indicator + [291] = "%.2f", -- Push to Test Switch, (MW) rotate clockwise to apply power and set low altitude index pointer {0.0,1.0} in 0.1 Steps + [292] = "%1d", -- Push to Test Switch, (LMB) activate BIT checks + [213] = "%1d", -- SAI Cage Knob, (LMB) Pull to cage + [214] = "%.2f", -- SAI Cage Knob, (MW) Adjust miniature airplane {0.0,1.0} in 0.1 Steps + [215] = "%1d", -- SAI Test Button - Push to test + -- Integrated Fuel/Engine Indicator (IFEI) + [168] = "%1d", -- IFEI Mode Button + [169] = "%1d", -- IFEI QTY Button + [170] = "%1d", -- IFEI Up Arrow Button + [171] = "%1d", -- IFEI Down Arrow Button + [172] = "%1d", -- IFEI ZONE Button + [173] = "%1d", -- IFEI ET Button + [174] = "%.2f", -- IFEI Brightness Control Knob {0.0,1.0} in 0.1 Steps + -- Sensor panel + [440] = "%.1f", -- RADAR Switch (MW to pull), OFF/STBY/OPR/EMERG(PULL) {0.0,1.0} {0.0,0.1,0.2,0.3} + [443] = "%.1f", -- INS Switch, OFF/CV/GND/NAV/IFA/GYRO/GB/TEST {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7} + -- UFC + [128] = "%1d", -- UFC Function Selector Pushbutton, A/P + [129] = "%1d", -- UFC Function Selector Pushbutton, IFF + [130] = "%1d", -- UFC Function Selector Pushbutton, TCN + [131] = "%1d", -- UFC Function Selector Pushbutton, ILS + [132] = "%1d", -- UFC Function Selector Pushbutton, D/L + [133] = "%1d", -- UFC Function Selector Pushbutton, BCN + [134] = "%1d", -- UFC Function Selector Pushbutton, ON/OFF + [100] = "%1d", -- UFC Option Select Pushbutton 1 + [101] = "%1d", -- UFC Option Select Pushbutton 2 + [102] = "%1d", -- UFC Option Select Pushbutton 3 + [103] = "%1d", -- UFC Option Select Pushbutton 4 + [106] = "%1d", -- UFC Option Select Pushbutton 5 + [111] = "%1d", -- UFC Keyboard Pushbutton, 1 + [112] = "%1d", -- UFC Keyboard Pushbutton, 2 + [113] = "%1d", -- UFC Keyboard Pushbutton, 3 + [114] = "%1d", -- UFC Keyboard Pushbutton, 4 + [115] = "%1d", -- UFC Keyboard Pushbutton, 5 + [116] = "%1d", -- UFC Keyboard Pushbutton, 6 + [117] = "%1d", -- UFC Keyboard Pushbutton, 7 + [118] = "%1d", -- UFC Keyboard Pushbutton, 8 + [119] = "%1d", -- UFC Keyboard Pushbutton, 9 + [120] = "%1d", -- UFC Keyboard Pushbutton, 0 + [121] = "%1d", -- UFC Keyboard Pushbutton, CLR + [122] = "%1d", -- UFC Keyboard Pushbutton, ENT + [99] = "%1d", -- UFC I/P Pushbutton + [110] = "%1d", -- UFC Emission Control Pushbutton + [107] = "%1d", -- UFC ADF Function Select Switch, 1/OFF/2 {-1.0,0.0,1.0} + [108] = "%.2f", -- UFC COMM 1 Volume Control Knob {0.0,1.0} in 0.1 Steps + [123] = "%.2f", -- UFC COMM 2 Volume Control Knob {0.0,1.0} in 0.1 Steps + [109] = "%.2f", -- UFC Brightness Control Knob {0.0,1.0} in 0.1 Steps + [125] = "%1d", -- UFC COMM 1 Channel Selector Knob + [124] = "%.2f", -- UFC COMM 1 Channel Selector Knob {0.0,1.0} in 0.2 Steps + [127] = "%1d", -- UFC COMM 2 Channel Selector Knob + [126] = "%.2f", -- UFC COMM 2 Channel Selector Knob {0.0,1.0} in 0.2 Steps + -- intercom + [357] = "%.2f", -- VOX Volume Control Knob {0.0,1.0} in 0.1 Steps + [358] = "%.2f", -- ICS Volume Control Knob {0.0,1.0} in 0.1 Steps + [359] = "%.2f", -- RWR Volume Control Knob {0.0,1.0} in 0.1 Steps + [360] = "%.2f", -- WPN Volume Control Knob {0.0,1.0} in 0.1 Steps + [361] = "%.2f", -- MIDS B Volume Control Knob {0.0,1.0} in 0.1 Steps + [362] = "%.2f", -- MIDS A Volume Control Knob {0.0,1.0} in 0.1 Steps + [363] = "%.2f", -- TACAN Volume Control Knob {0.0,1.0} in 0.1 Steps + [364] = "%.2f", -- AUX Volume Control Knob {0.0,1.0} in 0.1 Steps + [350] = "%1d", -- Comm Relay Switch, CIPHER/OFF/PLAIN {-1.0,0.0,1.0} + [351] = "%1d", -- COMM G XMT Switch, COMM 1/OFF/COMM 2 {-1.0,0.0,1.0} + [356] = "%1d", -- IFF Master Switch, EMER/NORM + [355] = "%1d", -- IFF Mode 4 Switch, DIS/AUD /DIS/OFF {-1.0,0.0,1.0} + [354] = "%1d", -- CRYPTO Switch, HOLD/NORM/ZERO {-1.0,0.0,1.0} + [353] = "%1d", -- ILS UFC/MAN Switch, UFC/MAN + [352] = "%.2f", -- ILS Channel Selector Switch {0.0,0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.90,0.95} + [230] = "%1d", -- Warning Tone Silence Button - Push to silence + -- KY-58 + [444] = "%.1f", -- KY-58 Mode Select Knob, P/C/LD/RV {0.0,0.1,0.2,0.3} + [445] = "%.2f", -- KY-58 Volume Control Knob {0.0,1.0} in 0.1 Steps + [446] = "%.1f", -- KY-58 Fill Select Knob, Z 1-5/1/2/3/4/5/6/Z ALL {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7} + [447] = "%.1f", -- KY-58 Power Select Knob, OFF/ON/TD {0.0,0.1,0.2} + -- antenna selector + [373] = "%1d", -- COMM 1 Antenna Selector Switch, UPPER/AUTO/LOWER {-1.0,0.0,1.0} + [374] = "%1d", -- IFF Antenna Selector Switch, UPPER/BOTH/LOWER {-1.0,0.0,1.0} + -- RWR + [277] = "%1d", -- ALR-67 POWER Pushbutton + [275] = "%1d", -- ALR-67 DISPLAY Pushbutton + [272] = "%1d", -- ALR-67 SPECIAL Pushbutton + [269] = "%1d", -- ALR-67 OFFSET Pushbutton + [266] = "%1d", -- ALR-67 BIT Pushbutton + [263] = "%.2f", -- ALR-67 DMR Control Knob {0.0,1.0} in 0.1 Steps + [262] = "%.2f", -- ALR-67 AUDIO Control Knob (no function){0.0,1.0} in 0.1 Steps + [261] = "%.1f", -- ALR-67 DIS TYPE Switch, N/I/A/U/F {0.0,0.1,0.2,0.3,0.4} + [216] = "%.2f", -- ALR-67 RWR Intensity Knob {0.0,1.0} in 0.1 Steps + -- CMDS + [380] = "%1d", -- Dispense Button - Push to dispense flares and chaff + [517] = "%.1f", -- DISPENSER Switch, BYPASS/ON/OFF {0.0,0.1,0.2} + [515] = "%1d", -- ECM JETT JETT SEL Button - Push to jettison + -- ICMCP + [248] = "%.1f", -- ECM Mode Switch, XMIT/REC/BIT/STBY/OFF {0.0,0.1,0.2,0.3,0.4} + [507] = "%1d", -- NUC WPN Switch, ENABLE/DISABLE (no function) +} + +----------------------------- +-- 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 + ]] + + -- IFEI - Engine, Fuel and Clock informations + local lEngineFuelClock = ExportScript.Tools.getListIndicatorValue(5) + + if lEngineFuelClock ~= nil and lEngineFuelClock.txt_RPM_R ~= nil then + -- Engine informations 3 character + ExportScript.Tools.SendData(2000, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_R, 3)) -- right RPM + ExportScript.Tools.SendData(2001, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_L, 3)) -- left RPM + ExportScript.Tools.SendData(2002, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_R, 3)) -- right TEMP + ExportScript.Tools.SendData(2003, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_L, 3)) -- left TEMP + ExportScript.Tools.SendData(2004, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_R, 3)) -- right Fuel flow + ExportScript.Tools.SendData(2005, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_L, 3)) -- left Fuel flow + ExportScript.Tools.SendData(2006, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_R, 3)) -- right OilPress + ExportScript.Tools.SendData(2007, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_L, 3)) -- left OilPress + + -- Fuel informations 6 character + ExportScript.Tools.SendData(2008, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_UP, 6)) -- up Fuel + ExportScript.Tools.SendData(2009, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_DOWN, 6)) -- down Fuel + ExportScript.Tools.SendData(2010, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_BINGO, 6)) -- BINGO + + -- Clock 8 character + ExportScript.Tools.SendData(2011, ExportScript.Tools.DisplayFormat(string.format("%s¦%s¦%s", lEngineFuelClock.txt_CLOCK_H, lEngineFuelClock.txt_CLOCK_M, lEngineFuelClock.txt_CLOCK_S), 8)) -- Clock HH:MM:SS + else + -- Engine informations 3 character + ExportScript.Tools.SendData(2000, " ") -- right RPM + ExportScript.Tools.SendData(2001, " ") -- left RPM + ExportScript.Tools.SendData(2002, " ") -- right TEMP + ExportScript.Tools.SendData(2003, " ") -- left TEMP + ExportScript.Tools.SendData(2004, " ") -- right Fuel flow + ExportScript.Tools.SendData(2005, " ") -- left Fuel flow + ExportScript.Tools.SendData(2006, " ") -- right OilPress + ExportScript.Tools.SendData(2007, " ") -- left OilPress + + -- Fuel informations 6 character + ExportScript.Tools.SendData(2008, " ") -- up Fuel + ExportScript.Tools.SendData(2009, " ") -- down Fuel + ExportScript.Tools.SendData(2010, " ") -- BINGO + + -- Clock 8 character + ExportScript.Tools.SendData(2011, " ") -- Clock HH:MM:SS + end + + -- UFC Displays + local lUFCDisplays = ExportScript.Tools.getListIndicatorValue(6) + ListIindicator = list_indication(6) + --ExportScript.Tools.WriteToLog('UFC: '..ExportScript.Tools.dump(ListIindicator)) + + if lUFCDisplays ~= nil and lUFCDisplays.UFC_MainDummy ~= nil then + -- ScratchPadString Displays + lUFCDisplays.UFC_ScratchPadString1Display = string.gsub(lUFCDisplays.UFC_ScratchPadString1Display, "_", "-") -- fix weil das ein - sein sollte + lUFCDisplays.UFC_ScratchPadString2Display = string.gsub(lUFCDisplays.UFC_ScratchPadString2Display, "_", "-") -- fix weil das ein - sein sollte + lUFCDisplays.UFC_ScratchPadString1Display = string.gsub(lUFCDisplays.UFC_ScratchPadString1Display, "~", "2") -- fix weil das eine 2 sein sollte + lUFCDisplays.UFC_ScratchPadString2Display = string.gsub(lUFCDisplays.UFC_ScratchPadString2Display, "~", "2") -- fix weil das eine 2 sein sollte + lUFCDisplays.UFC_ScratchPadString1Display = string.gsub(lUFCDisplays.UFC_ScratchPadString1Display, "`", "1") -- fix weil das eine 1 sein sollte + lUFCDisplays.UFC_ScratchPadString2Display = string.gsub(lUFCDisplays.UFC_ScratchPadString2Display, "`", "1") -- fix weil das eine 1 sein sollte + ExportScript.Tools.SendData(2020, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_ScratchPadString1Display, 2)) -- ScratchPadString1Display 2 character + ExportScript.Tools.SendData(2021, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_ScratchPadString2Display, 2)) -- ScratchPadString2Display 2 character + ExportScript.Tools.SendData(2022, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_ScratchPadNumberDisplay, 7)) -- ScratchPadNumberDisplay 7 character + + local lTmpCueing = " " + -- Option Displays + lTmpCueing = (#lUFCDisplays.UFC_OptionCueing1 > 0 and "¦" or " ") + ExportScript.Tools.SendData(2023, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay1)) -- OptionDisplay1 5 character + lTmpCueing = (#lUFCDisplays.UFC_OptionCueing2 > 0 and "¦" or " ") + ExportScript.Tools.SendData(2024, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay2)) -- OptionDisplay2 5 character + lTmpCueing = (#lUFCDisplays.UFC_OptionCueing3 > 0 and "¦" or " ") + ExportScript.Tools.SendData(2025, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay3)) -- OptionDisplay3 5 character + lTmpCueing = (#lUFCDisplays.UFC_OptionCueing4 > 0 and "¦" or " ") + ExportScript.Tools.SendData(2026, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay4)) -- OptionDisplay4 5 character + lTmpCueing = (#lUFCDisplays.UFC_OptionCueing5 > 0 and "¦" or " ") + ExportScript.Tools.SendData(2027, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay5)) -- OptionDisplay5 5 character + + -- Comm Displays + lUFCDisplays.UFC_Comm1Display = string.gsub(lUFCDisplays.UFC_Comm1Display, "~", "2") -- fix weil das eine 2 sein sollte + lUFCDisplays.UFC_Comm2Display = string.gsub(lUFCDisplays.UFC_Comm2Display, "~", "2") -- fix weil das eine 2 sein sollte + lUFCDisplays.UFC_Comm1Display = string.gsub(lUFCDisplays.UFC_Comm1Display, "`", "1") -- fix weil das eine 1 sein sollte + lUFCDisplays.UFC_Comm2Display = string.gsub(lUFCDisplays.UFC_Comm2Display, "`", "1") -- fix weil das eine 1 sein sollte + ExportScript.Tools.SendData(2028, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_Comm1Display, 2)) -- Comm1Display 2 character + ExportScript.Tools.SendData(2029, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_Comm2Display, 2)) -- Comm2Display 2 character + else + -- ScratchPadString Displays + ExportScript.Tools.SendData(2020, " ") -- ScratchPadString1Display 2 character + ExportScript.Tools.SendData(2021, " ") -- ScratchPadString2Display 2 character + ExportScript.Tools.SendData(2022, " ") -- ScratchPadNumberDisplay 7 character + + -- Option Displays + ExportScript.Tools.SendData(2023, " ") -- OptionDisplay1 5 character + ExportScript.Tools.SendData(2024, " ") -- OptionDisplay2 5 character + ExportScript.Tools.SendData(2025, " ") -- OptionDisplay3 5 character + ExportScript.Tools.SendData(2026, " ") -- OptionDisplay4 5 character + ExportScript.Tools.SendData(2027, " ") -- OptionDisplay5 5 character + + -- Comm Displays + ExportScript.Tools.SendData(2028, " ") -- Comm1Display 2 character + ExportScript.Tools.SendData(2029, " ") -- Comm2Display 2 character + end + + local lUHF1Radio = GetDevice(39) + ExportScript.Tools.SendData(2030, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF1Radio:get_frequency()/1000000))), 7) + + local lUHF2Radio = GetDevice(40) + ExportScript.Tools.SendData(2031, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF2Radio:get_frequency()/1000000), "7.3", false, 0.005)), 7) +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 + ]] + + -- IFEI - Engine, Fuel and Clock informations + local lEngineFuelClock = ExportScript.Tools.getListIndicatorValue(5) + + if lEngineFuelClock ~= nil and lEngineFuelClock.txt_RPM_R ~= nil then + -- Engine informations 3 character + ExportScript.Tools.SendDataDAC(2000, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_R, 3, "r", true)) -- right RPM + ExportScript.Tools.SendDataDAC(2001, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_L, 3, "r", true)) -- left RPM + ExportScript.Tools.SendDataDAC(2002, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_R, 3, "r", true)) -- right TEMP + ExportScript.Tools.SendDataDAC(2003, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_L, 3, "r", true)) -- left TEMP + ExportScript.Tools.SendDataDAC(2004, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_R, 3, "r", true)) -- right Fuel flow + ExportScript.Tools.SendDataDAC(2005, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_L, 3, "r", true)) -- left Fuel flow + ExportScript.Tools.SendDataDAC(2006, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_R, 3, "r", true)) -- right OilPress + ExportScript.Tools.SendDataDAC(2007, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_L, 3, "r", true)) -- left OilPress + + -- Fuel informations 6 character + ExportScript.Tools.SendDataDAC(2008, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_UP:match("%d+"), 6, "r", true)) -- up Fuel + ExportScript.Tools.SendDataDAC(2009, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_DOWN:match("%d+"), 6, "r", true)) -- down Fuel + ExportScript.Tools.SendDataDAC(2010, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_BINGO:match("%d+"), 6, "r", true)) -- BINGO + + -- Clock 8 character + ExportScript.Tools.SendDataDAC(2011, ExportScript.Tools.DisplayFormat(string.format("%s.%s.$s", lEngineFuelClock.txt_CLOCK_H, lEngineFuelClock.txt_CLOCK_M, lEngineFuelClock.txt_CLOCK_S)), 8, "r", true) -- Clock HH:MM:SS + else + -- Engine informations 3 character + ExportScript.Tools.SendDataDAC(2000, "-") -- right RPM + ExportScript.Tools.SendDataDAC(2001, "-") -- left RPM + ExportScript.Tools.SendDataDAC(2002, "-") -- right TEMP + ExportScript.Tools.SendDataDAC(2003, "-") -- left TEMP + ExportScript.Tools.SendDataDAC(2004, "-") -- right Fuel flow + ExportScript.Tools.SendDataDAC(2005, "-") -- left Fuel flow + ExportScript.Tools.SendDataDAC(2006, "-") -- right OilPress + ExportScript.Tools.SendDataDAC(2007, "-") -- left OilPress + + -- Fuel informations 5 character + ExportScript.Tools.SendDataDAC(2008, "-") -- up Fuel + ExportScript.Tools.SendDataDAC(2009, "-") -- down Fuel + ExportScript.Tools.SendDataDAC(2010, "-") -- BINGO + + -- Clock 8 character + ExportScript.Tools.SendDataDAC(2011, "-") -- Clock HH:MM:SS + end + + local lUHF1Radio = GetDevice(39) + ExportScript.Tools.SendDataDAC(2030, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF1Radio:get_frequency()/1000000))), 7) + + local lUHF2Radio = GetDevice(40) + ExportScript.Tools.SendDataDAC(2031, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF2Radio:get_frequency()/1000000), "7.3", false, 0.005)), 7) + + --===================================================================================== + --[[ + 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 -- +----------------------------- \ No newline at end of file diff --git a/Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua b/Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua index 4dbfcff..5a7b229 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua @@ -1,5 +1,6 @@ -- Flaming Cliffs Auxiliary Functons --- Version 1.0.2 + +ExportScript.Version.FC_AuxiliaryFunctions = "1.1.0" -- Workaround for engine start-up ExportScript.AF.LeftEngineOn = false @@ -1881,9 +1882,9 @@ function ExportScript.AF.FC_US_ADI() [25] = "%0.1f", -- ADI Attitude Warning Flag [19] = "%0.1f", -- ADI Course Warning Flag ]] - lNavInfoPitch = lNavInfoPitch / (lRadToDCSsignd * -1) -- lNavInfoPitch / lRadToDCSsignd + lNavInfoPitch = lNavInfoPitch / (lRadToDCSsignd * -1) --lNavInfoPitch / lRadToDCSsignd lNavInfoRoll = lNavInfoRoll / lRadToDCSsignd - lPitch = lPitch / (lRadToDCSsignd / 2) -- lPitch / (lRadToDCSsignd / 1.5) + lPitch = lPitch / (lRadToDCSsignd / 2) --lPitch / (lRadToDCSsignd / 1.5) lBank = lBank / lRadToDCSsignd ExportScript.Tools.SendData(2, string.format("%.4f", ExportScript.Tools.negate(lPitch))) -- negate @@ -1927,6 +1928,9 @@ function ExportScript.AF.FC_US_HSI(distancetoway) local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian) local lHSI_Curse = LoGetControlPanel_HSI().Course -- HSI Course (Radian) local lHeading = LoGetSelfData().Heading -- HEADING (Radian) + local lCourseDeviation = LoGetControlPanel_HSI().CourseDeviation + --ExportScript.Tools.WriteToLog('LoGetControlPanel_HSI() 1: '..ExportScript.Tools.dump(LoGetControlPanel_HSI())) + lPitch, lBank = nil --[[ [Course] = number: "0.76548692098835" @@ -1979,6 +1983,8 @@ function ExportScript.AF.FC_US_HSI(distancetoway) lHeading = 1.0 - (lHeading / lRadToDCSunsignd) lHSI_Curse = (lHSI_Curse / lRadToDCSunsignd) lHSI_ADF = (lHSI_ADF / lRadToDCSunsignd) + lCourseDeviation = (lCourseDeviation > 1.0 and 1 or lCourseDeviation) + lCourseDeviation = (lCourseDeviation < -1.0 and -1 or lCourseDeviation) -- HSI Heading {0.0, 1.0} -- HSI Bearing #1 {0.0, 1.0} -- HSI Bearing #2 {0.0, 1.0} @@ -1999,7 +2005,7 @@ function ExportScript.AF.FC_US_HSI(distancetoway) ExportScript.Tools.SendData(13, string.format("%.4f", lHSI_Curse)) -- Bearing #2 ExportScript.Tools.SendData(14, lDefaultNull) ExportScript.Tools.SendData(15, string.format("%.4f", lHSI_Curse)) - ExportScript.Tools.SendData(16, string.format("%.4f", lHSI_ADF)) + ExportScript.Tools.SendData(16, string.format("%.4f", lCourseDeviation)) ExportScript.Tools.SendData(17, string.format("%.4f", lRangeCounter1)) ExportScript.Tools.SendData(18, string.format("%.4f", lRangeCounter2)) ExportScript.Tools.SendData(19, string.format("%.4f", lRangeCounter3)) diff --git a/Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua b/Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua index 9f452dd..641dd5e 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua @@ -1,7 +1,7 @@ -- FW-190D9 Dora --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.FW190D9 = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua b/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua index 3c19f14..894d82f 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua @@ -1,7 +1,7 @@ -- Ka-50 Export --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.Ka50 = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/L-39C.lua b/Scripts/DCS-ExportScript/ExportsModules/L-39C.lua index 0773374..6275d8d 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/L-39C.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/L-39C.lua @@ -1,7 +1,7 @@ -- L-39C --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.L39C = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/L-39ZA.lua b/Scripts/DCS-ExportScript/ExportsModules/L-39ZA.lua index 0ad9d62..b312839 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/L-39ZA.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/L-39ZA.lua @@ -1,7 +1,7 @@ --- L-39C --- Version 1.0.2 +-- L-39ZA ExportScript.FoundDCSModule = true +ExportScript.Version.L39ZA = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/M-2000C.lua b/Scripts/DCS-ExportScript/ExportsModules/M-2000C.lua new file mode 100644 index 0000000..2b2abaa --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/M-2000C.lua @@ -0,0 +1,1467 @@ +-- Mirage M-2000C + +ExportScript.FoundDCSModule = true +ExportScript.Version.M2000C = "1.1.0" + +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 + ]] + +-- LAMPS / DISPLAYS -------------------------------------- + [185] = "%.1f", --LIM, MIP, + [186] = "%.1f", --IFF, MIP, Acc + [187] = "%.1f", --LED green, ADI + [188] = "%.1f", --LED green, ADI + +-- RWR Lamps + [229] = "%.1f", --V + [230] = "%.1f", --BR + [231] = "%.1f", --DA + [232] = "%.1f", --D2M + [233] = "%.1f", --LL + +-- Autopilot Controls/Indicator Lights + [267] = "%.1f", --button P light + [268] = "%.1f", --button MIS light + [270] = "%.1f", --button AUT light + [271] = "%.1f", --button MAN light + [273] = "%.1f", --button MAG-P light + [274] = "%.1f", --button MAG-MAG light + + [280] = "%.1f", --button TOT light + [281] = "%.1f", --button PAP light + +-- Weapon panel + [236] = "%.1f", --button1 S 001 light + [238] = "%.1f", --button2 S 001 light + [240] = "%.1f", --button3 S 001 light + [242] = "%.1f", --button4 S 001 light + [244] = "%.1f", --button5 S 001 light + + [251] = "%.1f", --button1 S 002 light + [252] = "%.1f", --button1 P 002 light + [254] = "%.1f", --button2 S 002 light + [255] = "%.1f", --button2 P 002 light + [257] = "%.1f", --button3 S 002 light + [258] = "%.1f", --button3 P 002 light + [260] = "%.1f", --button4 S 002 light + [261] = "%.1f", --button4 P 002 light + [263] = "%.1f", --button5 S 002 light + [264] = "%.1f", --button5 P 002 light + + [246] = "%.1f", --button KL1 light + [247] = "%.1f", --button KL2 light + + [321] = "%.1f", --ADI ILS light + [374] = "%.1f", --Fire light 1 + [375] = "%.1f", --Fire light 2 + +-- AUTOPILOT lights + [283] = "%.1f", --P + [284] = "%.1f", --A + [286] = "%.1f", --Alt 1 + [287] = "%.1f", --blank Alt + [289] = "%.1f", --Alt 2 + [290] = "%.1f", --AFF + [292] = "%.1f", --blank1 + [293] = "%.1f", --blank2 + [295] = "%.1f", --left + [296] = "%.1f", --blank L + [297] = "%.1f", --G + [298] = "%.1f", --blank G + +-- div. lights + [373] = "%.1f", --Afterburner light + [376] = "%.1f", --starter light + [198] = "%.1f", --tranfere + [199] = "%.1f", --master-warning + [200] = "%.1f", --master-caution +-- INSTRUMENTS ------------------------------------------- + +-- Display Settings + --[224] = "%.4f", --Drum X000 + --[225] = "%.4f", --Drum 0X00 + --[226] = "%.4f", --Drum 00X0 + --[227] = "%.4f", --Drum 000X + +-- AUTOPILOT ALTITUDE SELECTOR: Adjust autopilot altitude hold value. + --[299] = "%.4f", --Alt Drum X00 + --[300] = "%.4f", --Alt Drum 0X0 + --[301] = "%.4f", --Alt Drum 00X + +-- BINGO FUEL SELECTOR: Adjust the value for the Bingo Fuel warning + [360] = "%.4f", --Drum X0 + [361] = "%.4f", --Drum 0X + +-- ASI + [303] = "%.4f", --asi needle + [304] = "%.4f", --mach wheel + +-- ALTITUDE INDICATOR: indicates barometric altitude (MSL) in feet + [305] = "%.4f", --Needle + [306] = "%.4f", --Alt Drum X00 + [307] = "%.4f", --Alt Drum 0X0 + [308] = "%.4f", --Alt Drum 00X + [310] = "%.4f", --Pressure Drum X000 + [311] = "%.4f", --Pressure Drum 0X00 + [312] = "%.4f", --Pressure Drum 00X0 + [313] = "%.4f", --Pressure Drum 000X + +-- ADI + [316] = "%.4f", --pitch + [317] = "%.4f", --bank + [318] = "%.4f", --heading + [319] = "%.1f", --off flag + [320] = "%.4f", --slip ball + [322] = "%.4f", --ILS bar course + [323] = "%.4f", --ILS bar alt + +-- VVI + [324] = "%.4f", --VVI needle + +-- ADI Standby + [327] = "%.4f", --pitch + [326] = "%.4f", --bank + [328] = "%.4f", --adjust + [329] = "%.1f", --off flag + +-- AOA + [331] = "%.4f", --needle + +-- Flag black/red + [332] = "%.1f", --flag + +-- HSI + [333] = "%.4f", --HDG Indicator + [334] = "%.4f", --Needle + [335] = "%.4f", --Needle small + [336] = "%.4f", --Drum X000 + [337] = "%.4f", --Drum 0X00 + [338] = "%.4f", --Drum 00X0 + [339] = "%.4f", --Drum 000X + [342] = "%.4f", --Compass rose + [344] = "%.1f", --HSI Flag 1 + [345] = "%.1f", --HSI Flag 2 + [346] = "%.1f", --HSI Flag CAP + [341] = "%.1f", --HSI Mode + [343] = "%.1f", --DME Off Flag + +-- ACC indicator + [347] = "%.4f", --needle + +-- JAUG fuel + [349] = "%.4f", --Drum X00 + [350] = "%.4f", --Drum 0X0 + [351] = "%.4f", --Drum 00X + +-- DETOT fuel + [352] = "%.4f", --Drum X00 + [353] = "%.4f", --Drum 0X0 + [354] = "%.4f", --Drum 00X + +-- Fuel indicator + [358] = "%.4f", --v-needle left + [359] = "%.4f", --v-needle right + [362] = "%.1f", --light L RL + [363] = "%.1f", --light C RL + [364] = "%.1f", --light R RL + [365] = "%.1f", --light L AV + [366] = "%.1f", --light R AV + [367] = "%.1f", --light L V + [368] = "%.1f", --light R V + +-- ENGINE INSTRUMENTS: Indicates engine RPM and Temperature. + [369] = "%.4f", --N needle + [370] = "%.4f", --Tt7 needle + [371] = "%.4f", --Drum XX0 + [372] = "%.4f", --Drum 00X + +-- Center console + [377] = "%.4f", -- X0 MODE + [378] = "%.4f", -- 0X + + [379] = "%.4f", -- X000 MODE 3A + [380] = "%.4f", -- 0X00 + [381] = "%.4f", -- 00X0 + [382] = "%.4f", -- 000X + + [388] = "%.1f", -- Rote Kontrollampe MODE-4 Panel + [394] = "%.1f", -- gelbe „FAULT“ Anzeige + +-- Pressuge + [397] = "%.4f", --Needle left + [398] = "%.4f", --Needle right + +-- Cabin climb (x 1000 ft) + [399] = "%.4f", --Needle + +-- Clock + [401] = "%.4f", --hours + [402] = "%.4f", --minutes + [403] = "%.4f", --seconds + +-- GEARPANEL + [405] = "%.1f", -- Gearhandle Innenleuchte, rot + [410] = "%.1f", -- „A“ Warnlamp + [411] = "%.1f", -- „F“ Warnlamp + [412] = "%.1f", -- „DIRA“ Warnlamp, blau + [413] = "%.1f", -- „FREIN“ + [414] = "%.1f", -- „Cross“ + [415] = "%.1f", -- „SPAD“ + [416] = "%.1f", -- Rote Warnlamp unter „BIP“ + [417] = "%.1f", -- Left Gear ?, grüne Warnlampen + [418] = "%.1f", -- Nose Gear ? + [419] = "%.1f", -- Right Gear ? + +-- CS indicator + [424] = "%.4f", -- 1. waagerechte Balkenanzeige + [425] = "%.4f", -- 2. + [426] = "%.4f", -- 1. senkrechte Balkenanzeige + [427] = "%.4f", -- 3. waagerechte BA + [428] = "%.4f", -- 4. + +-- Com + --[436] = "%.4f", -- Preset display (1-20) + --[440] = "%.4f", -- Drum X000 (0-9-0) COM Panel + --[441] = "%.4f", -- Drum 0X00.00 + --[442] = "%.4f", -- Drum 00X0.00 + --[443] = "%.4f", -- Drum 000X.00 + --[444] = "%.4f", -- Drum 0000.XX (00-25-50-75-00) + --[190] = "%.4f", -- Drum X0 Preset (0-1-2) + --[189] = "%.4f", -- Drum 0X Preset (0-9-0) + [675] = "%.1f", -- TEST Button COM Panel, red + [676] = "%.1f", -- Test Button Panel over COM Panel, red + [677] = "%.1f", -- Left green lamp + +-- Compass + [906] = "%.4f", --Rose + +-- Oxygen + [518] = "%.4f", --Needle + [519] = "%.1f", --Oxy flow lamp (blue) + + +-- Left consule Lamps + [490] = "%.1f", -- „VAL” + [492] = "%.1f", -- „A“ Kontrolllampe mittleres Panel + [494] = "%.1f", -- „DEC“ Kontrollampe + [496] = "%.1f", -- „VISU“ + [505] = "%.1f", -- „PSIC“ + [510] = "%.1f", -- „ELEC“ + [511] = "%.1f", -- „HYD“ + [512] = "%.1f", -- Red + [513] = "%.1f", -- GREEN + +-- LOX + [518] = "%.4f", -- needle + --[519] = "%.4f", -- LOX flow blinker + +-- WARNING PANEL + [525] = "%.1f", -- BATT + [526] = "%.1f", -- TR + [527] = "%.1f", -- ALT 1 + [528] = "%.1f", -- ALT2 + [529] = "%.1f", -- HUILLE + [530] = "%.1f", -- T7 + [531] = "%.1f", -- CALC C + [532] = "%.1f", -- SOURIS + [533] = "%.1f", -- PELLE + [534] = "%.1f", -- B.P + [535] = "%.1f", -- BP.G + [536] = "%.1f", -- BP.D + [537] = "%.1f", -- TRANSF + [538] = "%.1f", -- NIVEAU + [539] = "%.1f", -- HYD 1 + [540] = "%.1f", -- HYD 2 + [541] = "%.1f", -- HYD 3 + [542] = "%.1f", -- EP + [543] = "%.1f", -- BINGO + [544] = "%.1f", -- P.CAB + [545] = "%.1f", -- TEMP + [546] = "%.1f", -- REG O2 + [547] = "%.1f", -- 5nm O2 + [548] = "%.1f", -- O2 HA + [549] = "%.1f", -- ANEMO + [550] = "%.1f", -- CC + [551] = "%.1f", -- DSV + [552] = "%.1f", -- CONDIT + [553] = "%.1f", -- CONF + [554] = "%.1f", -- PA + [555] = "%.1f", -- MAN + [556] = "%.1f", -- DOM + [557] = "%.1f", -- BECS + [558] = "%.1f", -- U.S.EL + [559] = "%.1f", -- ZEICHEN + [560] = "%.1f", -- GAIN + [561] = "%.1f", -- RPM + [562] = "%.1f", -- DECOL + [563] = "%.1f", -- PARK. + +-- Lamps Right Console + [564] = "%.1f", -- “PRET” grüne Doppelanzeige, unten + [565] = "%.1f", -- „ALN“ + [566] = "%.1f", -- „MIP“ + [567] = "%.1f", -- „N.DEG“ + [568] = "%.1f", -- „SEC“ + [569] = "%.1f", -- „UNI“ + [669] = "%.1f", -- „M01” + [670] = "%.1f", -- „M02“ + [671] = "%.1f", -- „M03“ + + [571] = "%.1f", -- “PREP” WL, gelb + [573] = "%.1f", -- “DEST” WL, gelb + [577] = "%.1f", -- “BAD” WL gelb/grün + [579] = "%.1f", -- “REC” + [581] = "%.1f", -- “VAL” + [583] = "%.1f", -- “MRC” + [595] = "%.1f", -- “EFF” runde Warnlampe + [597] = "%.1f", -- “INS” runde WL + [668] = "%.1f", -- “ENC” WL gelb/grün + +-- VIERER ANZEIGE + [601] = "%.4f", -- 1. Drum + [602] = "%.4f", -- 2. + [603] = "%.4f", -- 3. + [604] = "%.4f", -- 4. + +-- VOR ILS + [611] = "%.4f", -- 1. Drum + [612] = "%.4f", -- 2. + [613] = "%.4f", -- 3. + [614] = "%.4f", -- 4. + [615] = "%.4f", -- 5. + +-- TACAN + [620] = "%.1f", -- X/Y + [621] = "%.4f", -- Drum XX0 left (--;1-12;--) + [622] = "%.4f", -- Drum 00X right (0;1-9;0) + + + [632] = "%.1f", -- Taster mit Warnlampe “C” + [634] = "%.1f", -- Taster mit Warnlampe “F” + +-- Panel lights + [720] = "%.4f", -- MIP Aufleuchte, red + [721] = "%.4f", -- MIP Hintergrundbeleuchtung, red + [722] = "%.4f", -- MIP Aufleuchte, weiß + [723] = "%.4f", -- Linke und rechte Seitenpanels Hintergrundbeleuchtung, red + [724] = "%.4f", -- Seitenpanels Aufleuchten, red (links, rechts) + [726] = "%.4f", -- Warnlampen Dimmer + [727] = "%.4f", -- Warnlampen Dimmer (Seitenpanels?) + +} + +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + +-- Fuel + [193] = "%.1f", --Refuel Transfer Switch + +-- Landing Gear + [404] = "%.1f", --Landing Gear Lever + +-- HUD/VTB + [201] = "%.1f", --HUD Power Switch + [203] = "%.1f", --HUD Decluter Switch + [204] = "%.1f", --HUD Altimeter Selector Switch + [205] = "%.1f", --Radar Altimeter Power Switch + [208] = "%.1f", --Gun AG Reticle Selector + [209] = "%.1f", --Gun Target Wingspan Selector + [210] = "%.1f", --HUD Clear Switch + [192] = "%.1f", --Radar Altimeter Minimum Altitude Selector + [213] = "%.1f", --Radar Interception Switch + [214] = "%.1f", --Radar N Parameter Switch + [215] = "%.1f", --Radar P Parameter Switch + [216] = "%.1f", --Radar B Parameter Switch + [217] = "%.1f", --Radar C Parameter Switch + [218] = "%.1f", --Radar Z Parameter Switch + [219] = "%.1f", --Radar M Parameter Switch + [220] = "%.1f", --Radar T Parameter Switch + [221] = "%.1f", --VTB Power Switch + [222] = "%.1f", --VTB Switch + [223] = "%.1f", --VTB Switch + +-- PCA/PPA +++++++++++ HJP HBook Side 129 + [463] = "%.1f", --Gun Arm/Safe Switch + [234] = "%.1f", --Master Arm Switch + [248] = "%.1f", --Jett Switch Cover + [249] = "%.1f", --Selective Jettison Switch + [235] = "%.1f", --PCA Button 1 + [237] = "%.1f", --PCA Button 2 + [239] = "%.1f", --PCA Button 3 + [241] = "%.1f", --PCA Button 4 + [243] = "%.1f", --PCA Button 5 + [245] = "%.1f", --Gun Mode Selector + [250] = "%.1f", --Weapons Selector Button 1 + [253] = "%.1f", --Weapons Selector Button 2 + [256] = "%.1f", --Weapons Selector Button 3 + [259] = "%.1f", --Weapons Selector Button 4 + [262] = "%.1f", --Weapons Selector Button 5 + [266] = "%.1f", --S530 Standby + [269] = "%.1f", --AUTO/MAN Button + [272] = "%.1f", --MAGIC Standby + [279] = "%.1f", --Cannon Fire rate/Rockets Simul Launch + [265] = "%.1f", --Missile Selector Switch + [275] = "%.1f", --PPA Test Switch + [276] = "%.1f", --Bomb Fuze Selector Switch + [277] = "%.1f", --Bomb Release Quantity Selector Switch + [278] = "%.1f", --Bomb Release Interval Selector Switch + [409] = "%.1f", --Emergency Jettison + +--AFCS + [282] = "%.1f", --Autopilot Master + [285] = "%.1f", --Autopilot - Altitude Hold + [288] = "%.1f", --Autopilot - Selected Altitude Hold + [294] = "%.1f", --Autopilot - Approach Hold + [302] = "%.1f", --Autopilot - Lights Test + [299] = "%.1f", --Autopilot - Altitude Selector 10K + [300] = "%.1f", --Autopilot - Altitude Selector 1K + [301] = "%.1f", --Autopilot - Altitude Selector 1C + [514] = "%.1f", --Autopilot Test Cover + [515] = "%.1f", --Autopilot Test Switch + [516] = "%.1f", --FBW Test Cover + [517] = "%.1f", --FBW Test Switch + +--FBW + [330] = "%.1f", --FBW Spin Switch + [420] = "%.1f", --FBW Disconnect Cover + [421] = "%.1f", --FBW Disconnect Switch + [422] = "%.1f", --FBW G Limiter Switch + [460] = "%.1f", --Intake slats Operation Switch + [461] = "%.1f", --Intake cones Operation Switch + +-- HSI + [340] = "%.4f", --HSI Heading Selector + [341] = "%.1f", --HSI Mode Selector Switch + +-- PELLES, SOURIES AND BECS + [462] = "%.1f", --Slats Operation Switch + [395] = "%.1f", --Hydraulic System Selector + [396] = "%.1f", --Pedal Adjust Lever + +-- RADAR + [481] = "%.1f", --Radar Illumination Switch + [482] = "%.1f", --Radar Test Switch + [483] = "%.1f", --Radar Rearm Switch + [484] = "%.1f", --Radar Doppler Reject Selector + [486] = "%.1f", --Radar Power Switch + [491] = "%.1f", --AG Radar A Mode + [493] = "%.1f", --AG Radar DEC Mode + [495] = "%.1f", --AG Radar VISU Mode + [499] = "%.1f", --Radar Grid Selector + [500] = "%.1f", --Target Memory Time Selector + [502] = "%.1f", --Radar Scan Lines Selector + [503] = "%.1f", --Radar Range Selector + [504] = "%.1f", --AA Radar STT Selector + [506] = "%.1f", --Radar Azimuth Aperture Selector + [709] = "%.1f", --Radar PRF Selector + [710] = "%.1f", --TDC Mode + +-- ELECTRICAL PANEL + [520] = "%.1f", --Main Battery Switch + [521] = "%.1f", --Electric Power Transfer Switch + [522] = "%.1f", --Alternator 1 Switch + [523] = "%.1f", --Alternator 2 Switch + [524] = "%.1f", --Lights Test Switch + +-- PCN + [570] = "%.1f", --INS PREP Switch + [572] = "%.1f", --INS DEST Switch + [574] = "%.1f", --INS Parameter Selector + [584] = "%.1f", --INS Button 1 + [585] = "%.1f", --INS Button 2 + [586] = "%.1f", --INS Button 3 + [587] = "%.1f", --INS Button 4 + [588] = "%.1f", --INS Button 5 + [589] = "%.1f", --INS Button 6 + [590] = "%.1f", --INS Button 7 + [591] = "%.1f", --INS Button 8 + [592] = "%.1f", --INS Button 9 + [593] = "%.1f", --INS Button 0 + [594] = "%.1f", --INS Clear Button + [596] = "%.1f", --INS ENTER Button + [627] = "%.1f", --INS Mode Selector + [629] = "%.1f", --INS Operational Mode + +-- EW PANEL + [605] = "%.1f", --EW Mode Selector Switch + [606] = "%.1f", --BR Switch + [607] = "%.1f", --RWR Switch + [608] = "%.1f", --D2M Switch + [609] = "%.1f", --LL (Jammer) Switch + [610] = "%.1f", --Jammer Strength + [194] = "%.1f", --ECM Box Mode Switch + [195] = "%.1f", --ECM Box Switch + [196] = "%.1f", --ECM Box Lighs Switch + [197] = "%.1f", --ECM Box LCD Display Brightness + +-- Panel Lights + [449] = "%.1f", --Police Lights + [450] = "%.1f", --Landing Lights + [452] = "%.1f", --Refuel Lights + [453] = "%.1f", --Anti-Collision Lights + [454] = "%.1f", --Navigation Lights + [455] = "%.1f", --Formation Lights + [639] = "%.1f", --Dashboard Flood Lights + [640] = "%.1f", --Dashboard Panel Lights + [641] = "%.1f", --Console Flood Lights + [642] = "%.1f", --Console Panel Lights + +-- Engine Start Panel + [467] = "%.1f", --Engine Shutdown Button + [645] = "%.1f", --Engine Start Switch Cover + [646] = "%.1f", --Starter Fuel Pump Switch + [647] = "%.1f", --Engine Fuel Left Boost Pump Switch + [648] = "%.1f", --Engine Fuel Right Boost Pump Switch + [649] = "%.1f", --Engine Start Switch + [650] = "%.1f", --Ventilation Selector Switch + [651] = "%.1f", --Fire Extinguisher Switch Cover + [652] = "%.1f", --Fire Extinguisher Switch + +-- Radio Panel + [429] = "%.1f", --UHF Power 5W/25W Switch + [430] = "%.1f", --UHF SIL Switch + [431] = "%.1f", --UHF E-A2 Switch + [432] = "%.1f", --UHF CDE Switch + [433] = "%.1f", --UHF Mode Switch + [434] = "%.1f", --UHF TEST Switch + [435] = "%.1f", --UHF Knob + [437] = "%.1f", --U/VHF TEST Switch + [438] = "%.1f", --U/VHF E+A2 Switch + [439] = "%.1f", --U/VHF SIL Switch + [440] = "%.1f", --U/VHF Select 100 MHz + [441] = "%.1f", --U/VHF Select 10 MHz + [442] = "%.1f", --U/VHF Select 1 MHz + [443] = "%.1f", --U/VHF Select 100 KHz + [444] = "%.1f", --U/VHF Select 25 KHz + [445] = "%.1f", --U/VHF Knob + [446] = "%.1f", --U/VHF Mode Switch 1 + [447] = "%.1f", --U/VHF Power 5W/25W Switch + [448] = "%.1f", --U/VHF Manual/Preset + +-- Navigational Antennas + [616] = "%.1f", --VOR/ILS Frequency Change Whole + [617] = "%.1f", --VOR/ILS Power Dial + [618] = "%.1f", --VOR/ILS Frequency Change Decimal + [619] = "%.1f", --VOR/ILS Test Dial + +-- TACAN + [623] = "%.1f", --TACAN Channel Change Tens + [624] = "%.1f", --TACAN X/Y Select + [625] = "%.1f", --TACAN Channel Change Ones + [626] = "%.1f", --TACAN Mode Select + +-- Miscelaneous Right Panel + [657] = "%.1f", -- Hydraulic Emergency Pump Switch + +-- Miscelaneous Left Panel + [191] = "%.1f", --Audio Warning Reset + +-- Miscelaneous Seat + [900] = "%.1f", --Seat adjustment switch + [458] = "%.1f", --Anti-Skid Cover + [459] = "%.1f", --Anti-Skid Switch + [666] = "%.1f", --Parking Brake Lever + [807] = "%.1f", --Nose Wheel Steering / IFF + +-- Sound Panel + [700] = "%.1f", --AMPLIS Selector + [701] = "%.1f", --VOR/ILS Volume + [702] = "%.1f", --TACAN Volume + [703] = "%.1f", --MAGIC Tone Volume + [704] = "%.1f", --TB APP Volume + [705] = "%.1f", --Marker Signal Volume + [706] = "%.1f", --V/UHF Radio Volume + [707] = "%.1f", --VHF Radio Volume + +-- ALT + [309] = "%.1f", --Barometric Pressure Calibration + +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(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 + 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)) + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025)) + ]] +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 + 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)) + ]] + + -- ECM Mode Switch + -- [194] = "%.1f", --ECM Box Mode Switch + local lECM_On = (mainPanelDevice:get_argument_value(194) > 0.0 and true or false) + + -- ECM_CHF + local lECM_CHF = ExportScript.Tools.getListIndicatorValue(3) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lECM_CHF : '..ExportScript.Tools.dump(lECM_CHF)) + end + + if lECM_On and lECM_CHF ~= nil and lECM_CHF.text_ECM_CHF ~= nil then + -- string with max 3 charachters + ExportScript.Tools.SendData(2001, string.format("%s", lECM_CHF.text_ECM_CHF)) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('2001: '..ExportScript.Tools.dump(lECM_CHF.text_ECM_CHF)) + end + else + ExportScript.Tools.SendData(2001, " ") + end + + -- ECM_FLR + local lECM_FLR = ExportScript.Tools.getListIndicatorValue(4) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lECM_FLR : '..ExportScript.Tools.dump(lECM_FLR)) + end + + if lECM_On and lECM_FLR ~= nil and lECM_FLR.text_ECM_FLR ~= nil then + -- string with max 2 charachters + ExportScript.Tools.SendData(2002, string.format("%s", lECM_FLR.text_ECM_FLR)) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('2002: '..ExportScript.Tools.dump(lECM_FLR.text_ECM_FLR)) + end + else + ExportScript.Tools.SendData(2002, " ") + end + + -- FUEL + local lFUEL = ExportScript.Tools.getListIndicatorValue(5) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lFUEL : '..ExportScript.Tools.dump(lFUEL)) + end + + if lFUEL ~= nil and lFUEL.txt_fuel_g ~= nil then + -- string with max 3 charachters + ExportScript.Tools.SendData(2003, string.format("%s", lFUEL.txt_fuel_g)) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('2003: '..ExportScript.Tools.dump(lFUEL.txt_fuel_g)) + end + else + ExportScript.Tools.SendData(2003, " ") + end + + -- PCA_UR (Weappon Panel top line) + local lPCAUR = list_indication(6) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lPCAUR : '..ExportScript.Tools.dump(lPCAUR)) + end + + local to1, to2, from1, from2 = nil, nil, nil, nil + local lPCA_UR = {"", "", "", "", ""} + to1, to2 = lPCAUR:find("PCA_UR") + if (to1 ~= nil) then + for lIndex = 1, 5, 1 do + from1, from2 = lPCAUR:find("text_PCA_UR"..lIndex.."%c") + if (from2 ~= nill) then + to1, to2 = lPCAUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCA_UR[lIndex] = lPCAUR:sub(from2+1, to1-1) + end + end + end -- for + end + + -- string with max 3 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2010: "..string.format("%s", lPCA_UR[1])) + ExportScript.Tools.WriteToLog("2011: "..string.format("%s", lPCA_UR[2])) + ExportScript.Tools.WriteToLog("2012: "..string.format("%s", lPCA_UR[3])) + ExportScript.Tools.WriteToLog("2013: "..string.format("%s", lPCA_UR[4])) + ExportScript.Tools.WriteToLog("2014: "..string.format("%s", lPCA_UR[5])) + end + ExportScript.Tools.SendData(2010, string.format("%s", lPCA_UR[1])) + ExportScript.Tools.SendData(2011, string.format("%s", lPCA_UR[2])) + ExportScript.Tools.SendData(2012, string.format("%s", lPCA_UR[3])) + ExportScript.Tools.SendData(2013, string.format("%s", lPCA_UR[4])) + ExportScript.Tools.SendData(2014, string.format("%s", lPCA_UR[5])) + + -- PCA_BR (Weappon Panel bottom line) + local lPCABR = list_indication(7) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lPCABR : '..ExportScript.Tools.dump(lPCABR)) + end + + local to1, to2, from1, from2 = nil, nil, nil, nil + local lPCA_BR = {"", "", "", "", ""} + to1, to2 = lPCABR:find("PCA_BR") + if (to1 ~= nil) then + for lIndex = 1, 5, 1 do + from1, from2 = lPCABR:find("text_PCA_BR"..lIndex.."%c") + if (from2 ~= nill) then + to1, to2 = lPCABR:find("%c", from2+2) + if (to1 ~= nil) then + lPCA_BR[lIndex] = lPCABR:sub(from2+1, to1-1) + end + end + end-- for + end + + -- string with max 3 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2015: "..string.format("%s", lPCA_BR[1])) + ExportScript.Tools.WriteToLog("2016: "..string.format("%s", lPCA_BR[2])) + ExportScript.Tools.WriteToLog("2017: "..string.format("%s", lPCA_BR[3])) + ExportScript.Tools.WriteToLog("2018: "..string.format("%s", lPCA_BR[4])) + ExportScript.Tools.WriteToLog("2019: "..string.format("%s", lPCA_BR[5])) + end + ExportScript.Tools.SendData(2015, string.format("%s", lPCA_BR[1])) + ExportScript.Tools.SendData(2016, string.format("%s", lPCA_BR[2])) + ExportScript.Tools.SendData(2017, string.format("%s", lPCA_BR[3])) + ExportScript.Tools.SendData(2018, string.format("%s", lPCA_BR[4])) + ExportScript.Tools.SendData(2019, string.format("%s", lPCA_BR[5])) + + -- COM + local lCOM = list_indication(9) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lCOM : '..ExportScript.Tools.dump(lCOM)) + end + + local to1, to2, from1, from2, lCOM1, lCOM2 = nil, nil, nil, nil, "", "" + to1, to2 = lCOM:find("COM") + if (to1 ~= nil) then + from1, from2 = lCOM:find("text_COM_UHF1%c") + if (from2 ~= nil) then + to1, to2 = lCOM:find("%c", from2+2) + if (to1 ~= nil) then + lCOM1 = lCOM:sub(from2+1, to1-1) + end + end + + from1, from2 = lCOM:find("text_COM_UHF2%c", to2) + if (from2 ~= nil) then + to1, to2 = lCOM:find("%c", from2+2) + if (to1 ~= nil) then + lCOM2 = lCOM:sub(from2+1, to1-1) + end + end + end + + -- string with max 7 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2020: "..string.format("%s", lCOM1)) + ExportScript.Tools.WriteToLog("2021: "..string.format("%s", lCOM2)) + end + ExportScript.Tools.SendData(2020, string.format("%s", lCOM1)) + ExportScript.Tools.SendData(2021, string.format("%s", lCOM2)) + + -- PPA Bomb Display + local lPPA = list_indication(8) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lPPA : '..ExportScript.Tools.dump(lPPA)) + end + + local to1, to2, from1, from2, lPPA1, lPPA2 = nil, nil, nil, nil, "", "" + to1, to2 = lPPA:find("PPA") + if (to1 ~= nil) then + from1, from2 = lPPA:find("text_PPA_QTY%c") + if (from2 ~= nil) then + to1, to2 = lPPA:find("%c", from2+2) + if (to1 ~= nil) then + lPPA1 = lPPA:sub(from2+1, to1-1) + end + end + + from1, from2 = lPPA:find("text_PPA_INT%c", to2) + if (from2 ~= nil) then + to1, to2 = lPPA:find("%c", from2+2) + if (to1 ~= nil) then + lPPA2 = lPPA:sub(from2+1, to1-1) + end + end + end + + -- string with max 2 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2022: "..string.format("%s", lPPA1)) + ExportScript.Tools.WriteToLog("2023: "..string.format("%s", lPPA2)) + end + ExportScript.Tools.SendData(2022, string.format("%s", lPPA1)) + ExportScript.Tools.SendData(2023, string.format("%s", lPPA2)) + + -- PCN_UR Navigation Displays + local lPCNUR = list_indication(10) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lPCNUR : '..ExportScript.Tools.dump(lPCNUR)) + end + + local to1, to2, from1, from2, lPCN_sub_L_T, lPCN_sub_R_T, lPCN_sub_L_B, lPCN_sub_R_B, lPCN_main_L, lPCN_main_R, lPCN_L_NODATA, lPCN_R_NODATA = nil, nil, nil, nil, "", "", "", "", "", "", "", "" + --[574] = "%.1f", --INS Parameter Selector + --ExportScript.Tools.WriteToLog("INS parameter Selector: "..string.format("%.1f", mainPanelDevice:get_argument_value(574))) + local lINSparameterSelector = tonumber(string.format("%.1f", mainPanelDevice:get_argument_value(574))) + --INS Parameter Selector + if lINSparameterSelector == 0.0 then + -- 0.0 = TR/VS + from1, from2 = lPCNUR:find("text_PCN_R_INT%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.1 then + -- 0.1 = D/RLT + from1, from2 = lPCNUR:find("text_PCN_R_DEG%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.2 then + -- 0.2 = BUT CP/PD + from1, from2 = lPCNUR:find("text_PCN_L_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.3 then + -- 0.3 = BUT ALT + from1, from2 = lPCNUR:find("text_PCN_PLUS_L%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_PLUS_R%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_L_INT%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_INT%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.4 then + -- 0.4 = BUT L/G + from1, from2 = lPCNUR:find("text_PCN_NORD%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_SOUTH%c") -- search text ???? + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_B = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_EST%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_OUEST%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_B = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_L_LG%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + lPCN_main_L = lPCN_main_L:gsub(":", ".") + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_LG%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + lPCN_main_R = lPCN_main_R:gsub(":", ".") + end + end + elseif lINSparameterSelector == 0.5 then + -- 0.5 = RD/TD + from1, from2 = lPCNUR:find("text_PCN_L_DEG%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_TD%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.6 then + -- 0.6 = BAD L/G + from1, from2 = lPCNUR:find("text_PCN_L_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_NORD%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_SUD%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_B = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_EST%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_OUEST%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_B = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.7 then + -- 0.7 = BAD ALT + from1, from2 = lPCNUR:find("text_PCN_L_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_PLUS_L%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_MOINS_L%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_B = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_PLUS_R%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_T = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_MOINS_R%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_R_B = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.8 then + -- 0.8 = BAD P/O + from1, from2 = lPCNUR:find("text_PCN_L_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_NODATA%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 0.9 then + -- 0.9 = DEC + from1, from2 = lPCNUR:find("text_PCN_L_DEG%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_PLUS_L%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_sub_L_T = lPCNUR:sub(from2+1, to1-1) + end + end + elseif lINSparameterSelector == 1.0 then + -- 1.0 = TV/FV + from1, from2 = lPCNUR:find("text_PCN_L_DEG%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_L = lPCNUR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNUR:find("text_PCN_R_INT%c") + if (from2 ~= nil) then + to1, to2 = lPCNUR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_main_R = lPCNUR:sub(from2+1, to1-1) + end + end + end + + if ExportScript.Config.Debug then + -- string with max 1 charachters + ExportScript.Tools.WriteToLog("2024: "..string.format("%s", lPCN_sub_L_T)) + ExportScript.Tools.WriteToLog("2025: "..string.format("%s", lPCN_sub_R_T)) + ExportScript.Tools.WriteToLog("2026: "..string.format("%s", lPCN_sub_L_B)) + ExportScript.Tools.WriteToLog("2027: "..string.format("%s", lPCN_sub_R_B)) + -- string with max 9 charachters + ExportScript.Tools.WriteToLog("2028: "..string.format("%s", lPCN_main_L)) + ExportScript.Tools.WriteToLog("2029: "..string.format("%s", lPCN_main_R)) + end + ExportScript.Tools.SendData(2024, string.format("%s", lPCN_sub_L_T)) + ExportScript.Tools.SendData(2025, string.format("%s", lPCN_sub_R_T)) + ExportScript.Tools.SendData(2026, string.format("%s", lPCN_sub_L_B)) + ExportScript.Tools.SendData(2027, string.format("%s", lPCN_sub_R_B)) + ExportScript.Tools.SendData(2028, string.format("%s", lPCN_main_L)) + ExportScript.Tools.SendData(2029, string.format("%s", lPCN_main_R)) + + -- PCN_BR (Naviagation, wahrscheinlich die Wegpunktanzeige) + local lPCNBR = list_indication(11) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('lPCNBR : '..ExportScript.Tools.dump(lPCNBR)) + end + + local to1, to2, from1, from2, lPCN_BR1, lPCN_BR2 = nil, nil, nil, nil, "", "" + to1, to2 = lPCNBR:find("PCN_BR") + if (to1 ~= nil) then + from1, from2 = lPCNBR:find("text_PCN_BR1%c") + if (from2 ~= nil) then + to1, to2 = lPCNBR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_BR1 = lPCNBR:sub(from2+1, to1-1) + end + end + + from1, from2 = lPCNBR:find("text_PCN_BR2%c", to2) + if (from2 ~= nil) then + to1, to2 = lPCNBR:find("%c", from2+2) + if (to1 ~= nil) then + lPCN_BR2 = lPCNBR:sub(from2+1, to1-1) + end + end + end + + -- string with max 2 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2030: "..string.format("%s", lPCN_BR1)) + ExportScript.Tools.WriteToLog("2031: "..string.format("%s", lPCN_BR2)) + end + ExportScript.Tools.SendData(2030, string.format("%s", lPCN_BR1)) + ExportScript.Tools.SendData(2031, string.format("%s", lPCN_BR2)) + +-- Radar IFF Mode +--[[ + [601] = "%.1f", -- 1. Drum + [602] = "%.1f", -- 2. + [603] = "%.1f", -- 3. + [604] = "%.1f", -- 4. +]] + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(601) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(602) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(603) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(604) * 10) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2032: "..string.format("%s", digits[1])) + ExportScript.Tools.WriteToLog("2033: "..string.format("%s", digits[2])) + ExportScript.Tools.WriteToLog("2034: "..string.format("%s", digits[3])) + ExportScript.Tools.WriteToLog("2035: "..string.format("%s", digits[4])) + end + + ExportScript.Tools.SendData(2032, digits[1]) + ExportScript.Tools.SendData(2033, digits[2]) + ExportScript.Tools.SendData(2034, digits[3]) + ExportScript.Tools.SendData(2035, digits[4]) + +-- VOR ILS +--[[ + [611] = "%.4f", -- 1. Drum + [612] = "%.4f", -- 2. + [613] = "%.4f", -- 3. + [614] = "%.4f", -- 4. + [615] = "%.4f", -- 5. +]] + digits = {} + digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(611) * 10) + digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(612) * 10) + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(613) * 10) + digits[4] = string.format("%1.0f",mainPanelDevice:get_argument_value(614) * 10) + digits[5] = string.format("%1.0f",mainPanelDevice:get_argument_value(615) * 10) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("2036-1: "..string.format("%s", digits[1])) + ExportScript.Tools.WriteToLog("2036-2: "..string.format("%s", digits[2])) + ExportScript.Tools.WriteToLog("2036-3: "..string.format("%s", digits[3])) + ExportScript.Tools.WriteToLog("2036-4: "..string.format("%s", digits[4])) + ExportScript.Tools.WriteToLog("2036-5: "..string.format("%s", digits[5])) + end + + ExportScript.Tools.SendData(2036, digits[1]..digits[2]..digits[3].."."..digits[4]..digits[5]) + +-- TACAN +--[[ + [620] = "%.1f", -- X/Y + [621] = "%.4f", -- Drum XX0 left (--;1-12;--) + [622] = "%.4f", -- Drum 00X right (0;1-9;0) +]] + local lTACAN_FREQUENCE1 = {[-0.3]=" ",[-0.2]="1",[-0.1]="2",[0.0]="3",[0.1]="4",[0.2]="5",[0.3]="6",[0.4]="7",[0.5]="8",[0.6]="9",[0.7]="10",[0.8]="11",[0.9]="12",[1.0]=" "} + digits = {} + --digits[1] = string.format("%1.0f",mainPanelDevice:get_argument_value(620) * 10) + --digits[2] = string.format("%1.0f",mainPanelDevice:get_argument_value(621) * 10) + digits[1] = (mainPanelDevice:get_argument_value(620) == 0 and "X" or "Y") + digits[2] = lTACAN_FREQUENCE1[tonumber(string.format("%0.1f",mainPanelDevice:get_argument_value(621)))] + digits[3] = string.format("%1.0f",mainPanelDevice:get_argument_value(622) * 10) + digits[3] = (digits[3] == "10" and "0" or digits[3]) + + ExportScript.Tools.SendData(2037, digits[1]..digits[2]..digits[3]) + +-- U/VHF Com + ExportScript.Tools.SendData(2038, ExportScript.Tools.DisplayFormat(string.format("%1.0f",mainPanelDevice:get_argument_value(440) * 10), 1)) + ExportScript.Tools.SendData(2039, ExportScript.Tools.DisplayFormat(string.format("%1.0f",mainPanelDevice:get_argument_value(441) * 10), 1)) + ExportScript.Tools.SendData(2040, ExportScript.Tools.DisplayFormat(string.format("%1.0f",mainPanelDevice:get_argument_value(442) * 10), 1)) + ExportScript.Tools.SendData(2041, ExportScript.Tools.DisplayFormat(string.format("%1.0f",mainPanelDevice:get_argument_value(443) * 10), 1)) + local lTmpNumber = tonumber(string.format("%1.0f",mainPanelDevice:get_argument_value(444) * 100)) + if lTmpNumber == 0 then + lTmpNumber = "00" + end + ExportScript.Tools.SendData(2042, ExportScript.Tools.DisplayFormat(tostring(lTmpNumber), 2)) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('2038: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(440) * 10))) + ExportScript.Tools.WriteToLog('2039: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(441) * 10))) + ExportScript.Tools.WriteToLog('2040: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(442) * 10))) + ExportScript.Tools.WriteToLog('2041: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(443) * 10))) + ExportScript.Tools.WriteToLog('2042: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(444) * 100))) + ExportScript.Tools.WriteToLog('2042-2: '..ExportScript.Tools.dump(lTmpNumber)) + end + +-- U/VHF Com Preset + --[436] = "%.4f", -- Preset display (1-20) + local lUVHF_RADIO_PRESET = {[0.00]="1",[0.10]="2",[0.15]="3",[0.20]="4",[0.25]="5",[0.30]="6",[0.35]="7",[0.40]="8",[0.45]="9",[0.50]="10",[0.55]="11",[0.60]="12",[0.65]="13",[0.70]="14",[0.75]="15",[0.80]="16",[0.85]="17",[0.09]="18",[0.95]="19",[1.00]="20"} + ExportScript.Tools.SendData(436, ExportScript.Tools.DisplayFormat(lUVHF_RADIO_PRESET[tonumber(string.format("%1.2f",mainPanelDevice:get_argument_value(436)))], 2)) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('436-1: '..ExportScript.Tools.dump(string.format("%1.2f",mainPanelDevice:get_argument_value(436)))) + ExportScript.Tools.WriteToLog('436-2: '..ExportScript.Tools.dump(lUVHF_RADIO_PRESET[tonumber(string.format("%1.2f",mainPanelDevice:get_argument_value(436)))])) + end + +-- VHF Com Preset + --[190] = "%.4f", -- Drum X0 Preset (0-1-2) + --[189] = "%.4f", -- Drum 0X Preset (0-9-0) + local lVHF_RADIO_PRESET = {[0.0]="0",[0.1]="1",[0.2]="2",[0.3]="3",[0.4]="4",[0.5]="5",[0.6]="6",[0.7]="7",[0.8]="8",[0.9]="9",[1.0]="0"} + local lTmpNumber = mainPanelDevice:get_argument_value(190) + if lTmpNumber > 0.2 then + lTmpNumber = 0.2 + end + ExportScript.Tools.SendData(189, ExportScript.Tools.DisplayFormat(lVHF_RADIO_PRESET[tonumber(string.format("%1.1f",lTmpNumber))]..lVHF_RADIO_PRESET[tonumber(string.format("%1.1f",mainPanelDevice:get_argument_value(189)))], 2)) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('189: '..ExportScript.Tools.dump(lVHF_RADIO_PRESET[tonumber(string.format("%1.1f",lTmpNumber))]..lVHF_RADIO_PRESET[tonumber(string.format("%1.1f",mainPanelDevice:get_argument_value(189)))])) + end + +-- Display Settings + --[224] = "%.4f", --Drum X000 + --[225] = "%.4f", --Drum 0X00 + --[226] = "%.4f", --Drum 00X0 + --[227] = "%.4f", --Drum 000X + digits = {} + digits[1] = mainPanelDevice:get_argument_value(224) * 10 + digits[2] = mainPanelDevice:get_argument_value(225) * 10 + digits[3] = mainPanelDevice:get_argument_value(226) * 10 + digits[4] = mainPanelDevice:get_argument_value(227) * 10 + digits[1] = (digits[1] > 7 and 7 or digits[1]) + digits[2] = (digits[2] > 7 and 7 or digits[2]) + digits[3] = (digits[3] > 7 and 7 or digits[3]) + digits[4] = (digits[4] > 7 and 7 or digits[4]) + ExportScript.Tools.SendData(224, string.format("%1.0f",digits[1])) + ExportScript.Tools.SendData(225, string.format("%1.0f",digits[2])) + ExportScript.Tools.SendData(226, string.format("%1.0f",digits[3])) + ExportScript.Tools.SendData(227, string.format("%1.0f",digits[4])) + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('224: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(224) * 10))) + ExportScript.Tools.WriteToLog('225: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(225) * 10))) + ExportScript.Tools.WriteToLog('226: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(226) * 10))) + ExportScript.Tools.WriteToLog('227: '..ExportScript.Tools.dump(string.format("%1.0f",mainPanelDevice:get_argument_value(227) * 10))) + end + + ExportScript.Tools.FlushData() +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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025)) + ]] + + -- ECM_CHF + local lECM_CHF = ExportScript.Tools.getListIndicatorValue(3) + + if lECM_CHF ~= nil and lECM_CHF.text_ECM_CHF ~= nil then + -- string with max 3 charachters + ExportScript.Tools.SendDataDAC(2001, string.format("%s", lECM_CHF.text_ECM_CHF)) + else + ExportScript.Tools.SendDataDAC(2001, "-") + end + + -- ECM_FLR + local lECM_FLR = ExportScript.Tools.getListIndicatorValue(4) + + if lECM_FLR ~= nil and lECM_FLR.text_ECM_FLR ~= nil then + -- string with max 2 charachters + ExportScript.Tools.SendDataDAC(2002, string.format("%s", lECM_FLR.text_ECM_FLR)) + else + ExportScript.Tools.SendDataDAC(2002, "-") + end + + -- FUEL + local lFUEL = ExportScript.Tools.getListIndicatorValue(5) + + if lFUEL ~= nil and lFUEL.txt_fuel_g ~= nil then + -- string with max 3 charachters + ExportScript.Tools.SendDataDAC(2003, string.format("%s", lFUEL.txt_fuel_g)) + else + ExportScript.Tools.SendDataDAC(2003, "-") + end + + -- COM + local lCOM = list_indication(9) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('COM : '..ExportScript.Tools.dump(lCOM)) + end + + local to1, to2, from1, from2, lCOM1, lCOM2 = nil, nil, nil, nil, "-", "-" + to1, to2 = lCOM:find("COM") + if (to1 ~= nil) then + from1, from2 = lCOM:find("text_COM_UHF1%c") + if (from2 ~= nil) then + to1, to2 = lCOM:find("%c", from2+2) + if (to1 ~= nil) then + lCOM1 = lCOM:sub(from2+1, to1-1) + end + end + + from1, from2 = lCOM:find("text_COM_UHF2%c", to2) + if (from2 ~= nil) then + to1, to2 = lCOM:find("%c", from2+2) + if (to1 ~= nil) then + lCOM2 = lCOM:sub(from2+1, to1-1) + end + end + end + + -- string with max 7 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("lCOM1: "..string.format("%s", lCOM1)) + ExportScript.Tools.WriteToLog("lCOM2: "..string.format("%s", lCOM2)) + end + ExportScript.Tools.SendDataDAC(2020, string.format("%s", lCOM1)) + ExportScript.Tools.SendDataDAC(2021, string.format("%s", lCOM2)) + + -- PPA (vielelicht die Bomben Anzeige unten rechts) + local lPPA = list_indication(8) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog('PPA : '..ExportScript.Tools.dump(lPPA)) + end + + local to1, to2, from1, from2, lPPA1, lPPA2 = nil, nil, nil, nil, "-", "-" + to1, to2 = lPPA:find("PPA") + if (to1 ~= nil) then + from1, from2 = lPPA:find("text_PPA_QTY%c") + if (from2 ~= nil) then + to1, to2 = lPPA:find("%c", from2+2) + if (to1 ~= nil) then + lPPA1 = lPPA:sub(from2+1, to1-1) + end + end + + from1, from2 = lPPA:find("text_PPA_INT%c", to2) + if (from2 ~= nil) then + to1, to2 = lPPA:find("%c", from2+2) + if (to1 ~= nil) then + lPPA2 = lPPA:sub(from2+1, to1-1) + end + end + end + + -- string with max 2 charachters + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("lPPA1: "..string.format("%s", lPPA1)) + ExportScript.Tools.WriteToLog("lPPA2: "..string.format("%s", lPPA2)) + end + ExportScript.Tools.SendDataDAC(2022, string.format("%s", lPPA1)) + ExportScript.Tools.SendDataDAC(2023, string.format("%s", lPPA2)) + + -- send data + ExportScript.Tools.FlushDataDAC(#ExportScript.Config.DAC) + + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + -- list_indication get tehe value of cockpit displays + local ltmp1 = 0 + for ltmp2 = 0, 20, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + end + ]] +--[[ + -- getmetatable get function name from devices + local ltmp1 = 0 + for ltmp2 = 1, 70, 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 -- +----------------------------- \ No newline at end of file diff --git a/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua b/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua index adfe652..ea1374f 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua @@ -1,7 +1,7 @@ -- Mi-8MTV2 Export --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.Mi8MT = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua index fe47f7e..b051cd9 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua @@ -1,7 +1,7 @@ -- MiG-15Bis --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.MiG15bis = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua index 617b50a..c2f6b7f 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua @@ -1,7 +1,7 @@ -- MiG-21Bis Export --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.MiG21Bis = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua index 24dfb1e..d9900d8 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua @@ -1,7 +1,7 @@ -- MiG-29A Export --- Version 1.0.2 ExportScript.FoundFCModule = true +ExportScript.Version.MiG29A = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/MiG-29G.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-29G.lua index 0275bfb..25bf503 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/MiG-29G.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-29G.lua @@ -1,7 +1,7 @@ -- MiG-29G Export --- Version 1.0.2 ExportScript.FoundFCModule = true +ExportScript.Version.MiG29G = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua index 157b0aa..688a188 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua @@ -1,7 +1,7 @@ -- MiG-29S Export --- Version 1.0.2 ExportScript.FoundFCModule = true +ExportScript.Version.MiG29S = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua b/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua index 7d83a0a..d479156 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua @@ -1,7 +1,7 @@ -- P-51D Export --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.P51D = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/SA342L.lua b/Scripts/DCS-ExportScript/ExportsModules/SA342L.lua index a39b952..aa83c1d 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/SA342L.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/SA342L.lua @@ -1,7 +1,7 @@ -- SA342L --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.SA342L = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/SA342M.lua b/Scripts/DCS-ExportScript/ExportsModules/SA342M.lua index 6e4a9ea..80d4281 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/SA342M.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/SA342M.lua @@ -1,7 +1,7 @@ -- SA342M --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.SA342M = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/SA342Mistral.lua b/Scripts/DCS-ExportScript/ExportsModules/SA342Mistral.lua index e5a2eaf..156ea29 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/SA342Mistral.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/SA342Mistral.lua @@ -1,7 +1,7 @@ -- SA342Mistral --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.SA342Mistral = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua b/Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua index 412f1a8..d0ca718 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua @@ -1,7 +1,7 @@ -- Spitfire LFMk IX --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.SpitfireLFMkIX = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/Su-25.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-25.lua index 3b07338..b31ba65 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Su-25.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Su-25.lua @@ -1,7 +1,7 @@ -- Su-25A Export --- Version 1.0.2 ExportScript.FoundFCModule = true +ExportScript.Version.Su25 = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua index f41bdf7..6197bb7 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua @@ -1,7 +1,7 @@ -- Su-25T Export --- Version 1.0.2 ExportScript.FoundFCModule = true +ExportScript.Version.Su25T = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua index a6abfb6..b5943ae 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua @@ -1,7 +1,7 @@ -- Su-27 Export --- Version 1.0.2 -ExportScript.FoundFCModule = true +ExportScript.FoundFCModule = true +ExportScript.Version.Su27 = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/Su-33.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-33.lua index 6e9a521..82bc00c 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Su-33.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Su-33.lua @@ -1,7 +1,7 @@ -- Su-33 Export --- Version 1.0.2 -ExportScript.FoundFCModule = true +ExportScript.FoundFCModule = true +ExportScript.Version.Su33 = "1.1.0" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") diff --git a/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua b/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua index 0863fd1..21e4582 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua @@ -1,7 +1,7 @@ -- TF-51D Export --- Version 1.0.2 ExportScript.FoundDCSModule = true +ExportScript.Version.TF51D = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua b/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua index 317e81f..7f2d3a7 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua @@ -1,7 +1,7 @@ --- Uh-1H Export --- Version 1.0.2 +-- Uh-1H ExportScript.FoundDCSModule = true +ExportScript.Version.UH1H = "1.1.0" ExportScript.ConfigEveryFrameArguments = { diff --git a/Scripts/DCS-ExportScript/lib/Maps.lua b/Scripts/DCS-ExportScript/lib/Maps.lua index fe079f8..3fea0c1 100644 --- a/Scripts/DCS-ExportScript/lib/Maps.lua +++ b/Scripts/DCS-ExportScript/lib/Maps.lua @@ -1,5 +1,4 @@ -- Ikarus and D.A.C. Export Script --- Version 1.0.1 -- -- Map Config File -- @@ -14,6 +13,8 @@ -- Lat2 and Long2 contain the coordinates of the lower right corner. -- +ExportScript.Version.Maps = "1.1.0" + -- Maps ExportScript.Maps = {} -- Caucasus Map diff --git a/Scripts/DCS-ExportScript/lib/Tools.lua b/Scripts/DCS-ExportScript/lib/Tools.lua index 8949f33..1744895 100644 --- a/Scripts/DCS-ExportScript/lib/Tools.lua +++ b/Scripts/DCS-ExportScript/lib/Tools.lua @@ -1,12 +1,12 @@ -- Ikarus and D.A.C. Export Script --- Version 1.0.2 -- -- Tools -- --- Copyright by Michael aka McMicha 2014 - 2017 +-- Copyright by Michael aka McMicha 2014 - 2018 -- Contact dcs2arcaze.micha@farbpigmente.org ExportScript.Tools = {} +ExportScript.Version.Tools = "1.1.0" function ExportScript.Tools.WriteToLog(message) if ExportScript.logFile then @@ -20,6 +20,44 @@ function ExportScript.Tools.WriteToLog(message) end end +function ExportScript.Tools.createUDPSender() + ExportScript.socket = require("socket") + + local lcreateUDPSender = ExportScript.socket.protect(function() + ExportScript.UDPsender = ExportScript.socket.udp() + ExportScript.socket.try(ExportScript.UDPsender:setsockname("*", 0)) + ExportScript.socket.try(ExportScript.UDPsender:settimeout(.004)) -- set the timeout for reading the socket; 250 fps + end) + + local ln, lerror = lcreateUDPSender() + if lerror ~= nil then + ExportScript.Tools.WriteToLog("createUDPSender protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror)) + return + end + + ExportScript.Tools.WriteToLog("Create UDPSender") +end + +function ExportScript.Tools.createUDPListner() + if ExportScript.Config.Listener then + ExportScript.socket = require("socket") + + local lcreateUDPListner = ExportScript.socket.protect(function() + ExportScript.UDPListener = ExportScript.socket.udp() + ExportScript.socket.try(ExportScript.UDPListener:setsockname("*", ExportScript.Config.ListenerPort)) + ExportScript.socket.try(ExportScript.UDPListener:settimeout(.004)) -- set the timeout for reading the socket; 250 fps + end) + + local ln, lerror = lcreateUDPListner() + if lerror ~= nil then + ExportScript.Tools.WriteToLog("createUDPListner protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror)) + return + end + + ExportScript.Tools.WriteToLog("Create UDPListner") + end +end + function ExportScript.Tools.ProcessInput() local lCommand, lCommandArgs, lDevice -- C1,3001,4 @@ -28,8 +66,30 @@ function ExportScript.Tools.ProcessInput() -- lCommandArgs[2] = 3001 => ButtonID -- lCommandArgs[3] = 4 => Value if ExportScript.Config.Listener then - local lInput,from,port = ExportScript.UDPListener:receivefrom() - if ExportScript.Config.Debug then + --local lInput,from,port = ExportScript.UDPListener:receivefrom() + ExportScript.UDPListenerValues = {} + + local lUDPListenerReceivefrom = ExportScript.socket.protect(function() + --[[ + local try = ExportScript.socket.newtry(function() + ExportScript.UDPListener:close() + ExportScript.Tools.createUDPListner() + end) + ExportScript.UDPListenerValues.Input, ExportScript.UDPListenerValues.from, ExportScript.UDPListenerValues.port = try(ExportScript.UDPListener:receivefrom()) + ]] -- Bei einer newtry Funktion wird im fehlerfall deren inhalt ausgeführt. + ExportScript.UDPListenerValues.Input, ExportScript.UDPListenerValues.from, ExportScript.UDPListenerValues.port = ExportScript.socket.try(ExportScript.UDPListener:receivefrom()) + end) + + local ln, lerror = lUDPListenerReceivefrom() + if lerror ~= nil and lerror ~= "timeout" then + ExportScript.Tools.WriteToLog("UDPListenerReceivefrom protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror)) + ExportScript.UDPListener:close() + ExportScript.Tools.createUDPListner() + end + + local lInput, from, port = ExportScript.UDPListenerValues.Input, ExportScript.UDPListenerValues.from, ExportScript.UDPListenerValues.port + + if ExportScript.Config.SocketDebug then ExportScript.Tools.WriteToLog("lInput: "..ExportScript.Tools.dump(lInput)..", from: "..ExportScript.Tools.dump(from)..", port: "..ExportScript.Tools.dump(port)) end if lInput then @@ -52,24 +112,50 @@ function ExportScript.Tools.ProcessInput() if (lCommand == "C") then lCommandArgs = ExportScript.Tools.StrSplit(string.sub(lInput,2),",") - lDevice = GetDevice(lCommandArgs[1]) - if lDevice ~= "1000" then - if type(lDevice) == "table" then - lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) - if ExportScript.Config.Debug then - ExportScript.Tools.WriteToLog("Verarbeite fuer Device: "..lCommandArgs[1]..", ButtonID: "..lCommandArgs[2]..", mit Wert: "..lCommandArgs[3]) - end - end - elseif lDevice == "1000" then - --ExportScript.genericRadio(key, value) - ExportScript.genericRadio(lCommandArgs[2],lCommandArgs[3]) - if ExportScript.Config.Debug then - ExportScript.Tools.WriteToLog("Verarbeite fuer genericRadio, ButtonID: "..lCommandArgs[2]..", mit Wert: "..lCommandArgs[3]) - end - end - end - end - end + lDeviceID = tonumber(lCommandArgs[1]) + if lDeviceID < 1000 then + -- DCS Modules + lDevice = GetDevice(lCommandArgs[1]) + if ExportScript.FoundDCSModule and type(lDevice) == "table" then + lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("performClickableAction for Device: "..lCommandArgs[1]..", ButtonID: "..lCommandArgs[2]..", Value: "..lCommandArgs[3]) + end + end + elseif lDeviceID == 1000 then + -- ExportScript.genericRadio(key, value) + if ExportScript.FoundDCSModule then + ExportScript.genericRadio(lCommandArgs[2],lCommandArgs[3]) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("genericRadio, ButtonID: "..lCommandArgs[2]..", Value: "..lCommandArgs[3]) + end + end + elseif lDeviceID == 2000 then + -- Flaming Cliffs Module (Buttons) + if ExportScript.FoundFCModule then + -- ComamndID > 3000, because DAC or Ikarus add 300 to CommandID + local lComandID = (tonumber(lCommandArgs[2]) - 3000) + if tonumber(lCommandArgs[3]) == 1.0 then + LoSetCommand(lComandID) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("LoSetCommand, CommandID: "..lComandID) + end + end + end + elseif lDeviceID == 2001 then + -- Flaming Cliffs Module (analog axies) + if ExportScript.FoundFCModule then + -- ComamndID > 3000, because DAC or Ikarus add 3000 to CommandID + local lComandID = (tonumber(lCommandArgs[2]) - 3000) + LoSetCommand(lComandID, lCommandArgs[3]) + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("LoSetCommand, CommandID: "..lComandID..", Value: "..lCommandArgs[3]) + end + end + end + end + end + end end function ExportScript.Tools.ProcessOutput() @@ -270,6 +356,7 @@ function ExportScript.Tools.StrSplit(str, delim, maxNb) local lNb = 0 local lLastPos for part, pos in string.gfind(str, lPat) do + -- for part, pos in string.gmatch(str, lPat) do -- Lua Version > 5.1 lNb = lNb + 1 lResult[lNb] = part lLastPos = pos @@ -429,6 +516,7 @@ function ExportScript.Tools.SendDataDAC(id, value) end end +--[[ function ExportScript.Tools.FlushData() if #ExportScript.SendStrings > 0 then local lES_SimID = "" @@ -437,25 +525,85 @@ function ExportScript.Tools.FlushData() local lPacket = lES_SimID .. table.concat(ExportScript.SendStrings, ExportScript.Config.IkarusSeparator) .. "\n" ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort)) + + if ExportScript.Config.SocketDebug then + ExportScript.Tools.WriteToLog("FlushData: send the following data to host: "..ExportScript.Config.IkarusHost..", Port: "..ExportScript.Config.IkarusPort..", Data: "..lPacket) + end + ExportScript.SendStrings = {} ExportScript.PacketSize = 0 - end + else + if ExportScript.Config.SocketDebug then + ExportScript.Tools.WriteToLog("FlushData: nothing sent") + end + end end +]] + +function ExportScript.Tools.FlushData() + local lFlushData = ExportScript.socket.protect(function() + if #ExportScript.SendStrings > 0 then + local lES_SimID = "" + + lES_SimID = ExportScript.SimID + + local lPacket = lES_SimID .. table.concat(ExportScript.SendStrings, ExportScript.Config.IkarusSeparator) .. "\n" + --ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort)) + local try = ExportScript.socket.newtry(function() ExportScript.UDPsender:close() ExportScript.Tools.createUDPSender() ExportScript.Tools.ResetChangeValues() end) + try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort)) + + if ExportScript.Config.SocketDebug then + ExportScript.Tools.WriteToLog("FlushData: send to host: "..ExportScript.Config.IkarusHost..", Port: "..ExportScript.Config.IkarusPort..", Data: "..lPacket) + end + + ExportScript.SendStrings = {} + ExportScript.PacketSize = 0 + else + if ExportScript.Config.SocketDebug then + ExportScript.Tools.WriteToLog("FlushData: nothing sent") + end + end + end) + + local ln, lerror = lFlushData() + if lerror ~= nil then + ExportScript.Tools.WriteToLog("FlushData protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror)) + end +end + function ExportScript.Tools.FlushDataDAC(hardware) hardware = hardware or 1 if ExportScript.Config.DAC[hardware] == nil then - ExportScript.Tools.WriteToLog("unknown hardware ID '"..hardware.."'") + ExportScript.Tools.WriteToLog("FlushDataDAC: unknown hardware ID '"..hardware.."'") return end - if #ExportScript.SendStringsDAC[hardware] > 0 then - local lPacket = ExportScript.SimID .. table.concat(ExportScript.SendStringsDAC[hardware], ExportScript.Config.DAC[hardware].Separator) .. "\n" - ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort)) - ExportScript.SendStringsDAC[hardware] = {} - ExportScript.PacketSizeDAC[hardware] = 0 - end + local lFlushDataDAC = ExportScript.socket.protect(function() + if #ExportScript.SendStringsDAC[hardware] > 0 then + local lPacket = ExportScript.SimID .. table.concat(ExportScript.SendStringsDAC[hardware], ExportScript.Config.DAC[hardware].Separator) .. "\n" + --ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort)) + local try = ExportScript.socket.newtry(function() ExportScript.UDPsender:close() ExportScript.Tools.createUDPSender() ExportScript.Tools.ResetChangeValuesDAC() end) + try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort)) + + if ExportScript.Config.SocketDebug then + ExportScript.Tools.WriteToLog("FlushDataDAC["..hardware.."]: send to host: "..ExportScript.Config.DAC[hardware].Host..", Port: "..ExportScript.Config.DAC[hardware].SendPort..", Data: "..lPacket) + end + + ExportScript.SendStringsDAC[hardware] = {} + ExportScript.PacketSizeDAC[hardware] = 0 + else + if ExportScript.Config.SocketDebug then + ExportScript.Tools.WriteToLog("FlushDataDAC["..hardware.."]: nothing sent") + end + end + end) + + local ln, lerror = lFlushDataDAC() + if lerror ~= nil then + ExportScript.Tools.WriteToLog("FlushDataDAC protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror)) + end end function ExportScript.Tools.ResetChangeValues() @@ -516,6 +664,11 @@ function ExportScript.Tools.SelectModule() end ExportScript.Tools.WriteToLog("File '"..lModuleFile.."' loaded") + + ExportScript.Tools.WriteToLog("Version:") + for k,v in pairs(ExportScript.Version) do + ExportScript.Tools.WriteToLog(k..": "..v) + end ExportScript.FirstNewDataSend = true ExportScript.FirstNewDataSendCount = 5 @@ -585,6 +738,11 @@ function ExportScript.Tools.SelectModule() ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACLowImportanceNoConfig ExportScript.EveryFrameArguments = {} ExportScript.Arguments = {} + + ExportScript.Tools.WriteToLog("Version:") + for k,v in pairs(ExportScript.Version) do + ExportScript.Tools.WriteToLog(k..": "..v) + end ExportScript.Tools.WriteToLog("Unknown Module Name: "..lMyInfo.Name) end end @@ -721,9 +879,11 @@ function ExportScript.Tools.RoundFreqeuncy(Freqeuncy, Format, PrefixZeros, Least tmpstring = string.format("%."..tmp2.."f", tmpstring) - while string.len(tmpstring) < tmp1 do - tmpstring = " "..tmpstring - end +-- while string.len(tmpstring) < tmp1 do +-- tmpstring = " "..tmpstring +-- end + + tmpstring = string.rep(" ", tmp1 - string.len(tmpstring))..tmpstring if prefixzeros then tmpstring = string.gsub(tmpstring, " ", "0") @@ -758,6 +918,34 @@ function ExportScript.Tools.getListIndicatorValue(IndicatorID) return TmpReturn end +-- The function format a given string for a display +-- String: value for show in display, maxChars: Display size (default 5), LEFTorRIGHT: flush with left "l" or right "r" site (default "r") +function ExportScript.Tools.DisplayFormat(String, maxChars, LEFTorRight, DAC) + local lString = String or "" + local lmaxChars = maxChars or 5 + local lLEFTorRight = LEFTorRight or "r" + local lDAC = DAC or false + local lTmpLen = 0 + local lRep = " " + + if lDAC then + lRep = "-" + end + + lString = ExportScript.utf8.sub(lString, 0, lmaxChars) + lTmpLen = ExportScript.utf8.len(lString) + + if lTmpLen < lmaxChars then + if string.lower(lLEFTorRight) == "l" then + lString = lString..string.rep(" ", lmaxChars - lTmpLen) + else + lString = string.rep(" ", lmaxChars - lTmpLen)..lString + end + end + + return lString +end + -- Pointed to by ExportScript.ProcessIkarusDCSHighImportance, if the player aircraft is something else function ExportScript.ProcessIkarusDCSHighImportanceNoConfig(mainPanelDevice) end diff --git a/Scripts/DCS-ExportScript/lib/genericRadio.lua b/Scripts/DCS-ExportScript/lib/genericRadio.lua index c043a54..872e6c4 100644 --- a/Scripts/DCS-ExportScript/lib/genericRadio.lua +++ b/Scripts/DCS-ExportScript/lib/genericRadio.lua @@ -1,11 +1,12 @@ -- Ikarus and D.A.C. Export Script --- Version 1.0.2 -- -- generic Radio File -- -- Copyright by Michael aka McMicha 2014 -- Contact dcs2arcaze.micha@farbpigmente.org +ExportScript.Version.genericRadio = "1.1.0" + --[[ -- Config and execute in function ExportScript.ProcessDACConfigLowImportance()