├── .gitignore ├── KnownErros.md ├── LICENSE ├── README.md ├── Scripts ├── DCS-ExportScript │ ├── Config.lua │ ├── ExportScript.lua │ ├── ExportsModules │ │ ├── A-10A.lua │ │ ├── A-10C.lua │ │ ├── AJS37.lua │ │ ├── AV8BNA.lua │ │ ├── Bf-109K-4.lua │ │ ├── Empty-DCS.lua │ │ ├── F-15C.lua │ │ ├── F-5E-3.lua │ │ ├── F-86F Sabre.lua │ │ ├── FA-18C_hornet.lua │ │ ├── FC_AuxiliaryFuntions.lua │ │ ├── FW-190D9.lua │ │ ├── J-11A.lua │ │ ├── Ka-50.lua │ │ ├── L-39C.lua │ │ ├── L-39ZA.lua │ │ ├── M-2000C.lua │ │ ├── Mi-8MT.lua │ │ ├── MiG-15bis.lua │ │ ├── MiG-21Bis.lua │ │ ├── MiG-29A.lua │ │ ├── MiG-29G.lua │ │ ├── MiG-29S.lua │ │ ├── P-51D-30-NA.lua │ │ ├── P-51D.lua │ │ ├── SA342L.lua │ │ ├── SA342M.lua │ │ ├── SA342Mistral.lua │ │ ├── SpitfireLFMkIX.lua │ │ ├── SpitfireLFMkIXCW.lua │ │ ├── Su-25.lua │ │ ├── Su-25T.lua │ │ ├── Su-27.lua │ │ ├── Su-33.lua │ │ ├── TF-51D.lua │ │ └── UH-1H.lua │ └── lib │ │ ├── Maps.lua │ │ ├── Tools.lua │ │ ├── genericRadio.lua │ │ └── utf8.lua └── Export.lua └── docu ├── Documentation-in-English.pdf ├── Dokumentation-in-Deutsch.pdf └── flowchart.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Lua sources 2 | luac.out 3 | 4 | # luarocks build files 5 | *.src.rock 6 | *.zip 7 | *.tar.gz 8 | 9 | # Object files 10 | *.o 11 | *.os 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | *.def 26 | *.exp 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | # swap file 43 | *.*~ 44 | -------------------------------------------------------------------------------- /KnownErros.md: -------------------------------------------------------------------------------- 1 | # Known errors are listed here. 2 | --- 3 | Please do not complain about the mistakes, but find a solution. 4 | --- 5 | 6 | On all Flaming Cliffs aircraft there are problems with the display of various instruments or warning lights. 7 | 8 | E.g. 9 | - Many data of the functions LoGetEngineInfo(), LoGetMCPState(), ... 10 | - In the A-10A / F-15C, there are differences between the metric return values of the LoGetAltitudeAboveSeaLevel(), LoGetAltitudeAboveGroundLevel(), LoGetTrueAirSpeed(), ..., and the converted values values. 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | 167 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deutsch 2 | --- 3 | Dies ist ein universell einsetzbares Export Script für DCS. 4 | Es wird der gleichzeitige Export von Daten an Virtual Cockpit Software und I/O Hardware ermöglicht. 5 | 6 | Zur Zeit werden folgende Export-Formate unterstützt. 7 | - DAC (DCS Arcaze Connector) von [H-J-P](https://github.com/H-J-P/DAC/) um die Arcaze USB Controller anzusprechen (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB) 8 | - Ikarus von [H-J-P](https://github.com/H-J-P/Ikarus), unsere Virtual Cockpit Software 9 | 10 | Der Export von Daten wird für folgende Module unterstützt: 11 | - A-10C 12 | - AJS37 13 | - AV-8B N/A 14 | - Bf-109K-4 15 | - F/A-18C Hornet 16 | - F-5E-3 17 | - F-86F 18 | - FW-190D9 19 | - Ka-50 20 | - L-39C/ZA 21 | - Mi-8MT 22 | - MiG-15bis 23 | - MiG-21Bis 24 | - Mirage 2000 25 | - P-51D 25/30-NA 26 | - SA342L/M/Mistral 27 | - SpitfireLFMkIX/CW 28 | - Su-25T 29 | - TF-51D 30 | - UH-1H 31 | - alle Flaming Cliffs Flugzeuge + J-11A 32 | 33 | Kompatibel zur DCS World 2.5.4 und BETA Version 34 | 35 | # English 36 | --- 37 | This is an universally insertable export script for DCS. It allows for the simultaneous export of data at virtual cockpit software and I/O hardware. 38 | 39 | At present the following export formats are supported: 40 | - DAC (DCS Arcaze Connector) by [H-J-P](https://github.com/H-J-P/DAC/) to address the Arcaze USB Controller (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB) 41 | - Ikarus by [H-J-P](https://github.com/H-J-P/Ikarus), our virtual cockpit software 42 | 43 | Following moduls are supported: 44 | - A-10C 45 | - AJS37 46 | - AV-8B N/A 47 | - Bf-109K-4 48 | - F/A-18C Hornet 49 | - F-5E-3 50 | - F-86F 51 | - FW-190D9 52 | - Ka-50 53 | - L-39C/ZA 54 | - Mi-8MT 55 | - MiG-15bis 56 | - MiG-21Bis 57 | - Mirage 2000 58 | - P-51D 25/30-NA 59 | - SA342L/M/Mistral 60 | - SpitfireLFMkIX/CW 61 | - Su-25T 62 | - TF-51D 63 | - UH-1H 64 | - all Flaming Cliffs aircrafts + J-11A 65 | 66 | Compatible with DCS World 2.5.4 and BETA version 67 | 68 | # Wiki 69 | --- 70 | [DCS-ExportScript Wiki and Docu](https://github.com/s-d-a/DCS-ExportScripts/wiki) (in Deutsch and English) 71 | -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/Config.lua: -------------------------------------------------------------------------------- 1 | -- Ikarus and D.A.C. Export Script 2 | -- 3 | -- Config File 4 | -- 5 | -- Copyright by Michael aka McMicha 2014 6 | -- Contact dcs2arcaze.micha@farbpigmente.org 7 | 8 | ExportScript.Config = {} 9 | ExportScript.Version.Config = "1.2.1" 10 | 11 | -- Ikarus a Glass Cockpit Software 12 | ExportScript.Config.IkarusExport = true -- false for not use 13 | ExportScript.Config.IkarusHost = "127.0.0.1" -- IP for Ikarus 14 | ExportScript.Config.IkarusPort = 1625 -- Port Ikarus (1625) 15 | ExportScript.Config.IkarusSeparator = ":" 16 | 17 | -- D.A.C. (DCS Arcaze Connector) 18 | ExportScript.Config.DACExport = false -- true for use 19 | ExportScript.Config.DAC = {} 20 | -- first hardware 21 | ExportScript.Config.DAC[1] = {} 22 | ExportScript.Config.DAC[1].Host = "127.0.0.1" -- IP for hardware 1 23 | ExportScript.Config.DAC[1].SendPort = 26026 -- Port for hardware 1 24 | ExportScript.Config.DAC[1].Separator = ":" 25 | -- secound to n hardware 26 | --ExportScript.Config.DAC[2] = {} 27 | --ExportScript.Config.DAC[2].Host = "127.0.0.1" -- IP for hardware 2 28 | --ExportScript.Config.DAC[2].SendPort = 9092 -- Port for hardware 2 29 | --ExportScript.Config.DAC[2].Separator = ":" 30 | 31 | -- Ikarus and D.A.C. can data send 32 | ExportScript.Config.Listener = true -- false for not use 33 | ExportScript.Config.ListenerPort = 26027 -- Listener Port for D.A.C. 34 | 35 | -- Other 36 | ExportScript.Config.ExportInterval = 0.05 -- export evry 0.05 secounds 37 | ExportScript.Config.ExportLowTickInterval = 0.5 -- export evry 0.5 secounds 38 | ExportScript.Config.LogPath = lfs.writedir()..[[Logs\Export.log]] 39 | ExportScript.Config.ExportModulePath = lfs.writedir()..[[Scripts\DCS-ExportScript\ExportsModules\]] 40 | ExportScript.Config.Debug = false 41 | ExportScript.Config.SocketDebug = false 42 | ExportScript.Config.FirstNewDataSend = true 43 | ExportScript.Config.FirstNewDataSendCount = 100 -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportScript.lua: -------------------------------------------------------------------------------- 1 | -- Ikarus and D.A.C. Export Script 2 | -- 3 | -- Copyright by Michael aka McMicha 2014 - 2018 4 | -- Contact dcs2arcaze.micha@farbpigmente.org 5 | 6 | 7 | -- Main Table 8 | ExportScript = {} 9 | ExportScript.Version = {} 10 | ExportScript.Version.ExportScript = "1.2.1" 11 | -- Simulation id 12 | ExportScript.SimID = string.format("%08x*",os.time()) 13 | 14 | -- State data for export 15 | ExportScript.PacketSize = 0 16 | ExportScript.SendStrings = {} 17 | ExportScript.LastData = {} 18 | 19 | ExportScript.PacketSizeDAC = {} 20 | ExportScript.SendStringsDAC = {} 21 | ExportScript.LastDataDAC = {} 22 | 23 | ExportScript.lastExportTimeHI = 0 24 | ExportScript.lastExportTimeLI = 0 25 | 26 | ExportScript.NoLuaExportBeforeNextFrame = false 27 | 28 | local PrevExport = {} 29 | PrevExport.LuaExportStart = LuaExportStart 30 | PrevExport.LuaExportStop = LuaExportStop 31 | PrevExport.LuaExportBeforeNextFrame = LuaExportBeforeNextFrame 32 | PrevExport.LuaExportAfterNextFrame = LuaExportAfterNextFrame 33 | 34 | dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]]) 35 | ExportScript.utf8 = dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\utf8.lua]]) 36 | dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]]) 37 | dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\genericRadio.lua]]) 38 | dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Maps.lua]]) 39 | 40 | for i = 1, #ExportScript.Config.DAC, 1 do 41 | ExportScript.PacketSizeDAC[i] = 0 42 | ExportScript.SendStringsDAC[i] = {} 43 | ExportScript.LastDataDAC[i] = {} 44 | end 45 | 46 | -- Found DCS or FC Module 47 | ExportScript.FoundDCSModule = false 48 | ExportScript.FoundFCModule = false 49 | ExportScript.FoundNoModul = true 50 | 51 | --------------------------------------------- 52 | -- DCS Export API Function Implementations -- 53 | --------------------------------------------- 54 | 55 | function LuaExportStart() 56 | -- Works once just before mission start. 57 | -- (and before player selects their aircraft, if there is a choice!) 58 | 59 | -- 2) Setup udp sockets to talk to GlassCockpit 60 | package.path = package.path..";.\\LuaSocket\\?.lua" 61 | package.cpath = package.cpath..";.\\LuaSocket\\?.dll" 62 | 63 | --local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old") 64 | ExportScript.logFile = io.open(ExportScript.Config.LogPath, "wa") -- "W+" 65 | if ExportScript.logFile then 66 | ExportScript.logFile:write('\239\187\191') -- create a UTF-8 BOM 67 | ExportScript.logFile:write("ExportScript Version: "..ExportScript.Version.ExportScript.."\r\n") 68 | end 69 | --if lrenmae1 == nil then 70 | -- ExportScript.Tools.WriteToLog("Rename Error: "..lrename2) 71 | --end 72 | 73 | ExportScript.Tools.createUDPSender() 74 | ExportScript.Tools.createUDPListner() 75 | 76 | ExportScript.AF = {} -- Table for Auxiliary functions 77 | 78 | ExportScript.NoLuaExportBeforeNextFrame = false 79 | ExportScript.Tools.SelectModule() -- point globals to Module functions and data. 80 | 81 | -- Chain previously-included export as necessary 82 | if PrevExport.LuaExportStart then 83 | PrevExport.LuaExportStart() 84 | end 85 | end 86 | 87 | function LuaExportBeforeNextFrame() 88 | --[[ if ExportScript.Config.Debug then 89 | ExportScript.Tools.ProcessInput() 90 | else 91 | ExportScript.coProcessArguments_BeforeNextFrame = coroutine.create(ExportScript.Tools.ProcessInput) 92 | coStatus = coroutine.resume(ExportScript.coProcessArguments_BeforeNextFrame) 93 | end 94 | 95 | if ExportScript.NoLuaExportBeforeNextFrame == false then 96 | ExportScript.Tools.ProcessOutput() 97 | end 98 | ]] 99 | -- Chain previously-included export as necessary 100 | if PrevExport.LuaExportBeforeNextFrame then 101 | PrevExport.LuaExportBeforeNextFrame() 102 | end 103 | end 104 | 105 | function LuaExportAfterNextFrame() 106 | if ExportScript.NoLuaExportBeforeNextFrame then 107 | ExportScript.Tools.ProcessOutput() 108 | end 109 | 110 | -- Chain previously-included export as necessary 111 | if PrevExport.LuaExportAfterNextFrame then 112 | PrevExport.LuaExportAfterNextFrame() 113 | end 114 | end 115 | 116 | function LuaExportActivityNextEvent(t) 117 | local tNext = t 118 | 119 | -- Put your event code here and increase tNext for the next event 120 | -- so this function will be called automatically at your custom 121 | -- model times. 122 | -- If tNext == t then the activity will be terminated. 123 | 124 | if ExportScript.Config.Debug then 125 | ExportScript.Tools.ProcessInput() 126 | else 127 | ExportScript.coProcessArguments_BeforeNextFrame = coroutine.create(ExportScript.Tools.ProcessInput) 128 | coStatus = coroutine.resume(ExportScript.coProcessArguments_BeforeNextFrame) 129 | end 130 | 131 | if ExportScript.NoLuaExportBeforeNextFrame == false then 132 | ExportScript.Tools.ProcessOutput() 133 | end 134 | 135 | tNext = tNext + ExportScript.Config.ExportInterval 136 | 137 | return tNext 138 | end 139 | 140 | function LuaExportStop() 141 | -- Works once just after mission stop. 142 | if ExportScript.Config.DACExport then 143 | ExportScript.Tools.SendDataDAC("DAC", "stop") 144 | for i=1, #ExportScript.Config.DAC, 1 do 145 | ExportScript.Tools.FlushDataDAC(i) 146 | end 147 | end 148 | 149 | if ExportScript.Config.IkarusExport then 150 | ExportScript.Tools.SendData("Ikarus", "stop") 151 | ExportScript.Tools.FlushData() 152 | end 153 | 154 | ExportScript.UDPsender:close() 155 | if ExportScript.Config.Listener then 156 | ExportScript.UDPListener:close() 157 | end 158 | 159 | ExportScript.ModuleName = nil 160 | ExportScript.FoundNoModul = false 161 | 162 | if ExportScript.logFile then 163 | ExportScript.Tools.WriteToLog("====== Logfile close ======") 164 | ExportScript.logFile:flush() 165 | ExportScript.logFile:close() 166 | ExportScript.logFile = nil 167 | end 168 | 169 | -- Chain previously-included export as necessary 170 | if PrevExport.LuaExportStop then 171 | PrevExport.LuaExportStop() 172 | end 173 | end -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/A-10A.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/AJS37.lua: -------------------------------------------------------------------------------- 1 | -- AJS37 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.AJS37 = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- INSTRUMENTS Front panel 19 | -- Left Side 20 | -- Airspeed indicator 21 | [100] = "%.4f", -- IndicatedAirSpeed {0, 0.01, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1} {0, 41.66, 47.78, 55.56, 64.17, 73.61, 83.33, 98.61, 106.9, 122.22, 136.1, 154.16, 194.44, 239, 263.89, 288.89, 319.44, 350, 380.55, 416.66} --m/s 22 | -- Mach-meter 23 | [103] = "%.4f", -- MachMeterDec2 (1.2 _3_) 24 | [102] = "%.4f", -- MachMeterDec1 (1. _2_ 3) 25 | [101] = "%.4f", -- Integer (_1_ .23) 26 | [2007] = "%.f", -- ASI OFF Flag 27 | -- ADI 28 | [105] = "%.4f", -- Pitch {1.0, -1.0} 29 | [106] = "%.4f", -- Heading {1.0, -1.0} 30 | [107] = "%.4f", -- Roll {-1.0, 1.0} 31 | [108] = "%.4f", -- VerticalSpeed {-1.0, 1.0} {-5.0, 5.0} --ms 32 | [107] = "%.4f", -- Rollindex {1.0, -1.0} inverted 33 | [109] = "%.4f", -- VerticalILS {1.0, -1.0} {-1 , 1} --Degrees? 34 | [110] = "%.4f", -- HorizontalILS {1.0, -1.0} {-1 , 1} --Degrees? 35 | [160] = "%.4f", -- ADI OFF Flag 36 | [1810] = "%.4f", -- Slipball {-1.0, 1.0}, not animate 37 | [120] = "%.4f", -- AoA 38 | -- Main altimeter 39 | [114] = "%.4f", -- Altimeter_10000m {0.0, 1.0} {0.0, 10000} 40 | [113] = "%.4f", -- Altimeter_1000m {0.0, 1.0} {0.0, 1000} 41 | [2008] = "%.f", -- Altimeter OFF 42 | -- Altimeter setting 1 hPa 43 | [115] = "%.4f", -- AltimeterSetting_000X 44 | [116] = "%.4f", -- AltimeterSetting_00X0 45 | [117] = "%.4f", -- AltimeterSetting_0X00 46 | [118] = "%.4f", -- AltimeterSetting_X000 47 | -- Frequency 48 | -- FM/AM Radio 49 | [177] = "%.4f", -- MHz_X00 50 | [178] = "%.4f", -- MHz_0X0 51 | [179] = "%.4f", -- MHz_00X 52 | [180] = "%.4f", -- KHz_X00 53 | [181] = "%.4f", -- KHz_0X0 54 | [182] = "%.4f", -- KHz_00X 55 | -- Centre 56 | -- CI Instruments 57 | [128] = "%.4f", -- CIHeading {1.0, -1.0} 58 | [129] = "%.4f", -- CICommandedHeading {1.0, 0.0} 59 | [163] = "%.4f", -- CI OFF Flag 0.0=OFF, 1.0=fade in 60 | [3000] = "%.2f", -- Radar Scan Zone, 0.0=off, >= 0.1=15, >= 0.2=30, >= 0.3=60, >=0.4=120 61 | -- Right Side 62 | -- ENGINE 63 | [139] = "%.4f", -- Engine_RPM_100 {-1.0, 1.0} {0.0, 1.1} 64 | [140] = "%.4f", -- Engine_RPM_10 65 | -- Accelerometer 66 | [136] = "%.4f", -- VerticalAcceleration {-0.3, 1.0} { -2.0, 9.0} 67 | -- Backup instruments 68 | [127] = "%.4f", -- MagneticHeading {1.0, -1.0} 69 | [138] = "%.4f", -- IndicatedAirSpeedBackup {0.0, 0.01, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.0} {0.0, 56.39, 60.56, 65.83, 70.83, 75.83, 81.11, 86.11, 100.0, 113.9, 130.55, 150.0, 170.8, 193.0, 222.22} --m/s 70 | [121] = "%.4f", -- BackupPitch {1.0, -1.0} 71 | [122] = "%.4f", -- BackupRoll {1.0, -1.0} 72 | [125] = "%.4f", -- BackupAltimeter_10000m {0.0, 1.0} {0.0, 10000} 73 | [124] = "%.4f", -- BackupAltimeter_1000m {0.0, 1.0} {0.0, 1000} 74 | -- BackupAltimeter setting 1 hPa 75 | [468] = "%.4f", -- BackupAltimeterSetting_000X 76 | [467] = "%.4f", -- BackupAltimeterSetting_00X0 77 | [466] = "%.4f", -- BackupAltimeterSetting_0X00 78 | [465] = "%.4f", -- BackupAltimeterSetting_X000 79 | -- Distance indicator 80 | [142] = "%.4f", -- Distance {0.0, 0.4} {0.0, 40.0} 81 | [143] = "%.1f", -- km/mil Display 0.0=km >0.8=mil 82 | -- Fuel Gauge 83 | [144] = "%.4f", -- FuelGauge {0.0, 1.0} {0.0, 135.0} 84 | [145] = "%.4f", -- FuelNeeded {0.0, 1.0} {0.0, 135.0} 85 | -- Clock 86 | [130] = "%.4f", -- Hour 87 | [131] = "%.4f", -- Minute 88 | [133] = "%.4f", -- Second (Arrow) 89 | [1333] = "%.4f", -- Second 90 | -- 91 | [141] = "%.4f", -- Engine pressure ratio EPR indicator 92 | -- INSTRUMENTS Right Panel 93 | [147] = "%.4f", -- Engine nozzle indicator 94 | [146] = "%.4f", -- Exhaust Gas Temperature indicator Engine_TEMP {0.0, 1.00} {100, 800} 95 | [148] = "%.4f", -- Oxygen pressure indicator 96 | -- INSTRUMENTS Left Panel 97 | [2005] = "%.4f", -- Cabin pressure indicator 98 | [150] = "%.4f", -- Brake pressure indicator 99 | [151] = "%.4f", -- Pitch trim indicator 100 | -- Lamps/Lights 101 | -- Left Warning Lampen Panel 102 | -- Left Side 103 | [406] = "%.f", -- BRAND 104 | [407] = "%.f", -- BRAND 105 | [408] = "%.f", -- BRÄ UPPF 106 | [409] = "%.f", -- XTANK BRÄ 107 | [410] = "%.f", -- TANK PUMP 108 | [411] = "%.f", -- LANDSTÄLL 109 | [412] = "%.f", -- FÖRV FÖRBJ 110 | [413] = "%.f", -- NOSSTÄLL 111 | [414] = "%.f", -- V-STÄLL 112 | [415] = "%.f", -- H-STÄLL 113 | -- Right Side 114 | [416] = "%.f", -- TIPP VÄXEL 115 | [417] = "%.f", -- ELFEL 116 | [418] = "%.f", -- RESERVEFF 117 | [419] = "%.f", -- HYDR-TR2 118 | [420] = "%.f", -- HYDR-TR1 119 | [421] = "%.f", -- AFK FEL 120 | [422] = "%.f", -- EJ REV 121 | [423] = "%.f", -- OLJETRYCK 122 | -- Right Warning Lampen Panel 123 | -- Left Side 124 | [424] = "%.f", -- SPAK 125 | [425] = "%.f", -- HALL FUNK 126 | [426] = "%.f", -- RHM FEL 127 | [427] = "%.f", -- ROLLVÄXEL 128 | [428] = "%.f", -- CK 129 | [429] = "%.f", -- KABINHÖJD 130 | [430] = "%.f", -- HUV o STOLL 131 | [431] = "%.f", -- TÄNDSYST 132 | [432] = "%.f", -- STARTSYST 133 | [433] = "%.f", -- MAN BR REG 134 | -- Right Side 135 | [434] = "%.f", -- SYRGAS 136 | [435] = "%.f", -- BRÄ < 24 137 | [436] = "%.f", -- BRAND GTS 138 | [437] = "%.f", -- TILS 139 | [438] = "%.f", -- NAV-SYST 140 | [439] = "%.f", -- KB-V SLUT 141 | [440] = "%.f", -- KB-H/KA SL 142 | [441] = "%.f", -- FACKL SL 143 | [442] = "%.f", -- MOTVERK 144 | [443] = "%.f", -- LUFTBROMS 145 | -- Masterwarning lamp HUVUDVARNING 146 | [444] = "%.f", -- HUVUDVARNING - left lamp 147 | [445] = "%.f", -- HUVUDVARNING - right lamp 148 | -- Central Indicator 149 | [450] = "%.f", -- Altitude warning light 150 | -- RWR lights 151 | [451] = "%.f", -- 1 o'clock light 152 | [452] = "%.f", -- 3 o'clock light 153 | [453] = "%.f", -- 5 o'clock light 154 | [454] = "%.f", -- 7 o'clock light 155 | [455] = "%.f", -- 9 o'clock light 156 | [456] = "%.f", -- 11 o'clock light 157 | -- right main panel 158 | [461] = "%.f", -- Stores released indicator light (FÄLLD LAST) 159 | [462] = "%.f", -- Reserve and transonic indicator (REVAVDR TRANSONIC) red "REV" light 160 | -- 1,2,3 Lamps 161 | [405] = "%.1f", -- Afterburner zone indicator 0.0=off, >= 0.3=1, >= 0.6=2, >= 0.9=3 162 | -- left main panel 163 | [463] = "%.f", -- Auto throttle mode indicator light 164 | [464] = "%.f", -- Alpha 15.5° button (for AFK) 165 | [460] = "%.f", -- Reserve and transonic indicator (REVAVDR TRANSONIC) green "REV" light 166 | -- SA06 functionality lamps (Autopilot) 167 | [401] = "%.f", -- SPAK Lamp 168 | [402] = "%.f", -- ATT Lamp 169 | [403] = "%.f" -- HOJD Lamp 170 | } 171 | ExportScript.ConfigArguments = 172 | { 173 | --[[ 174 | arguments for export in low tick interval 175 | based on "clickabledata.lua" 176 | ]] 177 | -- Stick 178 | --[8] = "%1d", -- Mastersafe 179 | --[3] = "%.4f" -- Stick horizontal 180 | --[2] = "%.4f" -- Stick vertical 181 | -- 182 | [12] = "%1d", -- Gear Handle 183 | [20] = "%1d", -- Reverser Handle 184 | [401] = "%1d", -- SPAK 185 | [402] = "%1d", -- Attitude Hold ATT 186 | [403] = "%1d", -- Altitude Hold HOJD 187 | [464] = "%1d", -- AFK 15 Deg Mode 188 | [213] = "%1d", -- Doppler Land/Sea Mode 189 | --[0] = "%.3f", -- Altimeter Setting (Axis) {0.0,1.0} in 0.001 steps 190 | -- Datapanel 191 | [200] = "%1d", -- Datapanel Selector 192 | [201] = "%1d", -- Datapanel IN/OUT Switch 193 | [290] = "%1d", -- Datapanel Key 0 194 | [291] = "%1d", -- Datapanel Key 1 195 | [292] = "%1d", -- Datapanel Key 2 196 | [293] = "%1d", -- Datapanel Key 3 197 | [294] = "%1d", -- Datapanel Key 4 198 | [295] = "%1d", -- Datapanel Key 5 199 | [296] = "%1d", -- Datapanel Key 6 200 | [297] = "%1d", -- Datapanel Key 7 201 | [298] = "%1d", -- Datapanel Key 8 202 | [299] = "%1d", -- Datapanel Key 9 203 | -- NAvigations Panel 204 | [271] = "%1d", -- Navigation Selector Button B1 205 | [272] = "%1d", -- Navigation Selector Button B2 206 | [273] = "%1d", -- Navigation Selector Button B3 207 | [274] = "%1d", -- Navigation Selector Button B4 208 | [275] = "%1d", -- Navigation Selector Button B5 209 | [276] = "%1d", -- Navigation Selector Button B6 210 | [277] = "%1d", -- Navigation Selector Button B7 211 | [278] = "%1d", -- Navigation Selector Button B8 212 | [279] = "%1d", -- Navigation Selector Button B9 213 | [280] = "%1d", -- Navigation Selector Button BX 214 | [270] = "%1d", -- Navigation Selector Button LS 215 | [281] = "%1d", -- Navigation Selector Button L MÅL 216 | [282] = "%.1f", -- TILS Channel Selection {0.0,0.1,0.2,...,0.9,1.0} 217 | [283] = "%1d", -- RHM switch, Radar Altimeter Power 218 | [285] = "%1d", -- TILS Channel Layer Selection 11-20/1-10 219 | --- 220 | [344] = "%1d", -- Warning Panel Light Test 221 | [315] = "%1d", -- Indicator System Test 222 | [175] = "%1d", -- Max G Reset 223 | --- 224 | [250] = "%1d", -- Anti Collision Lights 225 | [251] = "%1d", -- Navigation Lights {-1.0,0.0,1.0} 226 | [252] = "%1d", -- Formation Lights 227 | [253] = "%1d", -- Position Lights 228 | [254] = "%.1f", -- Position Lights Brightness {0.0,0.1,0.2} 229 | --- 230 | [392] = "%.2f", -- Panel Lights (Axis) {0.0,1.0} in 0.05 steps 231 | [393] = "%.2f", -- Flood Lights (Axis) {0.0,1.0} in 0.05 steps 232 | [394] = "%.2f", -- Instrument Lights (Axis) {0.0,1.0} in 0.05 steps 233 | -- Engine panel 234 | [206] = "%1d", -- Start System 235 | [204] = "%1d", -- Low-pressure Fuel Valve 236 | [202] = "%1d", -- High-pressure Fuel Valve 237 | [205] = "%1d", -- Ignition System 238 | [310] = "%1d", -- Engine De-Ice 239 | [312] = "%1d", -- Backup Generator 240 | [21] = "%1d", -- Ejection Seat Arm 241 | [208] = "%1d", -- Restart 242 | [203] = "%1d", -- Main Electric Power 243 | [207] = "%1d", -- Generator 244 | [209] = "%1d", -- Master Mode Selector 245 | [446] = "%1d", -- Master Caution Reset 246 | [323] = "%1d", -- Slav SI 247 | [324] = "%1d", -- HÖJD CISI 248 | --[0] = "%1d", -- Snabbresning 249 | --[123] = "%1d", -- Backup ADI Cage 250 | --[126] = "%.3f", -- Backup Altimeter Setting (Axis) {0.0,1.0} in 0.001 steps 251 | [311] = "%1d", -- Pitch Gear Automatic/Landing 252 | -- Countermeasure panel 253 | [317] = "%.1f", -- Jammer Operation Mode Selector {0.0,0.1,0.2,0.3,0.4} 254 | [318] = "%.1f", -- Jammer Band Selector {0.0,0.1,0.2,0.3,0.4} 255 | [319] = "%.1f", -- Countermeasure Operation Mode Selector {0.0,0.1,0.2,0.3,0.4} 256 | [320] = "%.1f", -- Countermeasure Streak Mode Selector {0.0,0.1} 257 | [321] = "%.1f", -- Radarwarning Indication Selector {0.0,0.1,0.2} 258 | [322] = "%.1f", -- Countermeasure Chaff/Flares Selector {0.0,0.1,0.2} 259 | -- Oxygen 260 | [176] = "%1d", -- Oxygen Lever 261 | -- Canopy 262 | [9] = "%1d", -- Canopy Open/Close {-1.0,0.0,1.0} 263 | [210] = "%1d", -- Canopy Jettison 264 | --- 265 | [184] = "%1d", -- Countermeasure Release {-1.0,0.0,1.0} 266 | [316] = "%1d", -- Manual Fuel Regulator 267 | [212] = "%1d", -- Roll Centering 268 | [390] = "%1d", -- Emergency Roll Trim {-1.0,0.0,1.0} 269 | [389] = "%1d", -- Emergency Pitch Trim {-1.0,0.0,1.0} 270 | [388] = "%1d", -- Emergency Yaw Trim {-1.0,0.0,1.0} 271 | [313] = "%1d", -- Manual Afterburner Fuel Regulator 272 | [11] = "%1d", -- HUD Reflector Glass Position 273 | [180] = "%.2f", -- HUD Brightness Knob (Axis) {0.0,1.0} in 0.02 steps 274 | [13] = "%1d", -- AFK Lever 275 | [464] = "%1d", -- AFK Mode 3 276 | [22] = "%1d", -- Parking Brake 277 | -- Radio 278 | [171] = "%.1f", -- Radio Manual Frequency Setting Knob Inner Left (Axis) {0.0,1.0} in 0.1 steps 279 | [172] = "%.1f", -- Radio Manual Frequency Setting Knob Outer Left (Axis) {0.0,1.0} in 0.1 steps 280 | [173] = "%.1f", -- Radio Manual Frequency Setting Knob Inner Right (Axis) {0.0,1.0} in 0.1 steps 281 | [174] = "%.1f", -- Radio Manual Frequency Setting Knob Outer Right (Axis) {0.0,1.0} in 0.1 steps 282 | [170] = "%1d", -- Radio Manual Frequency Setting Modulation 283 | --- 284 | [372] = "%1d", -- Flight 0 285 | [373] = "%1d", -- Flight 1 286 | [374] = "%1d", -- Flight 2 287 | [375] = "%1d", -- Flight 3 288 | [376] = "%1d", -- Flight 4 289 | [377] = "%1d", -- Flight 5 290 | [378] = "%1d", -- Flight 6 291 | [379] = "%1d", -- Flight 7 292 | [380] = "%1d", -- Flight 8 293 | [381] = "%1d", -- Flight 9 294 | [362] = "%1d", -- Channel H 295 | [363] = "%1d", -- Special 1 296 | [364] = "%1d", -- Special 2 297 | [365] = "%1d", -- Special 3 298 | [366] = "%1d", -- Minus 299 | [367] = "%1d", -- Channel A/G 300 | [368] = "%1d", -- Channel B 301 | [369] = "%1d", -- Channel C/F 302 | [370] = "%1d", -- Channel C2 303 | [371] = "%1d", -- Channel D/E 304 | --- 305 | [386] = "%1d", -- FR22 Mode Selector {-1.0,0.0,1.0} 306 | [361] = "%1d", -- Base Selector {-1.0,0.0,1.0} 307 | [360] = "%1d", -- Group Selector {-1.0,0.0,1.0} 308 | --- 309 | [382] = "%1d", -- Ground Intercom 310 | -- Weapons system 311 | -- trigger safety bracket 312 | [8] = "%1d", -- Trigger Safety Bracket 313 | [260] = "%1d", -- Weapon Emergency Release Cover 314 | [261] = "%1d", -- Weapon Emergency Release Button 315 | [262] = "%1d", -- External Tank Release Cover 316 | [263] = "%1d", -- External Tank Release Button 317 | [264] = "%.1f", -- Weapon Selector Knob - J/A Valjare {0.0,0.1,0.2,0.3,0.4,0.5} 318 | [265] = "%.1f", -- Weapon Interval Selector Mode Knob - Siktningvaljare {0.0,0.1,0.2,...,0.9,1.0} 319 | [266] = "%1d", -- Weapon Release Mode Switch - Fallsattomkopplare 320 | [267] = "%1d", -- RB-04/RB-15/BK Release Mode Switch - MALVAL/PREP 321 | -- IFF panel 322 | [308] = "%1d", -- IFF Power 323 | [309] = "%.1f", -- IFF Code {0.0,0.1,0.2,...,0.9,1.0} 324 | -- CB Circuit breakers 325 | [302] = "%1d", -- CB Autopilot SA 326 | [303] = "%1d", -- CB High Alpha Warning 327 | [304] = "%1d", -- CB Trim System 328 | [305] = "%1d", -- CB CI/SI 329 | [306] = "%1d", -- CB Ejection System 330 | [307] = "%1d", -- CB CB Engine 331 | -- Radar 332 | [217] = "%.1f", -- Anti Jamming Mode (AS) Selector {0.0,0.1,0.2,...,0.6,0.7} 333 | [214] = "%1d", -- Lin/Log Radar Gain Switch 334 | [218] = "%1d", -- Pulse Normal/Short Switch 335 | [216] = "%1d", -- Passive Recce On/Off Switch 336 | [391] = "%.3f", -- Radar Brightness (Axis) {0.0,1.0} in 0.001 steps 337 | -- Cabin air 338 | -- Var 339 | [286] = "%.3f", -- Windscreen De-Ice (Axis) {0.0,1.0} in 0.001 steps 340 | [675] = "%.3f", -- Maintenance Testing Mode (Axis) {0.0,1.0} in 0.001 steps 341 | [1006] = "%1d", -- Radar/EL Maintenance Test 342 | [1200] = "%1d", -- Magnetic Declination Cover 343 | [396] = "%.3f", -- Drysuit Ventilation Adjustment (Axis) {0.0,1.0} in 0.001 steps 344 | [395] = "%1d", -- Ignition Coils 345 | [1206] = "%1d", -- DME Selector 346 | [1203] = "%1d", -- IFF/Transponder Power 347 | [1204] = "%1d", -- IFF Channel Selector 348 | [1205] = "%1d", -- IFF Identification 349 | [384] = "%1d", -- Flight Recorder {-1.0,0.0,1.0} 350 | [385] = "%.5f", -- Radio Volume (Axis) {0.0,1.0} in 0.00001 steps 351 | --??[4200] = "%1d", -- Insert/Remove Data Cartridge 352 | [300] = "%1d", -- Rensa Button Cover 353 | [301] = "%1d", -- CK37 Rensa (Clear) 354 | -- 355 | [398] = "%1d", -- Cabin Air Valve 356 | [493] = "%1d", -- Autopilot Yaw Trim Cover 357 | [211] = "%.2f", -- Autopilot yaw correction RENFLYGN (Axis) {0.0,1.0} in 0.01 steps 358 | [400] = "%1d", -- Missile Select Button 359 | [399] = "%.3f", -- Master Volume / Sidewinder Tone (Axis) {0.0,1.0} in 0.001 steps 360 | [1201] = "%.1f", -- Magnetic Declination Correction (Axis) {0.0,1.0} in 0.1 steps 361 | -- Clock 362 | [135] = "%.3f", -- Clock Setting 363 | } 364 | 365 | ----------------------------- 366 | -- HIGH IMPORTANCE EXPORTS -- 367 | -- done every export event -- 368 | ----------------------------- 369 | 370 | -- Pointed to by ProcessIkarusDCSHighImportance 371 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 372 | --[[ 373 | every frame export to Ikarus 374 | Example from A-10C 375 | Get Radio Frequencies 376 | get data from device 377 | local lUHFRadio = GetDevice(54) 378 | ExportScript.Tools.SendData("ExportID", "Format") 379 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 380 | 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)) 381 | ]] 382 | end 383 | 384 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 385 | --[[ 386 | every frame export to DAC 387 | Example from A-10C 388 | Get Radio Frequencies 389 | get data from device 390 | local UHF_RADIO = GetDevice(54) 391 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 392 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 393 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 394 | 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)) 395 | ]] 396 | end 397 | 398 | ----------------------------------------------------- 399 | -- LOW IMPORTANCE EXPORTS -- 400 | -- done every gExportLowTickInterval export events -- 401 | ----------------------------------------------------- 402 | 403 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 404 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 405 | --[[ 406 | export in low tick interval to Ikarus 407 | Example from A-10C 408 | Get Radio Frequencies 409 | get data from device 410 | local lUHFRadio = GetDevice(54) 411 | ExportScript.Tools.SendData("ExportID", "Format") 412 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 413 | 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)) 414 | ]] 415 | 416 | local lFR22Radio = GetDevice(31) 417 | --ExportScript.Tools.SendData(2500, string.format("%7.3f", lFR22Radio:get_frequency()/1000000)) -- full frequency 418 | ExportScript.Tools.SendData(2500, ExportScript.Tools.RoundFreqeuncy(lFR22Radio:get_frequency()/1000000)) -- full frequency 419 | local lMHz = string.format("%0.0f", lFR22Radio:get_frequency()/1000000) 420 | local lKHz = string.sub(string.format("%0.3f", string.format("%.3f", lFR22Radio:get_frequency()/1000000) - lMHz), 3) 421 | ExportScript.Tools.SendData(2501, lMHz) -- slice frequency MHz 422 | ExportScript.Tools.SendData(2502, lKHz) -- slice frequency KHz 423 | 424 | -- 1,2,3 Lamps 425 | --[405] = "%.1f", -- Afterburner zone indicator 0.0=off, >= 0.3=1, >= 0.6=2, >= 0.9=3 426 | local lAfterburnerZoneIndicator = mainPanelDevice:get_argument_value(405) 427 | 428 | if lAfterburnerZoneIndicator >= 0.9 then 429 | ExportScript.Tools.SendData(2510, 1) -- Afterburner 1 430 | ExportScript.Tools.SendData(2511, 1) -- Afterburner 2 431 | ExportScript.Tools.SendData(2512, 1) -- Afterburner 3 432 | elseif lAfterburnerZoneIndicator >= 0.6 then 433 | ExportScript.Tools.SendData(2510, 1) 434 | ExportScript.Tools.SendData(2511, 2) 435 | ExportScript.Tools.SendData(2512, 0) 436 | elseif lAfterburnerZoneIndicator >= 0.3 then 437 | ExportScript.Tools.SendData(2510, 1) 438 | ExportScript.Tools.SendData(2511, 0) 439 | ExportScript.Tools.SendData(2512, 0) 440 | else 441 | ExportScript.Tools.SendData(2510, 0) 442 | ExportScript.Tools.SendData(2511, 0) 443 | ExportScript.Tools.SendData(2512, 0) 444 | end 445 | 446 | -- Cockpit Light 447 | ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {392, 393, 394}) 448 | -- Panel Lights, Flood Lights, Instrument Lights 449 | end 450 | 451 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 452 | --[[ 453 | export in low tick interval to DAC 454 | Example from A-10C 455 | Get Radio Frequencies 456 | get data from device 457 | local UHF_RADIO = GetDevice(54) 458 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 459 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 460 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 461 | 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)) 462 | ]] 463 | 464 | local lFR22Radio = GetDevice(31) 465 | --ExportScript.Tools.SendData(2500, string.format("%7.3f", lFR22Radio:get_frequency()/1000000)) -- full frequency 466 | ExportScript.Tools.SendData(2500, ExportScript.Tools.RoundFreqeuncy(lFR22Radio:get_frequency()/1000000)) -- full frequency 467 | local lMHz = string.format("%0.0f", lFR22Radio:get_frequency()/1000000) 468 | local lKHz = string.sub(string.format("%0.3f", string.format("%.3f", lFR22Radio:get_frequency()/1000000) - lMHz), 3) 469 | ExportScript.Tools.SendData(2501, lMHz) -- slice frequency MHz 470 | ExportScript.Tools.SendData(2502, lKHz) -- slice frequency KHz 471 | 472 | -- 1,2,3 Lamps 473 | --[405] = "%.1f", -- Afterburner zone indicator 0.0=off, >= 0.3=1, >= 0.6=2, >= 0.9=3 474 | local lAfterburnerZoneIndicator = mainPanelDevice:get_argument_value(405) 475 | 476 | if lAfterburnerZoneIndicator >= 0.9 then 477 | ExportScript.Tools.SendDataDAC(2510, 1) -- Afterburner 1 478 | ExportScript.Tools.SendDataDAC(2511, 1) -- Afterburner 2 479 | ExportScript.Tools.SendDataDAC(2512, 1) -- Afterburner 3 480 | elseif lAfterburnerZoneIndicator >= 0.6 then 481 | ExportScript.Tools.SendDataDAC(2510, 1) 482 | ExportScript.Tools.SendDataDAC(2511, 2) 483 | ExportScript.Tools.SendDataDAC(2512, 0) 484 | elseif lAfterburnerZoneIndicator >= 0.3 then 485 | ExportScript.Tools.SendDataDAC(2510, 1) 486 | ExportScript.Tools.SendDataDAC(2511, 0) 487 | ExportScript.Tools.SendDataDAC(2512, 0) 488 | else 489 | ExportScript.Tools.SendDataDAC(2510, 0) 490 | ExportScript.Tools.SendDataDAC(2511, 0) 491 | ExportScript.Tools.SendDataDAC(2512, 0) 492 | end 493 | 494 | --===================================================================================== 495 | --[[ 496 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 497 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 498 | 499 | -- list_indication get tehe value of cockpit displays 500 | local ltmp1 = 0 501 | for ltmp2 = 0, 20, 1 do 502 | ltmp1 = list_indication(ltmp2) 503 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 504 | end 505 | ]] 506 | --[[ 507 | -- getmetatable get function name from devices 508 | local ltmp1 = 0 509 | for ltmp2 = 1, 70, 1 do 510 | ltmp1 = GetDevice(ltmp2) 511 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 512 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 513 | end 514 | ]] 515 | end 516 | 517 | ----------------------------- 518 | -- Custom functions -- 519 | ----------------------------- -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua: -------------------------------------------------------------------------------- 1 | -- Module Name Export 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version. = "1.2.X" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | } 19 | ExportScript.ConfigArguments = 20 | { 21 | --[[ 22 | arguments for export in low tick interval 23 | based on "clickabledata.lua" 24 | ]] 25 | } 26 | 27 | ----------------------------- 28 | -- HIGH IMPORTANCE EXPORTS -- 29 | -- done every export event -- 30 | ----------------------------- 31 | 32 | -- Pointed to by ProcessIkarusDCSHighImportance 33 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 34 | --[[ 35 | every frame export to Ikarus 36 | Example from A-10C 37 | Get Radio Frequencies 38 | get data from device 39 | local lUHFRadio = GetDevice(54) 40 | ExportScript.Tools.SendData("ExportID", "Format") 41 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 42 | 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)) 43 | ]] 44 | end 45 | 46 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 47 | --[[ 48 | every frame export to DAC 49 | Example from A-10C 50 | Get Radio Frequencies 51 | get data from device 52 | local UHF_RADIO = GetDevice(54) 53 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 54 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 55 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 56 | 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)) 57 | ]] 58 | end 59 | 60 | ----------------------------------------------------- 61 | -- LOW IMPORTANCE EXPORTS -- 62 | -- done every gExportLowTickInterval export events -- 63 | ----------------------------------------------------- 64 | 65 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 66 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 67 | --[[ 68 | export in low tick interval to Ikarus 69 | Example from A-10C 70 | Get Radio Frequencies 71 | get data from device 72 | local lUHFRadio = GetDevice(54) 73 | ExportScript.Tools.SendData("ExportID", "Format") 74 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 75 | 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)) 76 | ]] 77 | end 78 | 79 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 80 | --[[ 81 | export in low tick interval to DAC 82 | Example from A-10C 83 | Get Radio Frequencies 84 | get data from device 85 | local UHF_RADIO = GetDevice(54) 86 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 87 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 88 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 89 | 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)) 90 | ]] 91 | 92 | --===================================================================================== 93 | --[[ 94 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 95 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 96 | 97 | -- list_indication get tehe value of cockpit displays 98 | local ltmp1 = 0 99 | for ltmp2 = 0, 20, 1 do 100 | ltmp1 = list_indication(ltmp2) 101 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 102 | end 103 | ]] 104 | --[[ 105 | -- getmetatable get function name from devices 106 | local ltmp1 = 0 107 | for ltmp2 = 1, 70, 1 do 108 | ltmp1 = GetDevice(ltmp2) 109 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 110 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 111 | end 112 | ]] 113 | end 114 | 115 | ----------------------------- 116 | -- Custom functions -- 117 | ----------------------------- -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/F-15C.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/F-15C.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua: -------------------------------------------------------------------------------- 1 | -- F-86 Export 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.F86 = "1.2.1" 5 | --ExportScript.NoLuaExportBeforeNextFrame = true 6 | 7 | ExportScript.ConfigEveryFrameArguments = 8 | { 9 | --[[ 10 | every frames arguments 11 | based of "mainpanel_init.lua" 12 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 13 | [DeviceID] = "Format" 14 | [4] = "%.4f", <- floating-point number with 4 digits after point 15 | [19] = "%0.1f", <- floating-point number with 1 digit after point 16 | [129] = "%1d", <- decimal number 17 | [5] = "%.f", <- floating point number rounded to a decimal number 18 | ]] 19 | -- Mechanic clock 20 | [19] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0} = {0.0, 1.0} 21 | [18] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} = {0.0, 1.0} 22 | --[37] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0} = {0.0, 1.0} 23 | --[56] = "%.4f", -- CLOCK_flight_time_meter_status {0.0, 0.2} = {0.0, 1.0} 24 | --[52] = "%.4f", -- CLOCK_flight_hours {0.0, 12.0} = {0.0, 1.0} 25 | --[53] = "%.4f", -- CLOCK_flight_minutes {0.0, 60.0} = {0.0, 1.0} 26 | [37] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0, 60.0} = {0.0, 1.0} 27 | [1006] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0, 60.0} = {0.0, 1.0} 28 | -- flight gauge 29 | -- Airspeeed 30 | [178] = "%.4f", -- Airspeeed {0.0, 25.7, 180.06, 334.4} = {0.0, 0.019, 0.494, 0.965} 31 | [709] = "%.4f", -- AirspeeedDrum {0.0, 51.4444444} = {0.0, 1.0} 32 | [8] = "%.4f", -- AirspeeedM1 {0.0, 25.7, 51.444, 308.67, 334.4} = {0.0, 0.02, 0.1, 0.6, 0.697} 33 | -- Altimeter 34 | [707] = "%.4f", -- Altimeter10000 {0 ,30480} = {0 ,1} 35 | [523] = "%.4f", -- Altimeter1000 {0 ,3048} = {0 ,1} 36 | [524] = "%.4f", -- Altimeter100 {0 ,304.8} = {0 ,1} 37 | [700] = "%.4f", -- AltimeterHG {0 , 91.44} = {0 ,1} 38 | -- Variometer 39 | [24] = "%.4f", -- Variometer {-30.48, -10.16, -5.08, 0.0, 5.08, 10.16, 30.48} = {-1.0, -0.5, -0.29, 0.0, 0.29, 0.5, 1.0} 40 | -- MachNumber 41 | [179] = "%.4f", -- MachNumber {0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5} = {0.0515, 0.0855, 0.122, 0.161, 0.203, 0.248, 0.295, 0.342, 0.3915, 0.441, 0.493, 0.597, 0.699, 0.796, 0.883, 0.965} 42 | -- TurnIndicator 43 | [25] = "%.4f", -- TurnIndicator {-1.0, 1.0} 44 | -- SlipIndicator 45 | [31] = "%.4f", -- SlipIndicator {-1.0, 1.0} 46 | -- Accelerometer 47 | [6] = "%.4f", -- Accelerometer {-5.0, 0.0, 10.0} {0.0, 0.334, 1.0} 48 | [1003] = "%.4f", -- AccelerometerMin {-5.0, 0.0, 10.0} {0.0, 0.334, 1.0} 49 | [1002] = "%.4f", -- AccelerometerMax {-5.0, 0.0, 10.0} {0.0, 0.334, 1.0} 50 | -- GyroCompass 51 | [711] = "%.4f", -- GyroCompassNeedle {1.0, 0.0} 52 | [712] = "%.4f", -- GyroCompassScale {0.0, 1.0} 53 | -- AttitudeIndicator 54 | [713] = "%.4f", -- AttitudeIndicatorOffFlag {0.0, 1.0} = {1.0, 0.0} 55 | [605] = "%.4f", -- AttitudeIndicatorPitch {-0.27, 0.27} 56 | [606] = "%.4f", -- AttitudeIndicatorBank {1.0, -1.0} 57 | [81] = "%.4f", -- AttitudeIndicatorPitchSphere {-1.0, 1.0} 58 | [1005] = "%.4f", -- AttitudeIndicatorBankNeedle {1.0, -1.0} 59 | -- engine gauges 60 | -- Tachometer 61 | [16] = "%.4f", -- Tachometer {0.0, 0.5, 0.504, 1.1} = {0.012, 0.482, 0.5, 1.0} 62 | -- ExhaustTemperature 63 | [12] = "%.4f", -- ExhaustTemperature {0.0, 1000.0} = {0.0, 1.0} 64 | -- OilPressure 65 | [112] = "%.4f", -- OilPressure {0.0, 100.0} = {0.023, 1.0} 66 | -- FuelFlow 67 | [531] = "%.4f", -- FuelFlow {0.0, 1.2599} = {0.0, 1.0} 68 | -- electric system 69 | [601] = "%.4f", -- VoltageDC {0.0, 30.0} = {0.0, 0.3} 70 | [602] = "%.4f", -- Loadmeter {0.0, 400.0} = {0.0, 1.0} 71 | -- hydraulic system 72 | [109] = "%.4f", -- HydPress {0.0, 1.0} = {0.0, 1.0} 73 | -- fuel system 74 | [22] = "%.4f", -- FuelQuantity {-500.0, 0.0, 45.36, 226.8, 453.6, 907.2, 1360.8, 1451.5} = {-1.0, 0.0, 0.012, 0.141, 0.31, 0.625, 0.938, 1.0} 75 | -- oxygen system 76 | [353] = "%.4f", -- OxygenPressure {0.0, 500.0} = {0, 1} 77 | [705] = "%.1f", -- OxygenFlowBlinker {0.0, 1.0} 78 | -- air system 79 | [114] = "%.4f", -- CockpitAltimeter {0.0, 15240.0} = {0.0, 1.0} 80 | -- radio compass 81 | [804] = "%.4f", -- ARN6_Band {0.0, 3.0} = {0.0, 1.0} 82 | [800] = "%.4f", -- ARN6_TuningMeter {0.0, 1.0} 83 | [801] = "%.4f", -- ARN6_Tuning {0.0, 0.2} = {0.0, 1.0} 84 | [600] = "%.4f", -- ARN6_Bearing {0.0, 1.0} 85 | [814] = "%.4f", -- ARN6_Scale {1.0, 0.0} 86 | [830] = "%.4f", -- ARN6_FreqScale {0.0, 1.0} 87 | [219] = "%.4f", -- ARN6_ScaleLight {0.0, 1.0} 88 | -- light system 89 | [182] = "%.f", -- IlluminationLights {0.0, 1.0} 90 | [825] = "%.f", -- StandByCompassLight {0.0, 1.0} 91 | [180] = "%.f", -- PrimaryInstLights {0.0, 1.0} 92 | [185] = "%.f", -- AuxiliaryInstrumentLights {0.0, 1.0} 93 | [222] = "%.4f", -- LandingGearUnsafe {0.0, 1.0} 94 | -- 95 | [603] = "%.4f", -- LABS_roll_needle {-1.0, 1.0} 96 | [604] = "%.4f", -- LABS_pitch_needle {-1.0, 1.0} 97 | -- 98 | [818] = "%.4f", -- EmergencyJettisonHandlePos {0.0, 1.0} 99 | [221] = "%.4f", -- EmergencyJettisonHandleRot {0.0, 1.0} 100 | -- LAMPS 101 | -- electric system 102 | [617] = "%.f", -- lamp_ELEC_GenOff {-1.0, 1.0} 103 | [610] = "%.f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0} 104 | [611] = "%.f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0} 105 | [612] = "%.f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0} 106 | -- hydraulic system 107 | [614] = "%.f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0} 108 | [39] = "%.f", -- lamp_HYDRO_LeftGear {-1.0, 1.0} 109 | [41] = "%.f", -- lamp_HYDRO_RightGear {-1.0, 1.0} 110 | [40] = "%.f", -- lamp_HYDRO_NoseGear {-1.0, 1.0} 111 | -- fuel system 112 | [625] = "%.f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0} 113 | -- fire detection system 114 | [615] = "%.f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0} 115 | [616] = "%.f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0} 116 | -- control system 117 | [613] = "%.f", -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0} 118 | -- air system 119 | [614] = "%.f" -- lamp_WindshieldAntiIceOverheatWarning {-1.0, 1.0} 120 | } 121 | 122 | ExportScript.ConfigArguments = 123 | { 124 | --[[ 125 | arguments for export in low tick interval 126 | based on "clickabledata.lua" 127 | ]] 128 | -- cockpit mechanics 129 | [718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 0.0, 1.0} 130 | [818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0} 131 | [817] = "%.1f", -- Canopy Alternate Emergency Jettison Handle, IN/OUT {0.0, 1.0} 132 | [816] = "%.1f", -- Canopy Declutch Handle, IN/OUT {0.0, 1.0} 133 | -- electric 134 | [653] = "%1d", -- Battery-Starter Switch, BATTERY/OFF/STARTER {-1, 1} 135 | [643] = "%.1f", -- Instrument Power Switch, ALTERNATE/NORMAL {-1.0, 1.0} 136 | [664] = "%.1f", -- Stop-Starter Button (Push to de-energize starter in case of malfunction) {0.0, 1.0} 137 | [652] = "%1d", -- Engine Master Switch, ON/OFF {1} 138 | [670] = "%.1f", -- Generator Switch, ON/OFF/RESET {1} 139 | [687] = "%1d", -- Generator Warning Light (Push To Test) {1} 140 | [680] = "%1d", -- Main Instrument (Three-phase) Inverter Failure Warning Light (Push to test) {1} 141 | [681] = "%1d", -- Both Instrument (Main and alternate three-phase) Inverter Failure Warning Light (Push to test) {1} 142 | [682] = "%1d", -- Main Radar (Single-phase) Inverter Failure Warning Light (Push to test) {1} 143 | -- Circuit Breaker (left panel) 144 | [760] = "%1d", -- Bomb Rocket Tank Salvo {0, 1} 145 | [761] = "%1d", -- Bomb Sel. {0, 1} 146 | [762] = "%1d", -- Gyr'Syn Compass {0, 1} 147 | [763] = "%1d", -- 3f Inverter {0, 1} 148 | [764] = "%1d", -- Turn Bank Ind. {0, 1} 149 | [765] = "%1d", -- Rudder Trim & Take-Off Ind. {0, 1} 150 | [766] = "%1d", -- Alt Ail. Trim {0, 1} 151 | [767] = "%1d", -- Ail & Horiz. Trim & Alt Horiz. Trim {0, 1} 152 | [768] = "%1d", -- LDG Light Control {0, 1} 153 | [769] = "%1d", -- LDG Lights {0, 1} 154 | [770] = "%1d", -- Fire Warn. {0, 1} 155 | [771] = "%1d", -- Bus Tie-In Control {0, 1} 156 | [772] = "%1d", -- Speed Brake {0, 1} 157 | [773] = "%1d", -- Free Air & Oil Temp & Air Sel. {0, 1} 158 | [774] = "%1d", -- LDG Gear Warn. {0, 1} 159 | [775] = "%1d", -- LDG Gear Control {0, 1} 160 | [776] = "%1d", -- LDG Gear Pos Ind. {0, 1} 161 | [777] = "%1d", -- Fuel Booster AFT {0, 1} 162 | [778] = "%1d", -- Alt Emerg. Hyd. Cont. & Hyd. Press Ind. {0, 1} 163 | [779] = "%1d", -- Sight Power {0, 1} 164 | [780] = "%1d", -- Sight Heater {0, 1} 165 | [781] = "%1d", -- Sight A.C. Power Unit {0, 1} 166 | [782] = "%1d", -- AN/ARN-6 Radio Compass {0, 1} 167 | -- Circuit Breaker (right panel) 168 | [783] = "%1d", -- Eng. Master Fuel Shut-Off {0, 1} 169 | [784] = "%1d", -- Eng. Ign. {0, 1} 170 | [785] = "%1d", -- Fuel Level {0, 1} 171 | [786] = "%1d", -- Inv Gen. Failure Overvolt LTS Test {0, 1} 172 | [787] = "%1d", -- Light Post IndCode {0, 1} 173 | [788] = "%1d", -- Console & Ped LTS {0, 1} 174 | [789] = "%1d", -- Fuel Boost FWD {0, 1} 175 | [790] = "%1d", -- Wing Flap LH. {0, 1} 176 | [791] = "%1d", -- Wing Flap RH. {0, 1} 177 | [792] = "%1d", -- Light Fluor {0, 1} 178 | [793] = "%1d", -- Sight Control {0, 1} 179 | [794] = "%1d", -- AN/APC 3 Radio {0, 1} 180 | [795] = "%1d", -- AN/APX-6 Radio IFF {0, 1} 181 | -- Hydraulic Interface 182 | [599] = "%1d", -- Landing Gear Handle, UP/DOWN {1, 0} 183 | [710] = "%1d", -- Landing Gear Emergency-up Button (Ground-use only! Hold in until gear retracts completely) {1} 184 | [631] = "%1d", -- Hydraulic Pressure Gage and Selector Switch, UTILITY/NORMAL/ALTERNATE {1} 185 | [641] = "%1d", -- Speed Brake Emergency Lever {1, 0} 186 | [684] = "%1d", -- Alternate-on Warning Light (Push to test) {1} 187 | [706] = "%1d", -- Alternate Hydraulic Emergency Override Handle, IN/OUT {1, -1} 188 | [647] = "%1d", -- Flight Control Switch, ALTERNATE ON/NORMAL/RESET {1} 189 | [815] = "%1d", -- Landing Gear Warning Horn Cutout Button (Push to silence horn) {1} 190 | [819] = "%.4f", -- Landing Gear Emergency Release Handle (rotary) {0.0,1.0} in 0.1 steps 191 | [211] = "%1d", -- Speed Brake Switch, OUT/HOLD/IN {-1.0,0.0,1.0} 192 | [217] = "%1d", -- Parking Brake Handle, ON/OFF 193 | -- Fuel Interface 194 | [672] = "%1d", -- Fuel Densitometer Selection Switch, IN/OUT {2, -2} 195 | [662] = "%.1f", -- Drop Tank Selector Switch {-0.1, 0.1} 196 | [701] = "%1d", -- Drop Tank Jettison Button - Push to release drop tank(s) {1} 197 | [695] = "%1d", -- Outboard Drop Tank Empty Indicator Light (Push to test) {1} 198 | -- Oxygen Interface 199 | [703] = "%1d", -- Oxygen Regulator Diluter Lever, NORMAL OXYGEN/100% OXYGEN {1, -1} 200 | [704] = "%.4f", -- Oxygen Regulator Supply Lever (rotary) {0.0 to 1.0} in -0.5 steps 201 | -- Fire Detection Interface 202 | [635] = "%1d", -- Engine Fire Warning Light Test Button {1,- 1} 203 | [685] = "%1d", -- Forward Engine Compartment Fire-warning Light (Push to test) {1} 204 | [686] = "%1d", -- Aft Engine Compartment Fire-warning Light (Push to test) {1} 205 | -- Air Interface 206 | [650] = "%1d", -- Cockpit Pressure Control Switch, PRESS/RAM {2, -2} 207 | [651] = "%1d", -- Cockpit Pressure Schedule Selector Switch, 5 PSI/2.75 PSI {2, -2} 208 | [646] = "%1d", -- Pitot Heater Switch, ON/OFF {2, -2} 209 | [740] = "%.4f", -- Cockpit Air Temperature Control Rheostat (rotary) {0.0, 1.0} in 0.3 steps 210 | --[736] = "%1d", -- Cockpit Air Temperature Control Switch Cover {1, -1} 211 | [737] = "%.1f", -- Cockpit Air Temperature Control Switch, AUTO/OFF/HOT/COLD {-1.0, 1.0} 212 | [645] = "%.1f", -- Engine Anti-Ice & Screen Switch, EXTEND/RET./ANTI-ICE {-1.0, 1.0} 213 | [741] = "%1d", -- Air Outlet Selector Lever, FLOOR/BOTH/DEFROST {-1, 1} 214 | [691] = "%1d", -- Windshield Anti-Ice Overheat Warning Light 215 | [202] = "%.4f", -- Windshield Anti-Icing Lever (rotary) {0.0,1.0} in 0.1 steps 216 | -- Light Interface 217 | [654] = "%1d", -- Compass Light Switch, ON/OFF {2, -2} 218 | [813] = "%.1f", -- Instrument Panel Primary Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps 219 | [811] = "%.1f", -- Instrument Panel Auxiliary Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps 220 | [812] = "%.1f", -- Console and Panel Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps 221 | -- Nav Lights Interface 222 | [661] = "%.1f", -- Landing & Taxi Lights Switch, EXTEND&ON/OFF/RETRACT {-1.0, 0.0, 1.0} 223 | [656] = "%.1f", -- Position and Fuselage Light Selector Switch, STEADY/OFF/FLASH {-1.0, 0.0, 1.0} 224 | [655] = "%1d", -- Exterior Lighting Dimmer Switch, BRIGHT/DIM {2, -2} 225 | -- Engine Interface 226 | [630] = "%1d", -- Emergency Fuel Switch, ON/OFF {2, -2} 227 | --[732] = "%1d", -- Emergency (In-air) Ignition Switch Cover {1, -1} 228 | [733] = "%.1f", -- Emergency (In-air) Ignition Switch, ON/OFF {1.0, 1.0} 229 | -- Control Interface 230 | [649] = "%.1f", -- Lateral Alternate Trim Switch, LEFT/RIGHT/NORMAL/OFF {0.3, 0.5, 0.1, 0.0} 231 | [648] = "%.1f", -- Rudder Trim Switch, LEFT/OFF/RIGHT {1.0, -1.0} 232 | --[738] = "%1d", -- Longitudinal Alternate Trim Switch Cover {1, -1} 233 | [739] = "%.1f", -- Longitudinal Alternate Trim Switch, NORMAL GRIP CONT/NOSE UP/NOSE DOWN/OFF {0.5, 0.3, 0.1, 0.0} 234 | [683] = "%1d", -- Take-off (Trim) Position Indicator Light (Push to test) {1} 235 | [735] = "%1d", -- Wing Flaps Handle {-1, 1} 236 | [209] = "%1d", -- Nose Wheel Steering Button 237 | -- radio ARC-27 238 | [806] = "%.4f", -- AN/ARC-27 UHF Audio Volume Knob (rotary) {0.1, 0.9} in 0.5 steps 239 | [807] = "%.1f", -- AN/ARC-27 UHF Preset Channel Selector {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8} 240 | [805] = "%.1f", -- AN/ARC-27 UHF Power Switch, OFF/T/R/T/R + G REC/ADF {0.0, 0.1, 0.2, 0.3} 241 | [213] = "%1d", -- Microphone Button 242 | -- radio compass ARN-6 243 | [802] = "%.4f", -- AN/ARN-6 Audio Volume Control (rotary) {0.1, 0.9} in 0.5 steps 244 | [803] = "%.1f", -- AN/ARN-6 Frequency Band Switch {0.0, 0.1, 0.2, 0.3} 245 | [667] = "%.1f", -- AN/ARN-6 Function Selector Switch, OFF/COMP/ANT./LOOP/CONT. {0.0, 0.1, 0.2, 0.3, 0.4} 246 | [666] = "%.1f", -- AN/ARN-6 LOOP L-R Switch {-1.0, 0.0, 1.0} 247 | --[null] = "%.4f", -- AN/ARN-6 Tuning Crank {0.0, 1.0} in 0.01 steps 248 | [657] = "%.1f", -- AN/ARN-6 Scale Light Switch, HI/OFF/LO {-0.1, 0.0, 0.1} 249 | [826] = "%.4f", -- AN/ARN-6 East/West Variation Knob (rotary) {0.0, 1.0} in 0.05 steps 250 | [658] = "%.1f", -- AN/ARN-6 CW-VOICE Switch, CW/VOICE {1.0, -1.0} 251 | -- IFF APX-6 252 | [810] = "%.1f", -- AN/APX-6 IFF Master Switch, EMERGENCY/NORM/LOW/STDBY/OFF {0.0, 0.1, 0.2, 0.3, 0.4} 253 | [659] = "%.1f", -- AN/APX-6 IFF Mode 2 Switch, MODE 2/OUT/I/P {-0.1, 0.0, 0.1} 254 | [660] = "%.1f", -- AN/APX-6 IFF Mode 3 Switch, MODE 3/OUT {0.0, 0.1} 255 | --[808] = "%1d", -- AN/APX-6 IFF Destruct Switch Cover {1, -1} 256 | [809] = "%1d", -- AN/APX-6 IFF Destruct Switch, OFF/ON {0, -1} 257 | -- baro altimeter 258 | [218] = "%.4f", -- Altimeter reference pressure adjusting knob (rotary) {0.0, 1.0} in 0.1 steps 259 | -- gyromag compass 260 | --[null] = "%.4f", -- Compass Correction (rotary) {0.0, 1.0} in 0.05 steps 261 | [598] = "%.1f", -- Directional Indicator Fast Slaving Button {0.0, 1.0} 262 | -- attitude indicator 263 | [714] = "%.1f", -- Pull to Cage Knob {0.0, 1.0} 264 | -- accelerometer 265 | [1004] = "%.1f", -- Accelerometer Reset Button {0.0, 1.0} 266 | -- CLOCK 267 | --[null] = "%1d", -- Set Clock Knob 268 | [831] = "%1d", -- Elapsed Time Mechanism Button {0, 1} 269 | -- A4 Gun Sight 270 | [716] = "%.4f", -- A-4 Sight Wing Span Adjustment Knob (rotary) {0.0, 1.0} in 0.1 steps 271 | [715] = "%.4f", -- A-4 Sight Radar Range Sweep Rheostat (rotary) {0.0, 1.0} in 0.1 steps 272 | [734] = "%.4f", -- A-4 Sight Reticle Dimmer Control (rotary) {0, 0.74} in -0.2 steps 273 | [755] = "%1d", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE {0, 1} 274 | [755] = "%.4f", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE (rotary) {0.001, 0.999} in 0.1 steps 275 | [212] = "%1d", -- A-4 Sight Electrical Caging Button 276 | [642] = "%1d", -- A-4 Sight Filament Selector Switch, SECONDARY/PRIMARY {2, -2} 277 | [210] = "%.4f", -- A-4 Sight Rotating Grip - Mouse Wheel for manual ranging {-1.0,1.0} in 0.2 steps 278 | [210] = "%1d", -- A-4 Sight Rotating Grip - Right Click for return to CCW spring-loaded position {1.0} 279 | [721] = "%.1f", -- Variable Sight Selector Unit - Sight Function Selector Lever, ROCKET/GUN/BOMB {0.0, 0.1, 0.2} 280 | [720] = "%.1f", -- Variable Sight Selector Unit - Target Speed Switch, HI/LO {0.0,0.5,1.0} 281 | [722] = "%.4f", -- Variable Sight Selector Unit - Rocket Depression Angle Selector (rotary) {0.0, 1.0} in 0.1 steps 282 | [727] = "%.4f", -- Bomb-Target Wind Control Knob (rotary) {0.0, 1.0} in 0.6 steps 283 | -- weapon system 284 | [639] = "", -- Demolition Bomb Release Selector Switch, AUTO RELEASE/MANUAL RELEASE {2,-2} 285 | [641] = "%.1f", -- Demolition Bomb Arming Switch (Fuze Selection), ARM NOSE&TAIL/OFF/TAIL ONLY {-1.0, 0.0, 1.0} 286 | [752] = "%.1f", -- Demolition Bomb Sequence Selector Switch, ALL/OFF/LEFT/RIGHT {0.0, 0.1, 0.2, 0.3, 0.4, 0.5} 287 | [638] = "%.1f", -- Rocket Fuze (Arming) Switch, DELAY/OFF/INSTANT {-1.0, 0.0, 1.0} 288 | [637] = "%1d", -- Rocket Jettison Switch, READY/OFF {2, -2} 289 | --[750] = "%1d", -- Rocket Release Selector Switch Cover {1, -1} 290 | [751] = "%.1f", -- Rocket Release Selector Switch, SINGLE/OFF/AUTO {-1.0, 0.0, 1.0} 291 | [668] = "%.1f", -- Gun Selector Switch {-0.2, 0.2} 292 | [665] = "%.1f", -- Gun-Missile Selector Switch, OFF/SIGHT CAMERA & RADAR/GUNS/MISSILE {0, 0.3} 293 | [636] = "%.1f", -- Gun Heater Switch, HEATER/OFF/(N/F) {-1.0, 1.0} 294 | [663] = "%1d", -- Manual Pip Control Switch, BOMB/NORMAL {2, -2} 295 | [796] = "%.1f", -- Manual Pip Control Change Calibrated Dials (Presets) {0.0, 0.3, 0.6, 0.9} 296 | [797] = "%.4f", -- Manual Pip Control Knob (rotary) {0.0, 1.0} in 0.1 steps 297 | [729] = "%.4f", -- A-4 Sight Bombing Altimeter Target Altitude Knob (rotary) {0.0, 1.0} in 0.015 steps 298 | [731] = "%.4f", -- A-4 Sight Bombing Altimeter Index Altitude Handle (rotary) {0.0, 1.0} in -0.015 steps 299 | [632] = "%1d", -- LABS Gyro Caging Switch, UNCAGE/CAGE {2,- 2} 300 | [633] = "%1d", -- LABS Start Switch, ON/OFF {2, -2} 301 | [634] = "%1d", -- LABS Change-over Switch, LABS/A-4 {2, -2} 302 | [702] = "%1d", -- Bomb-Rocket-Tank Jettison Button {0.0, 1.0} 303 | [820] = "%.1f", -- Missile Control Switch, LH & RH/RH/SALVO {-1.0, 0.0, 1.0} 304 | [821] = "%.4f", -- Tone Volume (rotary) {0.0, 1.0} in 0.1 steps 305 | [822] = "%.1f", -- Safe Launch Button {0.0, 1.0} 306 | [225] = "%1d", -- G-Limit Light - Push to test 307 | [226] = "%.4f", -- G-Limit Light - Rotate to adjust brightness(MW) (rotary) {0.0,0.5} in 0.02 steps 308 | [1001] = "%.1f", -- Rocket Intervalometer {0.0, 1.0} 309 | [208] = "%1d" -- A-4 Sight Radar Target Selector Button 310 | } 311 | 312 | ----------------------------- 313 | -- HIGH IMPORTANCE EXPORTS -- 314 | -- done every export event -- 315 | ----------------------------- 316 | 317 | -- Pointed to by ProcessIkarusDCSHighImportance 318 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 319 | --[[ 320 | every frame export to Ikarus 321 | Example from A-10C 322 | Get Radio Frequencies 323 | get data from device 324 | local lUHFRadio = GetDevice(54) 325 | ExportScript.Tools.SendData("ExportID", "Format") 326 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 327 | 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)) 328 | ]] 329 | end 330 | 331 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 332 | --[[ 333 | every frame export to DAC 334 | Example from A-10C 335 | Get Radio Frequencies 336 | get data from device 337 | local UHF_RADIO = GetDevice(54) 338 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 339 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 340 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 341 | 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)) 342 | ]] 343 | end 344 | 345 | ----------------------------------------------------- 346 | -- LOW IMPORTANCE EXPORTS -- 347 | -- done every gExportLowTickInterval export events -- 348 | ----------------------------------------------------- 349 | 350 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 351 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 352 | --[[ 353 | export in low tick interval to Ikarus 354 | Example from A-10C 355 | Get Radio Frequencies 356 | get data from device 357 | local lUHFRadio = GetDevice(54) 358 | ExportScript.Tools.SendData("ExportID", "Format") 359 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 360 | 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)) 361 | ]] 362 | 363 | ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {654,813,811,812}) 364 | -- Compass Light Switch, Instrument Panel Primary Light Rheostat, Instrument Panel Auxiliary Light Rheostat, Console and Panel Light Rheostat 365 | end 366 | 367 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 368 | --[[ 369 | export in low tick interval to DAC 370 | Example from A-10C 371 | Get Radio Frequencies 372 | get data from device 373 | local UHF_RADIO = GetDevice(54) 374 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 375 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 376 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 377 | 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)) 378 | ]] 379 | 380 | --===================================================================================== 381 | --[[ 382 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 383 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 384 | 385 | -- list_indication get tehe value of cockpit displays 386 | local ltmp1 = 0 387 | for ltmp2 = 0, 20, 1 do 388 | ltmp1 = list_indication(ltmp2) 389 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 390 | end 391 | ]] 392 | --[[ 393 | -- getmetatable get function name from devices 394 | local ltmp1 = 0 395 | for ltmp2 = 1, 70, 1 do 396 | ltmp1 = GetDevice(ltmp2) 397 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 398 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 399 | end 400 | ]] 401 | end 402 | 403 | ----------------------------- 404 | -- Custom functions -- 405 | ----------------------------- -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua: -------------------------------------------------------------------------------- 1 | -- FW-190D9 Dora 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.FW190D9 = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- Flight Instruments 19 | [36] = "%.4f", -- AirspeedNeedle {0, 100, 150, 200, 250, 300, 350, 400, 500, 600, 700, 750, 800, 850, 900} = {0.0, 0.038, 0.088, 0.150, 0.216, 0.278, 0.333, 0.395, 0.530, 0.660, 0.777,0.836, 0.892, 0.938, 0.988} 20 | [42] = "%.4f", -- Variometer {-30, -20, -10, -5, 5, 10, 20, 30} = {-1, -0.770, -0.558, -0.338,0.338,0.558, 0.770, 1.0} 21 | --TrimmNeedle 22 | [76] = "%.4f", -- TrimmNeedle {-1.0, 1.0} 23 | --ADF 24 | [29] = "%.4f", -- ADF_Vertical {-1.0, 1.0} 25 | [30] = "%.4f", -- ADF_Horizont {-1.0, 1.0} 26 | -- Altimeter 27 | [35] = "%.4f", -- Altimeter_km {0.0, 10.0} = {0.0, 1.0} 28 | [32] = "%.4f", -- Altimeter_m {0.0, 1000.0} = {0.0, 1.0} 29 | [33] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0} 30 | -- Artificial horizon 31 | [37] = "%.4f", -- AHorizon_Pitch {0.33, -0.33} 32 | [38] = "%.4f", -- AHorizon_Bank {1.0, -1.0} 33 | [40] = "%.4f", -- TurnNeedle {-1.0, 1.0} 34 | [41] = "%.4f", -- Slipball {-1.0, 1.0} 35 | --oxygen pressure indicator 36 | [112] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0} 37 | --[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0} 38 | --Remote compass 39 | [45] = "%.4f", -- CompassHeading {0.0, 1.0} 40 | [44] = "%.4f", -- CommandedCourse {0.0, 1.0} 41 | -- Engine 42 | [46] = "%.4f", -- Manifold_Pressure {0.5, 2.5} = {0.0, 1.0} 43 | [47] = "%.4f", -- Engine_RPM {0.0, 500.0, 1000.0, 1500, 2000, 2500, 3000, 3500, 3600.0} = {0.0, 0.032, 0.082, 0.206, 0.390, 0.601, 0.789, 0.961, 0.983} 44 | [96] = "%.4f", -- Coolant_Temperature {10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0} = {0.070, 0.131, 0.206, 0.289, 0.377, 0.468, 0.564, 0.655, 0.738, 0.811, 0.892, 0.946, 1.0} 45 | [97] = "%.4f", -- Oil_Temperature {10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0} = {0.070, 0.131, 0.206, 0.289, 0.377, 0.468, 0.564, 0.655, 0.738, 0.811, 0.892, 0.946, 1.0} 46 | [95] = "%.4f", -- Oil_Pressure {0.0, 15.0} -- at = {0, 1.0} 47 | [106] = "%.4f", -- MW50_Pressure {0.0, 0.1, 0.2, 0.3, 0.7, 0.8, 0.9, 1.0} -- at = {0.0, 0.068, 0.169, 0.273, 0.680, 0.780, 0.880, 1.0} 48 | -- Fuel 49 | [94] = "%.4f", -- Fuel_Pressure {0.0, 3.0} -- at = {0.0, 1.0} 50 | [98] = "%.4f", -- FuelScaleUpper {0.0, 50.0, 100.0, 150.0, 200.0, 250.0, 300.0} = {0.0, 0.130, 0.308, 0.50, 0.7, 0.87, 1.0} 51 | --???[98] = "%.4f", -- FuelScaleLower {0.0, 50.0, 100.0, 150.0, 200.0, 230.0, 250.0} = {0.0, 0.098, 0.328, 0.576, 0.833, 0.950, 1.0} 52 | [100] = "%.4f", -- Fuel_Low_Fwd {0.0, 1.0} 53 | [101] = "%.4f", -- Fuel_Low_Rear {0.0, 1.0} 54 | [195] = "%.4f", -- Fluor_Light {0.0, 1.0} 55 | --Clock 56 | [21] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0} = {0.0, 1.0} 57 | [22] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} = {0.0, 1.0} 58 | [23] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0} = {0.0, 1.0} 59 | [27] = "%.4f", -- CLOCK_chrono_minutes {0.0, 15.0} = {0.0, 1.0} 60 | --Ammon Counter 61 | [52] = "%.4f", -- Ammo_Counter_1 {0.0, 500.0} = {0.0, 1.0} 62 | [55] = "%.4f", -- Ammo_Counter_2 {0.0, 500.0} = {0.0, 1.0} 63 | [58] = "%.4f", -- Ammo_Counter_3 {0.0, 500.0} = {0.0, 1.0} 64 | [61] = "%.4f", -- Ammo_Counter_4 {0.0, 500.0} = {0.0, 1.0} 65 | -- Gun_Fire 66 | --[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0} 67 | --[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0} 68 | --[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0} 69 | --[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0} 70 | --Target System 71 | [133] = "%.4f", -- TargetDist {0.0, 10.0, 100.0, 300.0, 600.0, 700.0, 800.0, 1000.0} = {0.0, 0.0, 0.323, 0.568, 0.709, 0.813, 0.917, 1.0} 72 | --Bomb Lamps 73 | [196] = "%.f", -- BombLamp_1 {0.0, 1.0} 74 | [197] = "%.f", -- BombLamp_2 {0.0, 1.0} 75 | [198] = "%.f", -- BombLamp_3 {0.0, 1.0} 76 | [199] = "%.f", -- BombLamp_4 {0.0, 1.0} 77 | [137] = "%.f", -- RocketEmCvr {0.0, 1.0} 78 | --Gear Lamps 79 | [68] = "%.f", -- L_GEAR_UP {0.0, 1.0} 80 | [69] = "%.f", -- L_GEAR_DOWN {0.0, 1.0} 81 | [70] = "%.f", -- R_GEAR_UP {0.0, 1.0} 82 | [71] = "%.f", -- R_GEAR_DOWN {0.0, 1.0} 83 | --Flaps Lamps 84 | [72] = "%.f", -- FLAPS_UP {0.0, 1.0} 85 | [73] = "%.f", -- FLAPS_START {0.0, 1.0} 86 | [74] = "%1d" -- FLAPS_DOWN {0.0, 1.0} 87 | } 88 | ExportScript.ConfigArguments = 89 | { 90 | --[[ 91 | arguments for export in low tick interval 92 | based on "clickabledata.lua" 93 | ]] 94 | [159] = "%.2f", -- Radiator Flaps Control (axis) 1.0 in 0.4 steps 95 | [160] = "%1d", -- Cold Start/Wind Screen Washer {0, 1} 96 | --Engine Control Panel 97 | [75] = "%.1f", -- Magneto Switch (Off, M1, M2, M1+M2) {0.0, 0.3, 0.6, 0.9} 98 | [104] = "%1d", -- Starter Switch Cover {0, 1} 99 | [105] = "%.1f", -- Starter Switch. Left Button - Starter Power. Right Button - Magnetic Clutch {0.0, 0.5, 1.0} 100 | [91] = "%1d", -- MBG Emergency Mode Handle {0, 1} 101 | [85] = "%1d", -- MW-50 Switch {0, 1} 102 | --Fuel system 103 | [90] = "%.1f", -- Fuel Tank Selector Valve (CLOSE/FORWARD/AFT/BOTH) {0.0, 0.1, 0.2, 0.3} 104 | [99] = "%.1f", -- Fuel Gauge Selector (FORWARD/NONE/AFT) {0.0, 0.5, 1.0} 105 | [161] = "%1d", -- MW-B4 Selector (Not Functional) 106 | [162] = "%1d", -- Primer Pump {0, 1} 107 | --electric system 108 | [79] = "%1d", -- Electric Kill-switch 109 | [163] = "%1d", -- Emergency Equipment Destruction {0, 1} 110 | --Circuit Breakers 111 | [138] = "%1d", -- Circuit Breakers Cover {0, 1} 112 | [141] = "%1d", -- Flaps, Trimmer, Artificial Horizon Power On {0, 1} 113 | [142] = "%1d", -- Flaps, Trimmer, Artificial Horizon Power Off {0, 1} 114 | [143] = "%1d", -- Landing Gear Power On {0, 1} 115 | [144] = "%1d", -- Landing Gear Power Off {0, 1} 116 | [145] = "%1d", -- Pitot and Heating Cover On {0, 1} 117 | [146] = "%1d", -- Pitot and Heating Cover Off {0, 1} 118 | [147] = "%1d", -- FuG25a On {0, 1} 119 | [148] = "%1d", -- FuG25a Off {0, 1} 120 | [149] = "%1d", -- FuG16ZY On {0, 1} 121 | [150] = "%1d", -- FuG16ZY Off {0, 1} 122 | [151] = "%1d", -- Instrument Lights, Gun-sight, Indicators, Compass, Starter On {0, 1} 123 | [152] = "%1d", -- Instrument Lights, Gun-sight, Indicators, Compass, Starter Off {0, 1} 124 | [153] = "%1d", -- Generator On {0, 1} 125 | [154] = "%1d", -- Generator Off {0, 1} 126 | [155] = "%1d", -- Battery On {0, 1} 127 | [156] = "%1d", -- Battery Off {0, 1} 128 | --Circuit Breakers of additional panel 129 | [121] = "%1d", -- Navigation Lights On {0, 1} 130 | [120] = "%1d", -- Navigation Lights Off {0, 1} 131 | [123] = "%1d", -- Forward Tank Pump On {0, 1} 132 | [122] = "%1d", -- Forward Tank Pump Off {0, 1} 133 | [125] = "%1d", -- Rear Tank Pump On {0, 1} 134 | [124] = "%1d", -- Rear Tank Pump Off {0, 1} 135 | [127] = "%1d", -- Auxiliary Tank Pump On {0, 1} 136 | [126] = "%1d", -- Auxiliary Tank Pump Off {0, 1} 137 | [129] = "%1d", -- MW-50 On {0, 1} 138 | [128] = "%1d", -- MW-50 Off {0, 1} 139 | --canopy 140 | [115] = "%1d", -- Canopy Emergency Release Handle {0, 1} 141 | [114] = "%.2f", -- Canopy Hand Crank (axis) 142 | -- Throttle 143 | [200] = "", -- Throttle Lock {0, 1} 144 | --gauges 145 | [34] = "%.2f", -- Altimeter Pressure Set (axis) 146 | [39] = "%.2f", -- Horizon Cage (axis) {0.0 - 0.511 in 0.04 steps} 147 | [43] = "%.2f", -- Course Set (axis) 148 | --flaps 149 | [62] = "%1d", -- Flaps Up {0, 1} 150 | [63] = "%1d", -- Flaps Take Off {0, 1} 151 | [64] = "%1d", -- Flaps Landing {0, 1} 152 | --Landing Gears Retraction 153 | [65] = "%1d", -- Landing Gears Retraction {0, 1} 154 | [66] = "%1d", -- Landing Gears Retraction Cover {0, 1} 155 | [67] = "%1d", -- Landing Gears Extending {0, 1} 156 | [89] = "%1d", -- Landing Gear Emergency Release Handle {0, 1} 157 | --Trimmer 158 | [77] = "%1d", -- Stabilizer Trimmer Up/Down {-1, 0, 1} 159 | --Clock 160 | [24] = "%.4f", -- Turnable Bezel (axis) in 0.2 steps 161 | [25] = "%.2f", -- Wind/Set Knob (axis) in 0.1 steps 162 | [26] = "%1d", -- Start - Stop Button {0, 1} 163 | [28] = "%1d", -- Stopwatch Button {0, 1} 164 | --weapons 165 | [48] = "%.2f", -- Master Arm 166 | [51] = "%.2f", -- Set Gun 1 Ammunition Count (axis) in 0.4 steps 167 | [54] = "%.2f", -- Set Gun 2 Ammunition Count (axis) in 0.4 steps 168 | [57] = "%.2f", -- Set Gun 3 Ammunition Count (axis) in 0.4 steps 169 | [60] = "%.2f", -- Set Gun 4 Ammunition Count (axis) in 0.4 steps 170 | [107] = "%1d", -- Main Rocket Switch {0, 1} 171 | [108] = "%1d", -- Rocket Emergency Release {0, 1} 172 | [109] = "%.2f", -- Bomb Fusing Selector {0.0, 0.1, 0.2, 0.3, 0.4} 173 | [92] = "%1d", -- Jettison Fuselage Stores {0, 1} 174 | --Gunsight 175 | [132] = "%1d", -- EZ42 Power Switch {0, 1} 176 | [131] = "%.2f", -- Target Wingspan (axis) in 0.1 steps 177 | [134] = "%1d", -- Gunsight Night Filter {0, 1} 178 | [4] = "%.2f", -- Target Distance (axis) in 0.1 steps 179 | [135] = "%.2f", -- Gunsight Brightness (axis) in 0.1 steps 180 | [191] = "%.2f", -- Aiming correction 1 (axis) in 0.1 steps 181 | --Instrument Lights Brightness 182 | [78] = "", -- Instrument Lights Brightness (axis) in 0.4 steps 183 | --Radio 184 | [81] = "%.1f", -- Radio Channel Selector {0.0, 0.1, 0.2, 0.3} 185 | [83] = "%.2f", -- Radio Volume (axis) in 0.04 steps 186 | [84] = "%1d", -- FT FT / Y ZF Mode Switch {0, 1} 187 | [82] = "%.2f", -- Radio Tuning (+/-30 kHz) (axis) in 0.04 steps 188 | --Oxygen 189 | [110] = "%.2f", -- Oxygen Flow Valve (axis) in 0.04 steps 190 | [190] = "%1d", -- Oxygen Emergency Knob {0, 1} 191 | --IFF 192 | [86] = "%1d", -- IFF Channel Selector {-1, 0, 1} 193 | [88] = "%1d" -- IFF Check {0, 1} 194 | } 195 | 196 | ----------------------------- 197 | -- HIGH IMPORTANCE EXPORTS -- 198 | -- done every export event -- 199 | ----------------------------- 200 | 201 | -- Pointed to by ProcessIkarusDCSHighImportance 202 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 203 | --[[ 204 | every frame export to Ikarus 205 | Example from A-10C 206 | Get Radio Frequencies 207 | get data from device 208 | local lUHFRadio = GetDevice(54) 209 | ExportScript.Tools.SendData("ExportID", "Format") 210 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 211 | 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)) 212 | ]] 213 | --[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0} 214 | --[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0} 215 | --[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0} 216 | --[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0} 217 | --[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0} 218 | ExportScript.Tools.SendData(50, string.format("%.4f", mainPanelDevice:get_argument_value(50))) -- Gun_Fire_1 {0.0, 1.0} 219 | ExportScript.Tools.SendData(164, string.format("%.4f", mainPanelDevice:get_argument_value(164))) -- Gun_Fire_2 {0.0, 1.0} 220 | ExportScript.Tools.SendData(165, string.format("%.4f", mainPanelDevice:get_argument_value(165))) -- Gun_Fire_3 {0.0, 1.0} 221 | ExportScript.Tools.SendData(166, string.format("%.4f", mainPanelDevice:get_argument_value(166))) -- Gun_Fire_4 {0.0, 1.0} 222 | ExportScript.Tools.SendData(113, string.format("%.4f", mainPanelDevice:get_argument_value(113))) -- Oxygen_Flow_Blinker {0.0, 1.0} 223 | end 224 | 225 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 226 | --[[ 227 | every frame export to DAC 228 | Example from A-10C 229 | Get Radio Frequencies 230 | get data from device 231 | local UHF_RADIO = GetDevice(54) 232 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 233 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 234 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 235 | 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)) 236 | ]] 237 | ExportScript.Tools.SendData(50, mainPanelDevice:get_argument_value(50) > 0.3 and 1 or 0) -- Gun_Fire_1 {0.0, 1.0} 238 | ExportScript.Tools.SendData(164, mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Gun_Fire_2 {0.0, 1.0} 239 | ExportScript.Tools.SendData(165, mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Gun_Fire_3 {0.0, 1.0} 240 | ExportScript.Tools.SendData(166, mainPanelDevice:get_argument_value(166) > 0.3 and 1 or 0) -- Gun_Fire_4 {0.0, 1.0} 241 | ExportScript.Tools.SendData(113, mainPanelDevice:get_argument_value(113) > 0.3 and 1 or 0) -- Oxygen_Flow_Blinker {0.0, 1.0} 242 | end 243 | 244 | ----------------------------------------------------- 245 | -- LOW IMPORTANCE EXPORTS -- 246 | -- done every gExportLowTickInterval export events -- 247 | ----------------------------------------------------- 248 | 249 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 250 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 251 | --[[ 252 | export in low tick interval to Ikarus 253 | Example from A-10C 254 | Get Radio Frequencies 255 | get data from device 256 | local lUHFRadio = GetDevice(54) 257 | ExportScript.Tools.SendData("ExportID", "Format") 258 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 259 | 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)) 260 | ]] 261 | end 262 | 263 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 264 | --[[ 265 | export in low tick interval to DAC 266 | Example from A-10C 267 | Get Radio Frequencies 268 | get data from device 269 | local UHF_RADIO = GetDevice(54) 270 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 271 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 272 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 273 | 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)) 274 | ]] 275 | 276 | --===================================================================================== 277 | --[[ 278 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 279 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 280 | 281 | -- list_indication get tehe value of cockpit displays 282 | local ltmp1 = 0 283 | for ltmp2 = 0, 20, 1 do 284 | ltmp1 = list_indication(ltmp2) 285 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 286 | end 287 | ]] 288 | --[[ 289 | -- getmetatable get function name from devices 290 | local ltmp1 = 0 291 | for ltmp2 = 1, 70, 1 do 292 | ltmp1 = GetDevice(ltmp2) 293 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 294 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 295 | end 296 | ]] 297 | end 298 | 299 | ----------------------------- 300 | -- Custom functions -- 301 | ----------------------------- -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/J-11A.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/J-11A.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua: -------------------------------------------------------------------------------- 1 | -- MiG-15Bis 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.MiG15bis = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | [225] = "%.4f", -- Canopy 19 | [223] = "%.4f", -- LeftCanopyLever 20 | [222] = "%.4f", -- RightCanopyLever 21 | [224] = "%.4f", -- AftCanopyLever 22 | [14] = "%.4f", -- Variometer {-75.0,-60.0,-45.0,-30.0,-15.0,-10.0,-5.0,0.0,5.0,10.0,15.0,30.0,45.0,60.0,75.0} {0.0,0.075,0.151,0.24,0.352,0.401,0.448,0.5,0.553,0.6,0.649,0.76,0.848,0.925,1.0} 23 | [28] = "%.4f", -- Altimeter_km {0.0, 10.0}{0.0, 1.0} 24 | [29] = "%.4f", -- Altimeter_m {0.0, 1000.0}{0.0, 1.0} 25 | [31] = "%.4f", -- Altimeter_Pressure {670, 790}{0.0, 1.0} 26 | [15] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} 27 | [16] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} 28 | [22] = "%.4f", -- CLOCK_flight_time_meter_status {0.0, 0.2}{0.5, 0.0} 29 | [18] = "%.4f", -- CLOCK_flight_hours {0.0, 12.0}{0.0, 1.0} 30 | [19] = "%.4f", -- CLOCK_flight_minutes {0.0, 60.0}{0.0, 1.0} 31 | [20] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0, 60.0}{0.0, 1.0} 32 | [17] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0, 60.0}{0.0, 1.0} 33 | [4] = "%.4f", -- IAS {100.0, 1100.0}{0.0, 1.0} 34 | [5] = "%.4f", -- TAS {100.0, 1100.0}{0.0, 1.0} 35 | [27] = "%.4f", -- MACH {0.0,0.3,0.95}{0.12,0.215,1.0} 36 | [6] = "%.4f", -- AGK_47B_roll {-1.0, 1.0} 37 | [7] = "%.4f", -- AGK_47B_pitch {1.0, -1.0} 38 | [11] = "%.4f", -- AGK_47B_failure_flag {0.0, 1.0} 39 | --[8] = "%.4f", -- AGK_47B_sideslip {-1.0, 1.0} 40 | [9] = "%.4f", -- AGK_47B_turn {-1.0, 1.0} 41 | [10] = "%.4f", -- AGK_47B_horizon {-1.0, 1.0} 42 | [35] = "%.4f", -- PRV_46_RAlt {-10.0, 0.0, 1200.0}{-1.0, 0.0, 1.0} 43 | [32] = "%.4f", -- PDK-45 HeadingScale {1.0, 0.0} 44 | [33] = "%.4f", -- PDK-45 Heading {1.0, 0.0} 45 | -- Weapon System 46 | [95] = "%.4f", -- N37D_Ready_Lamp 47 | [93] = "%.4f", -- NR23_TOP_Ready_Lamp 48 | [94] = "%.4f", -- NR23_BOTTOM_Ready_Lamp 49 | [100] = "%.4f", -- Tactical_Rel_Lamp 50 | [98] = "%.4f", -- LEFT_BOMB_Lamp 51 | [99] = "%.4f", -- RIGHT_BOMB_Lamp 52 | -- electric system 53 | [83] = "%.4f", -- VoltAmperMeter {-1.0, 0.0, 3.0}{-1.0, 0.0, 1.0} 54 | [244] = "%.4f", -- lamps_lightness 55 | -- hydraulic system 56 | [168] = "%.4f", -- HydraulicPressureMain {0.0, 250.0}{0.0, 1.0} 57 | [139] = "%.4f", -- HydraulicPressureGain {0.0, 150.0}{0.0, 1.0} 58 | [169] = "%.4f", -- HydraulicPressureAirFlaps {0.0, 80.0}{0.0, 1.0} 59 | [165] = "%.4f", -- HydraulicPressureAirGears {0.0, 80.0}{0.0, 1.0} 60 | [172] = "%.4f", -- HydraulicPressureMainAir {0.0, 250.0}{0.0, 1.0} 61 | -- gear system 62 | [121] = "%.4f", -- LeftBrakePressure {0.0, 12.0}{0.0, 1.0} 63 | [122] = "%.4f", -- RightBrakePressure {0.0, 12.0}{0.0, 1.0} 64 | -- fuel system 65 | [47] = "%.4f", -- FuelQuantity {-100.0,0.0,100.0,200.0,300.0,400.0,500.0,600.0,700.0,800.0,1050.0}{0.0,0.047,0.136,0.22,0.38,0.52,0.631,0.755,0.869,0.921,1.0} 66 | -- air system 67 | [188] = "%.4f", -- CanopyAirValveIndication 68 | [39] = "%.4f", -- CockpitAltitude {0.0,8000.0} {0.008,1.0} 69 | [40] = "%.4f", -- PressureDifference {-0.04,0.0,0.6} {0.0,0.243,1.0} 70 | -- oxygen system 71 | [48] = "%.4f", -- OxygenPressure {0.0,250.0} {0.0,1.0} 72 | [60] = "%.4f", -- FlowBlinker 73 | [49] = "%.4f", -- FlowPressure {0.0,150.0,170.0} {0.0,0.9,1.0} 74 | -- Engine 75 | [42] = "%.4f", -- EngineTachometer {0.0,15000.0} {0.0,1.0} 76 | [41] = "%.4f", -- EngineTemperature {300.0,900.0} {0.0,1.0} 77 | [45] = "%.4f", -- OilTemperature {-50.0,150.0} {0.0,1.0} 78 | [44] = "%.4f", -- OilPressure {0.0, 10.0} {0.0,1.0} 79 | [43] = "%.4f", -- EngineFuelPressure {0.0,100.0} {0.0,1.0} 80 | [46] = "%.4f", -- FuelPressure {0.0,10.0} {0.0,1.0} 81 | -- radio compass 82 | [238] = "%.4f", -- ARK5_Band {0.0, 2.0} {0.0, 0.4} 83 | [176] = "%.4f", -- ARK5_TuningMeter 84 | [175] = "%.4f", -- ARK5_Tuning {0.0, 0.2} {0.0, 1.0} 85 | [38] = "%.4f", -- ARK5_Bearing 86 | [239] = "%.4f", -- ARK5_FreqScale {0.0,0.5,1.0,1.5,2.0,2.5,3.0} {0.0,0.0695,0.14,0.2865,0.43,0.7155,1.0} 87 | -- Radio RSI-6K 88 | [235] = "%.4f", -- RadioAntennaPower 89 | [128] = "%.4f", -- RadioReceiverKnob {0.0, 0.2}{0.0, 1.0} 90 | [127] = "%.4f", -- RadioReceiverInd {0.0, 1.0}{0.036, 0.961} 91 | [144] = "%.4f", -- RadioReceiverGauge {0.0, 1.0}{0.026, 0.957} 92 | [245] = "%.4f", -- ASP_3N_Range 93 | -- Lamps 94 | -- electric system 95 | [57] = "%.f", -- lamp_GeneratorOff {-1.0, 1.0}{-1.0, 1.0} 96 | [58] = "%.f", -- lamp_Ignition {-1.0, 1.0}{-1.0, 1.0} 97 | -- power plant 98 | [119] = "%.f", -- lamp_IsolatingValve {-1.0, 1.0}{-1.0, 1.0} 99 | -- gear system 100 | [75] = "%.f", -- lamp_LeftGearExt {-1.0, 1.0}{-1.0, 1.0} 101 | [74] = "%.f", -- lamp_LeftGearRet {-1.0, 1.0}{-1.0, 1.0} 102 | [79] = "%.f", -- lamp_RightGearExt {-1.0, 1.0}{-1.0, 1.0} 103 | [78] = "%.f", -- lamp_RightGearRet {-1.0, 1.0}{-1.0, 1.0} 104 | [77] = "%.f", -- lamp_NoseGearExt {-1.0, 1.0}{-1.0, 1.0} 105 | [76] = "%.f", -- lamp_NoseGearRet {-1.0, 1.0}{-1.0, 1.0} 106 | [53] = "%.f", -- lamp_ExtendGears {-1.0, 1.0}{-1.0, 1.0} 107 | -- fuel system 108 | [56] = "%.f", -- lamp_Remain300 {-1.0, 1.0}{-1.0, 1.0} 109 | [50] = "%.f", -- lamp_AftEmpty {-1.0, 1.0}{-1.0, 1.0} 110 | [52] = "%.f", -- lamp_DropTanks {-1.0, 1.0}{-1.0, 1.0} 111 | [51] = "%.f", -- lamp_BoostPressure {-1.0, 1.0}{-1.0, 1.0} 112 | -- control system 113 | [113] = "%.f", -- lamp_TrimmerNeutral {-1.0, 1.0}{-1.0, 1.0} 114 | [59] = "%.f", -- lamp_FlapsExt {-1.0, 1.0}{-1.0, 1.0} 115 | [124] = "%.f", -- lamp_AirBrakeExt {-1.0, 1.0}{-1.0, 1.0} 116 | -- fire extinguisher system 117 | [135] = "%.f", -- lamp_FireDetected {-1.0, 1.0}{-1.0, 1.0} 118 | -- ARK-5 119 | [183] = "%.f", -- lamp_ARK_5 {-1.0, 1.0}{-1.0, 1.0} 120 | [218] = "%.f", -- light_ARK_5_scale {-1.0, 1.0}{-1.0, 1.0} 121 | -- MRP-48P 122 | [54] = "%.f", -- lamp_Marker {-1.0, 1.0}{-1.0, 1.0} 123 | -- Light System 124 | [226] = "%.4f", -- light_LeftUV {-1.0, 1.0}{-1.0, 1.0} 125 | [215] = "%.4f", -- light_CenterUV {-1.0, 1.0}{-1.0, 1.0} 126 | [227] = "%.4f", -- light_RightUV {-1.0, 1.0}{-1.0, 1.0} 127 | [217] = "%.4f", -- light_Panels {-1.0, 1.0}{-1.0, 1.0} 128 | [216] = "%.4f", -- light_AuxLeftPanel {-1.0, 1.0}{-1.0, 1.0} 129 | -- Gun Camera 130 | [55] = "%.f" -- lamp_GunCamera {-1.0, 1.0}{-1.0, 1.0} 131 | } 132 | ExportScript.ConfigArguments = 133 | { 134 | --[[ 135 | arguments for export in low tick interval 136 | based on "clickabledata.lua" 137 | ]] 138 | 139 | -- Cockpit mechanics 140 | [221] = "%.4f", -- Emergency Canopy Jettison - Pull to jettison 141 | [223] = "%.4f", -- Left Canopy Lever, OPEN/CLOSE 142 | [222] = "%.4f", -- Right Canopy Lever, OPEN/CLOSE 143 | [224] = "%.4f", -- Aft Canopy Lever, OPEN/CLOSE 144 | -- Control system 145 | [114] = "%.4f", -- Elevator Trimmer Switch, PULL(CLIMB)/OFF/PUSH(DESCEND) 146 | [142] = "%.4f", -- Aileron Trimmer Switch, LEFT/OFF/RIGHT 147 | [207] = "%.4f", -- Wing Flaps Handle, RETRACT/NEUTRAL/20 degrees/55 degrees 148 | [125] = "%.4f", -- Airbrake Switch, CLOSE/OPEN 149 | [203] = "%.4f", -- Hydro Booster Lever, ON/OFF 150 | [204] = "%.4f", -- Throttle Friction Lever 151 | [198] = "%.4f", -- Airbrake Button, Hold to extend 152 | -- Electric system 153 | [84] = "%.4f", -- Ampere- & Voltmeter - Push to view Volts 154 | [149] = "%.4f", -- Air Start Switch, ON/OFF 155 | [81] = "%.4f", -- Pitot and Clock Heater Switch, ON/OFF 156 | [200] = "%.4f", -- Engine Start Button - Push to start 157 | [214] = "%.4f", -- Engine Start Button Cover 158 | -- Circuit Breakers 159 | [117] = "%.4f", -- Transfer Pump Switch, ON/OFF 160 | [115] = "%.4f", -- Booster Pump Switch, ON/OFF 161 | [120] = "%.4f", -- Ignition Switch, ON/OFF 162 | [116] = "%.4f", -- Instruments and Lights Switch, ON/OFF 163 | -- Right Panel 164 | [152] = "%.4f", -- Accumulator Switch, ON/OFF 165 | [153] = "%.4f", -- Generator Switch, ON/OFF 166 | [151] = "%.4f", -- Nose Light Master Switch, ON/OFF 167 | [154] = "%.4f", -- Trim Master Switch, ON/OFF 168 | [155] = "%.4f", -- AGK-47B Artificial Horizon + DGMK-3 Switch, ON/OFF 169 | [158] = "%.4f", -- Radio Switch, ON/OFF 170 | [157] = "%.4f", -- Bombs Switch, ON/OFF 171 | [156] = "%.4f", -- Emergency Drop Switch, ON/OFF 172 | [159] = "%.4f", -- ARK Switch, ON/OFF 173 | [160] = "%.4f", -- RV-2 Radio Altimeter Switch, ON/OFF 174 | [161] = "%.4f", -- NR-23 Cannon Switch, ON/OFF 175 | [162] = "%.4f", -- N-37D Cannon Switch, ON/OFF 176 | [163] = "%.4f", -- ASP-3N Gunsight Switch, ON/OFF 177 | [164] = "%.4f", -- S-13 Gun Camera Switch, ON/OFF 178 | -- HydroSystem 179 | [171] = "%.4f", -- Emergency Flaps Valve 180 | [167] = "%.4f", -- Emergency Gears Valve 181 | [170] = "%.4f", -- Emergency Flaps Valve Cover 182 | [166] = "%.4f", -- Emergency Gears Valve Cover 183 | [186] = "%.4f", -- Emergency System Filling Valve 184 | [242] = "%.4f", -- Air Net Valve 185 | [241] = "%.4f", -- Cockpit Filling Valve 186 | -- Gear System 187 | [71] = "%.4f", -- Landing Gear Handle, UP/DOWN 188 | [72] = "%.4f", -- Gear Lamps Test Button - Push to test 189 | [210] = "%.4f", -- Right Emergency Gear Release Handle 190 | [209] = "%.4f", -- Left Emergency Gear Release Handle 191 | [85] = "%.4f", -- Landing Gear Handle Lock, Lock/Unlock 192 | -- Fuel System 193 | [82] = "%.4f", -- Drop Tank Signal Switch, ON/OFF 194 | [141] = "%.4f", -- Oxygen Supply Valve 195 | [143] = "%.4f", -- Air Valve 196 | [243] = "%.4f", -- Oxygen Emergency Valve 197 | -- Conditioning and Heating System 198 | [187] = "%.4f", -- Cockpit Air Valve 199 | [86] = "%.4f", -- Ventilation Valve 200 | -- Internal Lights System 201 | [184] = "%.4f", -- Left UV Light Rheostat 202 | [185] = "%.4f", -- Right UV Light Rheostat 203 | [220] = "%.4f", -- Panels Light Rheostat 204 | -- Nav Lights System 205 | [111] = "%.4f", -- External Lights Switch, ON/OFF 206 | [80] = "%.4f", -- Nose Light Switch, ON/OFF 207 | -- Power Plant 208 | [208] = "%.4f", -- Engine Stop, CLOSE/OPEN 209 | [118] = "%.4f", -- Isolating Valve Switch, ON/OFF 210 | -- Fire Extinguisher System 211 | [136] = "%.4f", -- Engine Fire Extinguisher Button Cover 212 | [137] = "%.4f", -- Engine Fire Extinguisher Button 213 | [138] = "%.4f", -- Engine Fire Warning Light Test Button - Push to test 214 | -- Signal Flares 215 | [129] = "%.4f", -- Signal Flare Switch, ON/OFF 216 | [130] = "%.4f", -- Signal Flare Yellow Button 217 | [131] = "%.4f", -- Signal Flare Green Button 218 | [132] = "%.4f", -- Signal Flare Red Button 219 | [133] = "%.4f", -- Signal Flare White Button 220 | ---------------------------------------------------- 221 | -- Devices 222 | -- AGK-47B 223 | [12] = "%.4f", -- AGK-47B Artificial Horizon Cage - Pull to cage 224 | [13] = "%.4f", -- AGK-47B Artificial Horizon Zero Pitch Trim Knob 225 | --VD-15 226 | [30] = "%.4f", -- Barometric Pressure QFE Knob 227 | --PRV-46 228 | [36] = "%.4f", -- PRV-46 Radar Altimeter Indicator Range Switch, 120m/1200m AGL 229 | [37] = "%.4f", -- PRV-46 Radar Altimeter Indicator Power Switch, ON/OFF 230 | --PDK-45 231 | [34] = "%.4f", -- Heading Knob 232 | [61] = "%.4f", -- Fast Slave Button 233 | -- CLOCK 234 | [23] = "%.4f", -- AChS-1 Cockpit Chronograph Left Knob (button) 235 | [24] = "%.4f", -- AChS-1 Cockpit Chronograph Left Knob (rotary) 236 | [25] = "%.4f", -- AChS-1 Cockpit Chronograph Right Knob (button) 237 | [26] = "%.4f", -- AChS-1 Cockpit Chronograph Right Knob (rotary) 238 | -- Weapon System 239 | [92] = "%.4f", -- N-37D Cannon Reload Button 240 | [90] = "%.4f", -- NR-23 (Top) Cannon Reload Button 241 | [91] = "%.4f", -- NR-23 (Bottom) Cannon Reload Button 242 | [96] = "%.4f", -- Tactical Release Switch, ON/OFF 243 | [97] = "%.4f", -- Emergency Release Button 244 | [104] = "%.4f", -- Emergency Release Button Cover 245 | --ASP-3N Gunsight 246 | [101] = "%.4f", -- ASP-3N Gunsight Mode, GYRO/FIXED 247 | [106] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever 248 | [103] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever (rotary) 249 | [102] = "%.4f", -- ASP-3N Gunsight Brightness Knob (rotary) 250 | [201] = "%.4f", -- ASP-3N Gunsight Target Distance (rotary) 251 | [105] = "%.4f", -- ASP-3N Gunsight Color Filter, ON/OFF 252 | -- ARK-5 radio compass 253 | [180] = "%.4f", -- ARK-5 Audio Volume Control (rotary) 254 | [177] = "%.4f", -- ARK-5 Frequency Band Switch 255 | [174] = "%.4f", -- ARK-5 Function Selector Switch, OFF/COMP/ANT./LOOP 256 | [178] = "%.4f", -- ARK-5 LOOP L-R Switch 257 | --[] = "%.4f", -- ARK-5 Tuning Crank (rotary) 258 | [181] = "%.4f", -- ARK-5 Scale Light Control (rotary) 259 | [173] = "%.4f", -- ARK-5 TLG-TLF Switch 260 | [182] = "%.4f", -- ARK-5 Take Control Button 261 | [123] = "%.4f", -- ARK-5 Near/Far NDB Switch 262 | [146] = "%.4f", -- ARK-5 NDB 1 Switch 263 | [147] = "%.4f", -- ARK-5 NDB 2 Switch 264 | [148] = "%.4f", -- ARK-5 NDB 3 Switch 265 | -- RSI-6K radio 266 | [126] = "%.4f", -- RSI-6K Audio Volume Control (rotary) 267 | [232] = "%.4f", -- RSI-6K Wave Control (rotary) 268 | [230] = "%.4f", -- RSI-6K Antenna Control (rotary) 269 | [231] = "%.4f", -- RSI-6K Wave Lock 270 | [233] = "%.4f", -- RSI-6K Antenna Lock 271 | [128] = "%.4f", -- RSI-6K Receiver Tuning (rotary) 272 | [140] = "%.4f", -- RSI-6K Receive/ARK 273 | [240] = "%.4f", -- RSI-6K Forced Mode, ON/OFF 274 | [202] = "%.4f", -- Microphone Button 275 | } 276 | 277 | ----------------------------- 278 | -- HIGH IMPORTANCE EXPORTS -- 279 | -- done every export event -- 280 | ----------------------------- 281 | 282 | -- Pointed to by ProcessIkarusDCSHighImportance 283 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 284 | --[[ 285 | every frame export to Ikarus 286 | Example from A-10C 287 | Get Radio Frequencies 288 | get data from device 289 | local lUHFRadio = GetDevice(54) 290 | ExportScript.Tools.SendData("ExportID", "Format") 291 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 292 | 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)) 293 | ]] 294 | -- AGK_47B_sideslip negate 295 | --[8] = "%.4f", -- AGK_47B_sideslip {-1.0, 1.0} 296 | ExportScript.Tools.SendData(8, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(8)))) -- negate 297 | end 298 | 299 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 300 | --[[ 301 | every frame export to DAC 302 | Example from A-10C 303 | Get Radio Frequencies 304 | get data from device 305 | local UHF_RADIO = GetDevice(54) 306 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 307 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 308 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 309 | 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)) 310 | ]] 311 | end 312 | 313 | ----------------------------------------------------- 314 | -- LOW IMPORTANCE EXPORTS -- 315 | -- done every gExportLowTickInterval export events -- 316 | ----------------------------------------------------- 317 | 318 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 319 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 320 | --[[ 321 | export in low tick interval to Ikarus 322 | Example from A-10C 323 | Get Radio Frequencies 324 | get data from device 325 | local lUHFRadio = GetDevice(54) 326 | ExportScript.Tools.SendData("ExportID", "Format") 327 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 328 | 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)) 329 | ]] 330 | 331 | -- Cockpit Light 332 | ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, 220) 333 | -- Panels Light Rheostat 334 | end 335 | 336 | 337 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 338 | --[[ 339 | every frame export to hardware 340 | Example from A-10C 341 | Get Radio Frequencies 342 | get data from device 343 | local UHF_RADIO = GetDevice(54) 344 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 345 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 346 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 347 | 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)) 348 | ]] 349 | 350 | --===================================================================================== 351 | --[[ 352 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 353 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 354 | 355 | -- list_indication get tehe value of cockpit displays 356 | local ltmp1 = 0 357 | for ltmp2 = 0, 20, 1 do 358 | ltmp1 = list_indication(ltmp2) 359 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 360 | end 361 | ]] 362 | --[[ 363 | -- getmetatable get function name from devices 364 | local ltmp1 = 0 365 | for ltmp2 = 1, 70, 1 do 366 | ltmp1 = GetDevice(ltmp2) 367 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 368 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 369 | end 370 | ]] 371 | end 372 | 373 | ----------------------------- 374 | -- Custom functions -- 375 | ----------------------------- 376 | -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/MiG-29G.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/MiG-29G.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/P-51D-30-NA.lua: -------------------------------------------------------------------------------- 1 | -- P-51D-30-NA Export 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.P51D30NA = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- Flight Instruments 19 | [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} 20 | [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} 21 | -- Altimeter 22 | [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} 23 | [96] = "%.4f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} 24 | [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} 25 | [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} 26 | -- Artificial horizon 27 | [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} 28 | [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} 29 | [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} 30 | [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} 31 | -- directional gyro 32 | [12] = "%.4f", -- GyroHeading 33 | -- turn indicator 34 | [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} 35 | [28] = "%.4f", -- Slipball {-1.0, 1.0} 36 | -- oxygen pressure indicator 37 | [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} 38 | [33] = "%.4f", -- Oxygen_Flow_Blinker 39 | -- fuel system 40 | [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} 41 | [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} 42 | [160] = "%.4f", -- Fuel_Tank_Fuselage {0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0} {0.0,0.12,0.28,0.40,0.51,0.62,0.72,0.83,0.96,1.0} 43 | [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} 44 | -- A-11 clock 45 | [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} 46 | [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} 47 | [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} 48 | -- AN5730 remote compass 49 | [1] = "%.4f", -- CompassHeading 50 | [2] = "%.4f", -- CommandedCourse 51 | [3] = "%.4f", -- CommandedCourseKnob 52 | -- TailRadarWarning 53 | [161] = "%.f", -- Lamp TailRadarWarning 54 | -- SCR-522A Control panel 55 | [122] = "%.f", -- A_channel_light 56 | [123] = "%.f", -- B_channel_light 57 | [124] = "%.f", -- C_channel_light 58 | [125] = "%.f", -- D_channel_light 59 | [126] = "%.f", -- Transmit_light 60 | -- hydraulic pressure 61 | [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} 62 | -- Landing gears handle 63 | [150] = "%.4f", -- Landing_Gear_Handle 64 | [151] = "%.4f", -- Landing_Gear_Handle_Indoor 65 | [80] = "%.f", -- LandingGearGreenLight 66 | [82] = "%.f", -- LandingGearRedLight 67 | -- gauges 68 | [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} 69 | [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} 70 | [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} 71 | [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} 72 | [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} 73 | [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} 74 | [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} 75 | [164] = "%.1f", -- Left_Fluor_Light 76 | [165] = "%.1f", -- Right_Fluor_Light 77 | [59] = "%.f", -- Hight_Blower_Lamp 78 | -- Trimmer 79 | [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} 80 | [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} 81 | [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} 82 | [174] = "%.4f", -- Control_Lock_Bracket 83 | [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} 84 | [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} 85 | [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} 86 | [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} 87 | -- light 88 | [185] = "%.1f", -- Left_cockpit_light 89 | [186] = "%.1f", -- Right_cockpit_light 90 | [190] = "%.4f", -- warEmergencyPowerLimWire 91 | ------------- 92 | --[181] = "%.4f", -- Panel_Shake_Z 93 | --[180] = "%.4f", -- Panel_Shake_Y 94 | --[189] = "%.4f", -- Panel_Rot_X 95 | --[162] = "%.1f", -- Canopy_Trucks 96 | --[163] = "%.1f", -- Canopy_Visibility 97 | -- Stick 98 | --[50] = "%.4f", -- StickPitch 99 | --[51] = "%.4f", -- StickBank 100 | -- RudderPedals 101 | --[54] = "%.4f", -- RudderPedals 102 | --[55] = "%.4f", -- Left_Wheel_Brake 103 | --[56] = "%.4f", -- Right_Wheel_Brake 104 | -- K-14 gunsight 105 | [36] = "%.4f", -- sightRange 106 | --[188] = "%.4f", -- K_14_Shake_Z 107 | --[187] = "%.4f", -- K_14_Shake_Y 108 | ------------- 109 | --[45] = "%.4f", -- ThrottleTwistGrip 110 | ------------- 111 | [77] = "%.4f", -- Rocket_Counter 112 | ------------- 113 | --[413] = "%.1f", -- WindShieldDamages 114 | --[412] = "%.1f", -- WindShieldOil 115 | } 116 | 117 | ExportScript.ConfigArguments = 118 | { 119 | --[[ 120 | arguments for export in low tick interval 121 | based on "clickabledata.lua" 122 | ]] 123 | -- Right Swich Panel 124 | [102] = "%d", -- Generator Connect/Disconnect 125 | [103] = "%d", -- Battery Connect/Disconnect 126 | [104] = "%d", -- Gun Heating ON/OFF 127 | [105] = "%d", -- Pitot Heating ON/OFF 128 | [106] = "%d", -- Wing Position Lights Bright/Off/Dim 129 | [107] = "%d", -- Tail Position Lights Bright/Off/Dim 130 | [108] = "%d", -- Red Recognition Light Key/Off/Steady 131 | [109] = "%d", -- Green Recognition Light Key/Off/Steady 132 | [110] = "%d", -- Amber Recognition Light Key/Off/Steady 133 | [111] = "%d", -- Recognition Lights Key 134 | [112] = "%d", -- Circuit Protectors Reset 135 | [100] = "%.4f", -- Right Fluorescent Light (rotary) 136 | [90] = "%.4f", -- Left Fluorescent Light (rotary) 137 | -- Flight Instrument panel 138 | [3] = "%.4f", -- Course Set (rotary) 139 | [13] = "%.4f", -- Heading Set/Cage (rotary) 140 | [179] = "%d", -- Heading Set/Cage Button 141 | [17] = "%.4f", -- Pitch Adjustment (rotary) 142 | [18] = "%.4f", -- Cage (rotary) 143 | [19] = "%d", -- Cage Button 144 | [8] = "%d", -- Winding/Adjustment Clock Button 145 | [7] = "%.4f", -- Winding/Adjustment Clock (rotary) 146 | [26] = "%.4f", -- Set Pressure (rotary) 147 | -- SCR-522A Control panel 148 | [117] = "%d", -- Radio ON/OFF 149 | [118] = "%d", -- A Channel Activate 150 | [119] = "%d", -- B Channel Activate 151 | [120] = "%d", -- C Channel Activate 152 | [121] = "%d", -- D Channel Activate 153 | [127] = "%.4f", -- Radio Lights Dimmer (rotary) 154 | [116] = "%.4f", -- Radio Audio Volume (rotary) 155 | [44] = "%d", -- Microphone On 156 | [200] = "%d", -- Arm rest 157 | [129] = "%d", -- Switch Locking Lever 158 | [128] = "%d", -- Radio Mode Transmit/Receive/Remote 159 | ------------- 160 | [71] = "%.4f", -- Cockpit Lights (rotary) 161 | [66] = "%0.1f", -- Ignition Off/Right/Left/Both 162 | [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On 163 | [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off 164 | -- Bomb Arm/Chemical 165 | [69] = "%d", -- Left Bomb Arm/Chemical 166 | [70] = "%d", -- Right Bomb Arm/Chemical 167 | -- Release Mode 168 | [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm 169 | [73] = "%0.1f", -- Rockets Release Mode Off/Single/Auto 170 | [74] = "%d", -- Rockets Delay Switch Delay/Int 171 | [75] = "%0.4f", -- Rockets Counter Control 172 | -- Engine Control Panel 173 | [58] = "%d", -- Supercharger Switch Cover 174 | [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH 175 | [60] = "%d", -- High Blower Lamp Test 176 | [61] = "%d", -- Fuel Booster On/Off 177 | [62] = "%d", -- Oil Dilute Activate 178 | [63] = "%d", -- Starter Activate 179 | [64] = "%d", -- Starter Switch Cover 180 | [65] = "%d", -- Primer Activate 181 | -- Oxygen Regulator 182 | [131] = "%d", -- Auto-Mix On-Off 183 | [130] = "%0.4f", -- Oxygen Emergency By-pass 184 | -- Fuel system 185 | [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank 186 | [86] = "%d", -- Fuel Shut-Off Valve ON/OFF 187 | -- AN/APS-13 188 | [114] = "%d", -- ail Warning Radar Power ON/OFF 189 | [115] = "%d", -- Tail Warning Radar Test 190 | [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) 191 | ------------- 192 | [79] = "%d", -- Hydraulic Release Knob 193 | [94] = "%.4f", -- Flaps Control Handle (rotary) 194 | [84] = "%d", -- Parking Brake Handle 195 | [81] = "%d", -- Safe Landing Gear Light Test 196 | [83] = "%d", -- Unsafe Landing Gear Light Test 197 | -- Detrola receiver 198 | [137] = "%.4f", -- Detrola Frequency Selector (rotary) 199 | [138] = "%.4f", -- Detrola Volume (rotary) 200 | -- canopy 201 | [147] = "%.4f", -- Canopy Hand Crank (rotary) 202 | [149] = "%d", -- Canopy Emergency Release Handle 203 | -- AN/ARA-8 204 | [152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING 205 | [153] = "%d", -- Homing Adapter Power On/Off 206 | [154] = "%d", -- Homing Adapter's Circuit Breaker 207 | -- SCR-695 208 | [139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 209 | [140] = "%d", -- IFF Power On/Off 210 | [141] = "%d", -- IFF TIME/OFF/ON 211 | [142] = "%d", -- IFF Detonator Circuit On/Off 212 | [143] = "%d", -- IFF Distress Signal On/Off 213 | [145] = "%d", -- IFF Detonator Left 214 | [146] = "%d", -- IFF Detonator Right 215 | -- Trimmers 216 | [91] = "%.4f", -- Aileron Trim (rotary) 217 | [92] = "%.4f", -- Elevator Trim (rotary) 218 | [93] = "%.4f", -- Rudder Trim (rotary) 219 | ------------- 220 | [157] = "%.4f", -- Defroster (rotary) 221 | [158] = "%.4f", -- Cold Air (rotary) 222 | [159] = "%.4f", -- Hot Air (rotary) 223 | ------------- 224 | [89] = "%d", -- Landing Light On/Off 225 | [168] = "%d", -- Coolant Control Cover 226 | [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control 227 | [169] = "%d", -- Oil Control Cover 228 | [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control 229 | [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) 230 | [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) 231 | [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH 232 | [43] = "%.4f", -- Throttle (rotary) 233 | [46] = "%.4f", -- Propeller RPM (rotary) 234 | [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position 235 | [48] = "%.4f", -- Lock Throttle (rotary) 236 | [49] = "%.4f", -- Lock Propeller & Mixture (rotary) 237 | [176] = "%d", -- G-meter reset 238 | [183] = "%d", -- Mirror 239 | } 240 | 241 | ----------------------------- 242 | -- HIGH IMPORTANCE EXPORTS -- 243 | -- done every export event -- 244 | ----------------------------- 245 | 246 | -- Pointed to by ProcessIkarusDCSHighImportance 247 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 248 | --[[ 249 | every frame export to Ikarus 250 | Example from A-10C 251 | Get Radio Frequencies 252 | get data from device 253 | local lUHFRadio = GetDevice(54) 254 | ExportScript.Tools.SendData("ExportID", "Format") 255 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 256 | 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)) 257 | ]] 258 | end 259 | 260 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 261 | --[[ 262 | every frame export to DAC 263 | Example from A-10C 264 | Get Radio Frequencies 265 | get data from device 266 | local UHF_RADIO = GetDevice(54) 267 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 268 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 269 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 270 | 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)) 271 | ]] 272 | end 273 | 274 | ----------------------------------------------------- 275 | -- LOW IMPORTANCE EXPORTS -- 276 | -- done every gExportLowTickInterval export events -- 277 | ----------------------------------------------------- 278 | 279 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 280 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 281 | --[[ 282 | export in low tick interval to Ikarus 283 | Example from A-10C 284 | Get Radio Frequencies 285 | get data from device 286 | local lUHFRadio = GetDevice(54) 287 | ExportScript.Tools.SendData("ExportID", "Format") 288 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 289 | 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)) 290 | ]] 291 | end 292 | 293 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 294 | --[[ 295 | every frame export to hardware 296 | Example from A-10C 297 | Get Radio Frequencies 298 | get data from device 299 | local UHF_RADIO = GetDevice(54) 300 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 301 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 302 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 303 | 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)) 304 | ]] 305 | 306 | --===================================================================================== 307 | --[[ 308 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 309 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 310 | 311 | -- list_indication get tehe value of cockpit displays 312 | local ltmp1 = 0 313 | for ltmp2 = 0, 20, 1 do 314 | ltmp1 = list_indication(ltmp2) 315 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 316 | end 317 | ]] 318 | --[[ 319 | -- getmetatable get function name from devices 320 | local ltmp1 = 0 321 | for ltmp2 = 1, 70, 1 do 322 | ltmp1 = GetDevice(ltmp2) 323 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 324 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 325 | end 326 | ]] 327 | end 328 | 329 | ----------------------------- 330 | -- Custom functions -- 331 | ----------------------------- 332 | -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/P-51D.lua: -------------------------------------------------------------------------------- 1 | -- P-51D-25-NA Export 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.P51D25NA = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- Flight Instruments 19 | [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} 20 | [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} 21 | -- Altimeter 22 | [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} 23 | [96] = "%.4f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} 24 | [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} 25 | [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} 26 | -- Artificial horizon 27 | [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} 28 | [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} 29 | [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} 30 | [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} 31 | -- directional gyro 32 | [12] = "%.4f", -- GyroHeading 33 | -- turn indicator 34 | [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} 35 | [28] = "%.4f", -- Slipball {-1.0, 1.0} 36 | -- oxygen pressure indicator 37 | [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} 38 | [33] = "%.4f", -- Oxygen_Flow_Blinker 39 | -- fuel system 40 | [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} 41 | [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} 42 | [160] = "%.4f", -- Fuel_Tank_Fuselage {0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0} {0.0,0.12,0.28,0.40,0.51,0.62,0.72,0.83,0.96,1.0} 43 | [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} 44 | -- A-11 clock 45 | [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} 46 | [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} 47 | [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} 48 | -- AN5730 remote compass 49 | [1] = "%.4f", -- CompassHeading 50 | [2] = "%.4f", -- CommandedCourse 51 | [3] = "%.4f", -- CommandedCourseKnob 52 | -- TailRadarWarning 53 | [161] = "%.f", -- Lamp TailRadarWarning 54 | -- SCR-522A Control panel 55 | [122] = "%.f", -- A_channel_light 56 | [123] = "%.f", -- B_channel_light 57 | [124] = "%.f", -- C_channel_light 58 | [125] = "%.f", -- D_channel_light 59 | [126] = "%.f", -- Transmit_light 60 | -- hydraulic pressure 61 | [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} 62 | -- Landing gears handle 63 | [150] = "%.4f", -- Landing_Gear_Handle 64 | [151] = "%.4f", -- Landing_Gear_Handle_Indoor 65 | [80] = "%.f", -- LandingGearGreenLight 66 | [82] = "%.f", -- LandingGearRedLight 67 | -- gauges 68 | [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} 69 | [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} 70 | [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} 71 | [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} 72 | [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} 73 | [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} 74 | [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} 75 | [164] = "%.1f", -- Left_Fluor_Light 76 | [165] = "%.1f", -- Right_Fluor_Light 77 | [59] = "%.f", -- Hight_Blower_Lamp 78 | -- Trimmer 79 | [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} 80 | [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} 81 | [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} 82 | [174] = "%.4f", -- Control_Lock_Bracket 83 | [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} 84 | [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} 85 | [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} 86 | [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} 87 | -- light 88 | [185] = "%.1f", -- Left_cockpit_light 89 | [186] = "%.1f", -- Right_cockpit_light 90 | [190] = "%.4f", -- warEmergencyPowerLimWire 91 | ------------- 92 | --[181] = "%.4f", -- Panel_Shake_Z 93 | --[180] = "%.4f", -- Panel_Shake_Y 94 | --[189] = "%.4f", -- Panel_Rot_X 95 | --[162] = "%.1f", -- Canopy_Trucks 96 | --[163] = "%.1f", -- Canopy_Visibility 97 | -- Stick 98 | --[50] = "%.4f", -- StickPitch 99 | --[51] = "%.4f", -- StickBank 100 | -- RudderPedals 101 | --[54] = "%.4f", -- RudderPedals 102 | --[55] = "%.4f", -- Left_Wheel_Brake 103 | --[56] = "%.4f", -- Right_Wheel_Brake 104 | -- K-14 gunsight 105 | [36] = "%.4f", -- sightRange 106 | --[188] = "%.4f", -- K_14_Shake_Z 107 | --[187] = "%.4f", -- K_14_Shake_Y 108 | ------------- 109 | --[45] = "%.4f", -- ThrottleTwistGrip 110 | ------------- 111 | [77] = "%.4f", -- Rocket_Counter 112 | ------------- 113 | --[413] = "%.1f", -- WindShieldDamages 114 | --[412] = "%.1f", -- WindShieldOil 115 | } 116 | 117 | ExportScript.ConfigArguments = 118 | { 119 | --[[ 120 | arguments for export in low tick interval 121 | based on "clickabledata.lua" 122 | ]] 123 | -- Right Swich Panel 124 | [102] = "%d", -- Generator Connect/Disconnect 125 | [103] = "%d", -- Battery Connect/Disconnect 126 | [104] = "%d", -- Gun Heating ON/OFF 127 | [105] = "%d", -- Pitot Heating ON/OFF 128 | [106] = "%d", -- Wing Position Lights Bright/Off/Dim 129 | [107] = "%d", -- Tail Position Lights Bright/Off/Dim 130 | [108] = "%d", -- Red Recognition Light Key/Off/Steady 131 | [109] = "%d", -- Green Recognition Light Key/Off/Steady 132 | [110] = "%d", -- Amber Recognition Light Key/Off/Steady 133 | [111] = "%d", -- Recognition Lights Key 134 | [112] = "%d", -- Circuit Protectors Reset 135 | [100] = "%.4f", -- Right Fluorescent Light (rotary) 136 | [90] = "%.4f", -- Left Fluorescent Light (rotary) 137 | -- Flight Instrument panel 138 | [3] = "%.4f", -- Course Set (rotary) 139 | [13] = "%.4f", -- Heading Set/Cage (rotary) 140 | [179] = "%d", -- Heading Set/Cage Button 141 | [17] = "%.4f", -- Pitch Adjustment (rotary) 142 | [18] = "%.4f", -- Cage (rotary) 143 | [19] = "%d", -- Cage Button 144 | [8] = "%d", -- Winding/Adjustment Clock Button 145 | [7] = "%.4f", -- Winding/Adjustment Clock (rotary) 146 | [26] = "%.4f", -- Set Pressure (rotary) 147 | -- SCR-522A Control panel 148 | [117] = "%d", -- Radio ON/OFF 149 | [118] = "%d", -- A Channel Activate 150 | [119] = "%d", -- B Channel Activate 151 | [120] = "%d", -- C Channel Activate 152 | [121] = "%d", -- D Channel Activate 153 | [127] = "%.4f", -- Radio Lights Dimmer (rotary) 154 | [116] = "%.4f", -- Radio Audio Volume (rotary) 155 | [44] = "%d", -- Microphone On 156 | [200] = "%d", -- Arm rest 157 | [129] = "%d", -- Switch Locking Lever 158 | [128] = "%d", -- Radio Mode Transmit/Receive/Remote 159 | ------------- 160 | [71] = "%.4f", -- Cockpit Lights (rotary) 161 | [66] = "%0.1f", -- Ignition Off/Right/Left/Both 162 | [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On 163 | [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off 164 | -- Bomb Arm/Chemical 165 | [69] = "%d", -- Left Bomb Arm/Chemical 166 | [70] = "%d", -- Right Bomb Arm/Chemical 167 | -- Release Mode 168 | [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm 169 | [73] = "%0.1f", -- Rockets Release Mode Off/Single/Auto 170 | [74] = "%d", -- Rockets Delay Switch Delay/Int 171 | [75] = "%0.4f", -- Rockets Counter Control 172 | -- Engine Control Panel 173 | [58] = "%d", -- Supercharger Switch Cover 174 | [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH 175 | [60] = "%d", -- High Blower Lamp Test 176 | [61] = "%d", -- Fuel Booster On/Off 177 | [62] = "%d", -- Oil Dilute Activate 178 | [63] = "%d", -- Starter Activate 179 | [64] = "%d", -- Starter Switch Cover 180 | [65] = "%d", -- Primer Activate 181 | -- Oxygen Regulator 182 | [131] = "%d", -- Auto-Mix On-Off 183 | [130] = "%0.4f", -- Oxygen Emergency By-pass 184 | -- Fuel system 185 | [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank 186 | [86] = "%d", -- Fuel Shut-Off Valve ON/OFF 187 | -- AN/APS-13 188 | [114] = "%d", -- ail Warning Radar Power ON/OFF 189 | [115] = "%d", -- Tail Warning Radar Test 190 | [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) 191 | ------------- 192 | [79] = "%d", -- Hydraulic Release Knob 193 | [94] = "%.4f", -- Flaps Control Handle (rotary) 194 | [84] = "%d", -- Parking Brake Handle 195 | [81] = "%d", -- Safe Landing Gear Light Test 196 | [83] = "%d", -- Unsafe Landing Gear Light Test 197 | -- Detrola receiver 198 | [137] = "%.4f", -- Detrola Frequency Selector (rotary) 199 | [138] = "%.4f", -- Detrola Volume (rotary) 200 | -- canopy 201 | [147] = "%.4f", -- Canopy Hand Crank (rotary) 202 | [149] = "%d", -- Canopy Emergency Release Handle 203 | -- AN/ARA-8 204 | --[152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING 205 | --[153] = "%d", -- Homing Adapter Power On/Off 206 | --[154] = "%d", -- Homing Adapter's Circuit Breaker 207 | -- SCR-695 208 | --[139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 209 | --[140] = "%d", -- IFF Power On/Off 210 | --[141] = "%d", -- IFF TIME/OFF/ON 211 | --[142] = "%d", -- IFF Detonator Circuit On/Off 212 | --[143] = "%d", -- IFF Distress Signal On/Off 213 | --[145] = "%d", -- IFF Detonator Left 214 | --[146] = "%d", -- IFF Detonator Right 215 | -- Trimmers 216 | [91] = "%.4f", -- Aileron Trim (rotary) 217 | [92] = "%.4f", -- Elevator Trim (rotary) 218 | [93] = "%.4f", -- Rudder Trim (rotary) 219 | ------------- 220 | [157] = "%.4f", -- Defroster (rotary) 221 | [158] = "%.4f", -- Cold Air (rotary) 222 | [159] = "%.4f", -- Hot Air (rotary) 223 | ------------- 224 | [89] = "%d", -- Landing Light On/Off 225 | [168] = "%d", -- Coolant Control Cover 226 | [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control 227 | [169] = "%d", -- Oil Control Cover 228 | [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control 229 | [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) 230 | [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) 231 | [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH 232 | [43] = "%.4f", -- Throttle (rotary) 233 | [46] = "%.4f", -- Propeller RPM (rotary) 234 | [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position 235 | [48] = "%.4f", -- Lock Throttle (rotary) 236 | [49] = "%.4f", -- Lock Propeller & Mixture (rotary) 237 | [176] = "%d", -- G-meter reset 238 | [183] = "%d", -- Mirror 239 | } 240 | 241 | ----------------------------- 242 | -- HIGH IMPORTANCE EXPORTS -- 243 | -- done every export event -- 244 | ----------------------------- 245 | 246 | -- Pointed to by ProcessIkarusDCSHighImportance 247 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 248 | --[[ 249 | every frame export to Ikarus 250 | Example from A-10C 251 | Get Radio Frequencies 252 | get data from device 253 | local lUHFRadio = GetDevice(54) 254 | ExportScript.Tools.SendData("ExportID", "Format") 255 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 256 | 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)) 257 | ]] 258 | end 259 | 260 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 261 | --[[ 262 | every frame export to DAC 263 | Example from A-10C 264 | Get Radio Frequencies 265 | get data from device 266 | local UHF_RADIO = GetDevice(54) 267 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 268 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 269 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 270 | 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)) 271 | ]] 272 | end 273 | 274 | ----------------------------------------------------- 275 | -- LOW IMPORTANCE EXPORTS -- 276 | -- done every gExportLowTickInterval export events -- 277 | ----------------------------------------------------- 278 | 279 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 280 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 281 | --[[ 282 | export in low tick interval to Ikarus 283 | Example from A-10C 284 | Get Radio Frequencies 285 | get data from device 286 | local lUHFRadio = GetDevice(54) 287 | ExportScript.Tools.SendData("ExportID", "Format") 288 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 289 | 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)) 290 | ]] 291 | end 292 | 293 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 294 | --[[ 295 | every frame export to hardware 296 | Example from A-10C 297 | Get Radio Frequencies 298 | get data from device 299 | local UHF_RADIO = GetDevice(54) 300 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 301 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 302 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 303 | 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)) 304 | ]] 305 | 306 | --===================================================================================== 307 | --[[ 308 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 309 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 310 | 311 | -- list_indication get tehe value of cockpit displays 312 | local ltmp1 = 0 313 | for ltmp2 = 0, 20, 1 do 314 | ltmp1 = list_indication(ltmp2) 315 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 316 | end 317 | ]] 318 | --[[ 319 | -- getmetatable get function name from devices 320 | local ltmp1 = 0 321 | for ltmp2 = 1, 70, 1 do 322 | ltmp1 = GetDevice(ltmp2) 323 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 324 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 325 | end 326 | ]] 327 | end 328 | 329 | ----------------------------- 330 | -- Custom functions -- 331 | ----------------------------- 332 | -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIX.lua: -------------------------------------------------------------------------------- 1 | -- Spitfire LFMk IX 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.SpitfireLFMkIX = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- Flight Instruments 19 | [11] = "%.4f", -- OxygenDeliveryGauge {0.0, 0.4}{0.0, 4000.0} 20 | [12] = "%.4f", -- OxygenSupplyGauge 21 | [17] = "%.4f", -- TrimGauge {-1.0, 1.0} 22 | [18] = "%.4f", -- PneumaticPressureGauge {0.0, 1.0}{0.0, 600.0} 23 | [19] = "%.4f", -- Left wheel brake pressure gauge {0.0, 1.0}{0.0, 130.0} 24 | [20] = "%.4f", -- Right wheel brake pressure gauge {0.0, 1.0}{0.0, 130.0} 25 | [21] = "%.4f", -- Airspeed gauge {0.0, 0.5}{0.0, 500.0} 26 | [23] = "%.4f", -- Attitude Horizon Bank {-1.0, 1.0} 27 | [24] = "%.4f", -- Attitude Horizon Pitch {-1.0, 1.0} 28 | [25] = "%.4f", -- Variometer gauge {-1.0, 1.0}{-4000.0, 4000.0} 29 | [26] = "%.4f", -- Altimeter gauge Hundreds {0.0, 1.0}{0.0, 10.0} 30 | [27] = "%.4f", -- Altimeter gauge Thousands {0.0, 1.0}{0.0, 10.0} 31 | [28] = "%.4f", -- Altimeter gauge Tens Thousabds {0.0, 1.0}{0.0, 10.0} 32 | [29] = "%.4f", -- Altimeter gauge Pressure {0.0, 1.0}{800.0, 1050.0} 33 | [31] = "%.4f", -- DI gauge {0.0, 1.0}{0.0, 2.0 * 3.1415926} 34 | [33] = "%.4f", -- Sideslip gauge {-1.0, 1.0} 35 | [34] = "%.4f", -- Turn gauge {-1.0, 1.0} 36 | [35] = "%.4f", -- Voltmeter {0.0, 1.0}{0.0, 20.0} 37 | [37] = "%.4f", -- Tachometer {0.0, 0.5}{0.0, 5000.0} 38 | [39] = "%.4f", -- Boost gauge {0.0, 1.0}{-7.0, 24.0} 39 | [40] = "%.4f", -- Oil pressure gauge {0.0, 1.0}{0.0, 150.0} 40 | [41] = "%.4f", -- Oil temperature gauge {0.0, 1.0}{0.0, 100.0} 41 | [42] = "%.4f", -- Radiator temperature gauge {0.0, 0.7}{0.0, 140.0} 42 | [43] = "%.4f", -- Fuel contents gauge {0.0, 0.1, 1.0}{-1.0, 0.0, 37.0} 43 | [51] = "%.4f", -- Clock Hour 44 | [52] = "%.4f", -- Clock Minute 45 | [53] = "%.4f", -- Clock Second 46 | [71] = "%.4f", -- Magnetic compass CompassRoseRoll {-1.0, 1.0}{-20.0, 20.0} 47 | [72] = "%.4f", -- Magnetic compass CompassRosePitch {-1.0, 1.0}{-20.0, 20.0} 48 | [73] = "%.4f", -- Magnetic compass CompassHeading{0.0, 1.0} 49 | [120] = "%1d", -- Radio Lamp A 50 | [121] = "%1d", -- Radio Lamp B 51 | [122] = "%1d", -- Radio Lamp C 52 | [123] = "%1d", -- Radio Lamp D 53 | [124] = "%1d", -- Radio Lamp R 54 | --[131] = "%1d", -- UC_DOWN_C ??? 55 | [49] = "%1d", -- Gear Lamp Down 56 | [48] = "%1d", -- Gear Lamp Up 57 | --[62] = "%.4f", -- ??? 58 | --[63] = "%.4f", -- ??? 59 | --[59] = "%.4f", -- ??? 60 | --[45] = "%.4f" -- GUNSIGHT_RANGE ??? 61 | } 62 | ExportScript.ConfigArguments = 63 | { 64 | --[[ 65 | arguments for export in low tick interval 66 | based on "clickabledata.lua" 67 | ]] 68 | [13] = "%1d", -- Oxygen Apparatus Controls Valve 69 | -- Main Panel 70 | [30] = "%.1f", -- Altimeter (Axis) {0.0, 1.0} in 0.1 Steps 71 | [32] = "%.1f", -- DI (Axis) {0.0, 1.0} in 0.1 Steps 72 | [44] = "%1d", -- Fuel Gauge Button 73 | [46] = "%1d", -- Nav. Lights Toggle 74 | [47] = "%1d", -- Flaps Lever 75 | [50] = "%1d", -- U/C Indicator Blind 76 | [54] = "%1d", -- Clock Setter Pinion 77 | [55] = "%.1f", -- Clock Setter Pinion (Axis) {0.0, 1.0} in 0.1 Steps 78 | [56] = "%1d", -- Magnetos Toggles 1 79 | [57] = "%1d", -- Magnetos Toggles 2 80 | [58] = "%1d", -- Supercharger Mode Toggle 81 | [60] = "%.1f", -- Illumination Controls Left (Axis) {0.0, 1.0} in 0.1 Steps 82 | [61] = "%.1f", -- Illumination Controls Right (Axis) {0.0, 1.0} in 0.1 Steps 83 | [65] = "%1d", -- Starter Button 84 | [67] = "%1d", -- Booster Coil Button 85 | [69] = "%1d", -- Primer Pump 86 | [68] = "%.2f", -- Primer Pump (Axis) {0.0, 1.0} in 0.04 Steps 87 | [70] = "%1d", -- Tank Pressurizer Lever 88 | [74] = "%.4f", -- Magnetic Compass Ring (Axis) {0.0, 1.0} in 0.0333 Steps 89 | -- Gun Sight and Tertiary Weapons Controls 90 | [77] = "%.2f", -- Gun Sight Setter Rings Range (Axis) {0.0, 1.0} in 0.15 Steps 91 | [78] = "%.2f", -- Gun Sight Setter Rings Base (Axis) {0.0, 1.0} in 0.15 Steps 92 | [79] = "%1d", -- Gun Sight Tint Screen 93 | [80] = "%1d", -- Gun Sight Master Switch 94 | [81] = "%.1f", -- Gun Sight Dimmer (Axis) {0.0, 1.0} in 0.1 Steps 95 | -- Port Wall 96 | [145] = "%.2f", -- Elevator Trim Wheel (Axis) {-1.0, 1.0} in 0.01 Steps 97 | [146] = "%.1f", -- Rudder Trim Wheel (Axis) {-1.0, 1.0} in 0.1 Steps 98 | -- Radio Remote Channel Switcher 99 | [115] = "%1d", -- Off Button 100 | [116] = "%1d", -- A Button 101 | [117] = "%1d", -- B Button 102 | [118] = "%1d", -- C Button 103 | [119] = "%1d", -- D Button 104 | [125] = "%1d", -- Dimmer Toggle 105 | [155] = "%1d", -- Transmit Lock Toggle 106 | [156] = "%1d", -- Mode Selector 107 | -- Throttle Quadrant 108 | [126] = "%.1f", -- Throttle Lever (Axis) {-1.0, 1.0} in 0.1 Steps 109 | [128] = "%1d", -- Bomb Drop Button 110 | [129] = "%.1f", -- Airscrew Lever (Axis) {-1.0, 1.0} in 0.1 Steps 111 | [130] = "%1d", -- Mix Cut-Off Lever 112 | [131] = "%1d", -- U/C Indicator Cut-Off Toggle 113 | -- 114 | [133] = "%1d", -- Radiator Control Toggle 115 | [134] = "%1d", -- Pitot Heater Toggle 116 | [135] = "%1d", -- Fuel Pump Toggle 117 | [137] = "%1d", -- Carb. Air Control Lever 118 | [158] = "%1d", -- Oil Diluter Button 119 | [160] = "%1d", -- Supercharger Mode Test Button 120 | [162] = "%1d", -- Radiator Flap Test Button 121 | -- Stbd. Wall 122 | [87] = "%1d", -- De-Icer Lever 123 | [88] = "%1d", -- U/C Emergency Release Lever 124 | [90] = "%1d", -- Wobble Type Fuel Pump 125 | -- Wobble Type Fuel Pump 126 | [92] = "%.1f", -- Upward Lamp Mode Selector {0.0,0.5,1.0} 127 | [93] = "%.1f", -- Downward Lamp Mode Selector {0.0,0.5,1.0} 128 | [94] = "%1d", -- Morse Key 129 | -- 130 | [148] = "%1d", -- U/C Lever 131 | -- I.F.F. Control Box 132 | [106] = "%1d", -- I.F.F. Upper Toggle (Type B) 133 | [107] = "%1d", -- I.F.F. Lower Toggle (Type D) 134 | [109] = "%1d", -- I.F.F. Fore Button (0) 135 | [110] = "%1d", -- I.F.F. Aft Button (1) 136 | -- Fuel Cocks & Tertiary 137 | [100] = "%1d", -- Fuel Cock 138 | [98] = "%1d", -- Droptank Cock 139 | [99] = "%1d", -- Droptank Release Handle 140 | -- Canopy Controls 141 | [149] = "%1d", -- Cockpit Open/Close Control 142 | [140] = "%1d", -- Cockpit Jettison Pull Ball 143 | [147] = "%1d" -- Cockpit Side Door Open/Close Control 144 | } 145 | 146 | ----------------------------- 147 | -- HIGH IMPORTANCE EXPORTS -- 148 | -- done every export event -- 149 | ----------------------------- 150 | 151 | -- Pointed to by ProcessIkarusDCSHighImportance 152 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 153 | --[[ 154 | every frame export to Ikarus 155 | Example from A-10C 156 | Get Radio Frequencies 157 | get data from device 158 | local lUHFRadio = GetDevice(54) 159 | ExportScript.Tools.SendData("ExportID", "Format") 160 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 161 | 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)) 162 | ]] 163 | end 164 | 165 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 166 | --[[ 167 | every frame export to DAC 168 | Example from A-10C 169 | Get Radio Frequencies 170 | get data from device 171 | local UHF_RADIO = GetDevice(54) 172 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 173 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 174 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 175 | 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)) 176 | ]] 177 | end 178 | 179 | ----------------------------------------------------- 180 | -- LOW IMPORTANCE EXPORTS -- 181 | -- done every gExportLowTickInterval export events -- 182 | ----------------------------------------------------- 183 | 184 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 185 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 186 | --[[ 187 | export in low tick interval to Ikarus 188 | Example from A-10C 189 | Get Radio Frequencies 190 | get data from device 191 | local lUHFRadio = GetDevice(54) 192 | ExportScript.Tools.SendData("ExportID", "Format") 193 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 194 | 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)) 195 | ]] 196 | -- Cockpit Light 197 | ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {163, 62, 63}) 198 | -- Gauges light, left panel light, right panel light 199 | end 200 | 201 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 202 | --[[ 203 | export in low tick interval to DAC 204 | Example from A-10C 205 | Get Radio Frequencies 206 | get data from device 207 | local UHF_RADIO = GetDevice(54) 208 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 209 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 210 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 211 | 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)) 212 | ]] 213 | 214 | --===================================================================================== 215 | --[[ 216 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 217 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 218 | 219 | -- list_indication get tehe value of cockpit displays 220 | local ltmp1 = 0 221 | for ltmp2 = 0, 20, 1 do 222 | ltmp1 = list_indication(ltmp2) 223 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 224 | end 225 | ]] 226 | --[[ 227 | -- getmetatable get function name from devices 228 | local ltmp1 = 0 229 | for ltmp2 = 1, 70, 1 do 230 | ltmp1 = GetDevice(ltmp2) 231 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 232 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 233 | end 234 | ]] 235 | 236 | -- VHF_Radio 237 | local lVHF_Radio = GetDevice(15) 238 | if lVHF_Radio:is_on() then 239 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lVHF_Radio:get_frequency()/1000000)) 240 | ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy(lVHF_Radio:get_frequency()/1000000)) 241 | else 242 | ExportScript.Tools.SendDataDAC("2000", " ") 243 | end 244 | 245 | --[[ 246 | [115] = "%1d", -- Off Button 247 | [116] = "%1d", -- A Button 248 | [117] = "%1d", -- B Button 249 | [118] = "%1d", -- C Button 250 | [119] = "%1d", -- D Button]] 251 | local lVHF_Radio_PRESET = "" 252 | if mainPanelDevice:get_argument_value(116) > 0.8 then 253 | lVHF_Radio_PRESET = 1 254 | elseif mainPanelDevice:get_argument_value(117) > 0.8 then 255 | lVHF_Radio_PRESET = 2 256 | elseif mainPanelDevice:get_argument_value(118) > 0.8 then 257 | lVHF_Radio_PRESET = 3 258 | elseif mainPanelDevice:get_argument_value(119) > 0.8 then 259 | lVHF_Radio_PRESET = 4 260 | else 261 | lVHF_Radio_PRESET = "" 262 | end 263 | ExportScript.Tools.SendDataDAC("2001", lVHF_Radio_PRESET) 264 | end 265 | 266 | ----------------------------- 267 | -- Custom functions -- 268 | ----------------------------- -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/SpitfireLFMkIXCW.lua: -------------------------------------------------------------------------------- 1 | -- Spitfire LFMk IX CW 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.SpitfireLFMkIXCW = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- Flight Instruments 19 | [11] = "%.4f", -- OxygenDeliveryGauge {0.0, 0.4}{0.0, 4000.0} 20 | [12] = "%.4f", -- OxygenSupplyGauge 21 | [17] = "%.4f", -- TrimGauge {-1.0, 1.0} 22 | [18] = "%.4f", -- PneumaticPressureGauge {0.0, 1.0}{0.0, 600.0} 23 | [19] = "%.4f", -- Left wheel brake pressure gauge {0.0, 1.0}{0.0, 130.0} 24 | [20] = "%.4f", -- Right wheel brake pressure gauge {0.0, 1.0}{0.0, 130.0} 25 | [21] = "%.4f", -- Airspeed gauge {0.0, 0.5}{0.0, 500.0} 26 | [23] = "%.4f", -- Attitude Horizon Bank {-1.0, 1.0} 27 | [24] = "%.4f", -- Attitude Horizon Pitch {-1.0, 1.0} 28 | [25] = "%.4f", -- Variometer gauge {-1.0, 1.0}{-4000.0, 4000.0} 29 | [26] = "%.4f", -- Altimeter gauge Hundreds {0.0, 1.0}{0.0, 10.0} 30 | [27] = "%.4f", -- Altimeter gauge Thousands {0.0, 1.0}{0.0, 10.0} 31 | [28] = "%.4f", -- Altimeter gauge Tens Thousabds {0.0, 1.0}{0.0, 10.0} 32 | [29] = "%.4f", -- Altimeter gauge Pressure {0.0, 1.0}{800.0, 1050.0} 33 | [31] = "%.4f", -- DI gauge {0.0, 1.0}{0.0, 2.0 * 3.1415926} 34 | [33] = "%.4f", -- Sideslip gauge {-1.0, 1.0} 35 | [34] = "%.4f", -- Turn gauge {-1.0, 1.0} 36 | [35] = "%.4f", -- Voltmeter {0.0, 1.0}{0.0, 20.0} 37 | [37] = "%.4f", -- Tachometer {0.0, 0.5}{0.0, 5000.0} 38 | [39] = "%.4f", -- Boost gauge {0.0, 1.0}{-7.0, 24.0} 39 | [40] = "%.4f", -- Oil pressure gauge {0.0, 1.0}{0.0, 150.0} 40 | [41] = "%.4f", -- Oil temperature gauge {0.0, 1.0}{0.0, 100.0} 41 | [42] = "%.4f", -- Radiator temperature gauge {0.0, 0.7}{0.0, 140.0} 42 | [43] = "%.4f", -- Fuel contents gauge {0.0, 0.1, 1.0}{-1.0, 0.0, 37.0} 43 | [51] = "%.4f", -- Clock Hour 44 | [52] = "%.4f", -- Clock Minute 45 | [53] = "%.4f", -- Clock Second 46 | [71] = "%.4f", -- Magnetic compass CompassRoseRoll {-1.0, 1.0}{-20.0, 20.0} 47 | [72] = "%.4f", -- Magnetic compass CompassRosePitch {-1.0, 1.0}{-20.0, 20.0} 48 | [73] = "%.4f", -- Magnetic compass CompassHeading{0.0, 1.0} 49 | [120] = "%1d", -- Radio Lamp A 50 | [121] = "%1d", -- Radio Lamp B 51 | [122] = "%1d", -- Radio Lamp C 52 | [123] = "%1d", -- Radio Lamp D 53 | [124] = "%1d", -- Radio Lamp R 54 | --[131] = "%1d", -- UC_DOWN_C ??? 55 | [49] = "%1d", -- Gear Lamp Down 56 | [48] = "%1d", -- Gear Lamp Up 57 | --[62] = "%.4f", -- ??? 58 | --[63] = "%.4f", -- ??? 59 | --[59] = "%.4f", -- ??? 60 | --[45] = "%.4f" -- GUNSIGHT_RANGE ??? 61 | } 62 | ExportScript.ConfigArguments = 63 | { 64 | --[[ 65 | arguments for export in low tick interval 66 | based on "clickabledata.lua" 67 | ]] 68 | [13] = "%1d", -- Oxygen Apparatus Controls Valve 69 | -- Main Panel 70 | [30] = "%.1f", -- Altimeter (Axis) {0.0, 1.0} in 0.1 Steps 71 | [32] = "%.1f", -- DI (Axis) {0.0, 1.0} in 0.1 Steps 72 | [44] = "%1d", -- Fuel Gauge Button 73 | [46] = "%1d", -- Nav. Lights Toggle 74 | [47] = "%1d", -- Flaps Lever 75 | [50] = "%1d", -- U/C Indicator Blind 76 | [54] = "%1d", -- Clock Setter Pinion 77 | [55] = "%.1f", -- Clock Setter Pinion (Axis) {0.0, 1.0} in 0.1 Steps 78 | [56] = "%1d", -- Magnetos Toggles 1 79 | [57] = "%1d", -- Magnetos Toggles 2 80 | [58] = "%1d", -- Supercharger Mode Toggle 81 | [60] = "%.1f", -- Illumination Controls Left (Axis) {0.0, 1.0} in 0.1 Steps 82 | [61] = "%.1f", -- Illumination Controls Right (Axis) {0.0, 1.0} in 0.1 Steps 83 | [65] = "%1d", -- Starter Button 84 | [67] = "%1d", -- Booster Coil Button 85 | [69] = "%1d", -- Primer Pump 86 | [68] = "%.2f", -- Primer Pump (Axis) {0.0, 1.0} in 0.04 Steps 87 | [70] = "%1d", -- Tank Pressurizer Lever 88 | [74] = "%.4f", -- Magnetic Compass Ring (Axis) {0.0, 1.0} in 0.0333 Steps 89 | -- Gun Sight and Tertiary Weapons Controls 90 | [77] = "%.2f", -- Gun Sight Setter Rings Range (Axis) {0.0, 1.0} in 0.15 Steps 91 | [78] = "%.2f", -- Gun Sight Setter Rings Base (Axis) {0.0, 1.0} in 0.15 Steps 92 | [79] = "%1d", -- Gun Sight Tint Screen 93 | [80] = "%1d", -- Gun Sight Master Switch 94 | [81] = "%.1f", -- Gun Sight Dimmer (Axis) {0.0, 1.0} in 0.1 Steps 95 | -- Port Wall 96 | [145] = "%.2f", -- Elevator Trim Wheel (Axis) {-1.0, 1.0} in 0.01 Steps 97 | [146] = "%.1f", -- Rudder Trim Wheel (Axis) {-1.0, 1.0} in 0.1 Steps 98 | -- Radio Remote Channel Switcher 99 | [115] = "%1d", -- Off Button 100 | [116] = "%1d", -- A Button 101 | [117] = "%1d", -- B Button 102 | [118] = "%1d", -- C Button 103 | [119] = "%1d", -- D Button 104 | [125] = "%1d", -- Dimmer Toggle 105 | [155] = "%1d", -- Transmit Lock Toggle 106 | [156] = "%1d", -- Mode Selector 107 | -- Throttle Quadrant 108 | [126] = "%.1f", -- Throttle Lever (Axis) {-1.0, 1.0} in 0.1 Steps 109 | [128] = "%1d", -- Bomb Drop Button 110 | [129] = "%.1f", -- Airscrew Lever (Axis) {-1.0, 1.0} in 0.1 Steps 111 | [130] = "%1d", -- Mix Cut-Off Lever 112 | [131] = "%1d", -- U/C Indicator Cut-Off Toggle 113 | -- 114 | [133] = "%1d", -- Radiator Control Toggle 115 | [134] = "%1d", -- Pitot Heater Toggle 116 | [135] = "%1d", -- Fuel Pump Toggle 117 | [137] = "%1d", -- Carb. Air Control Lever 118 | [158] = "%1d", -- Oil Diluter Button 119 | [160] = "%1d", -- Supercharger Mode Test Button 120 | [162] = "%1d", -- Radiator Flap Test Button 121 | -- Stbd. Wall 122 | [87] = "%1d", -- De-Icer Lever 123 | [88] = "%1d", -- U/C Emergency Release Lever 124 | [90] = "%1d", -- Wobble Type Fuel Pump 125 | -- Wobble Type Fuel Pump 126 | [92] = "%.1f", -- Upward Lamp Mode Selector {0.0,0.5,1.0} 127 | [93] = "%.1f", -- Downward Lamp Mode Selector {0.0,0.5,1.0} 128 | [94] = "%1d", -- Morse Key 129 | -- 130 | [148] = "%1d", -- U/C Lever 131 | -- I.F.F. Control Box 132 | [106] = "%1d", -- I.F.F. Upper Toggle (Type B) 133 | [107] = "%1d", -- I.F.F. Lower Toggle (Type D) 134 | [109] = "%1d", -- I.F.F. Fore Button (0) 135 | [110] = "%1d", -- I.F.F. Aft Button (1) 136 | -- Fuel Cocks & Tertiary 137 | [100] = "%1d", -- Fuel Cock 138 | [98] = "%1d", -- Droptank Cock 139 | [99] = "%1d", -- Droptank Release Handle 140 | -- Canopy Controls 141 | [149] = "%1d", -- Cockpit Open/Close Control 142 | [140] = "%1d", -- Cockpit Jettison Pull Ball 143 | [147] = "%1d" -- Cockpit Side Door Open/Close Control 144 | } 145 | 146 | ----------------------------- 147 | -- HIGH IMPORTANCE EXPORTS -- 148 | -- done every export event -- 149 | ----------------------------- 150 | 151 | -- Pointed to by ProcessIkarusDCSHighImportance 152 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 153 | --[[ 154 | every frame export to Ikarus 155 | Example from A-10C 156 | Get Radio Frequencies 157 | get data from device 158 | local lUHFRadio = GetDevice(54) 159 | ExportScript.Tools.SendData("ExportID", "Format") 160 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 161 | 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)) 162 | ]] 163 | end 164 | 165 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 166 | --[[ 167 | every frame export to DAC 168 | Example from A-10C 169 | Get Radio Frequencies 170 | get data from device 171 | local UHF_RADIO = GetDevice(54) 172 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 173 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 174 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 175 | 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)) 176 | ]] 177 | end 178 | 179 | ----------------------------------------------------- 180 | -- LOW IMPORTANCE EXPORTS -- 181 | -- done every gExportLowTickInterval export events -- 182 | ----------------------------------------------------- 183 | 184 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 185 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 186 | --[[ 187 | export in low tick interval to Ikarus 188 | Example from A-10C 189 | Get Radio Frequencies 190 | get data from device 191 | local lUHFRadio = GetDevice(54) 192 | ExportScript.Tools.SendData("ExportID", "Format") 193 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 194 | 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)) 195 | ]] 196 | -- Cockpit Light 197 | ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {163, 62, 63}) 198 | -- Gauges light, left panel light, right panel light 199 | end 200 | 201 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 202 | --[[ 203 | export in low tick interval to DAC 204 | Example from A-10C 205 | Get Radio Frequencies 206 | get data from device 207 | local UHF_RADIO = GetDevice(54) 208 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 209 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 210 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 211 | 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)) 212 | ]] 213 | 214 | --===================================================================================== 215 | --[[ 216 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 217 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 218 | 219 | -- list_indication get tehe value of cockpit displays 220 | local ltmp1 = 0 221 | for ltmp2 = 0, 20, 1 do 222 | ltmp1 = list_indication(ltmp2) 223 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 224 | end 225 | ]] 226 | --[[ 227 | -- getmetatable get function name from devices 228 | local ltmp1 = 0 229 | for ltmp2 = 1, 70, 1 do 230 | ltmp1 = GetDevice(ltmp2) 231 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 232 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 233 | end 234 | ]] 235 | 236 | -- VHF_Radio 237 | local lVHF_Radio = GetDevice(15) 238 | if lVHF_Radio:is_on() then 239 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lVHF_Radio:get_frequency()/1000000)) 240 | ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy(lVHF_Radio:get_frequency()/1000000)) 241 | else 242 | ExportScript.Tools.SendDataDAC("2000", " ") 243 | end 244 | 245 | --[[ 246 | [115] = "%1d", -- Off Button 247 | [116] = "%1d", -- A Button 248 | [117] = "%1d", -- B Button 249 | [118] = "%1d", -- C Button 250 | [119] = "%1d", -- D Button]] 251 | local lVHF_Radio_PRESET = "" 252 | if mainPanelDevice:get_argument_value(116) > 0.8 then 253 | lVHF_Radio_PRESET = 1 254 | elseif mainPanelDevice:get_argument_value(117) > 0.8 then 255 | lVHF_Radio_PRESET = 2 256 | elseif mainPanelDevice:get_argument_value(118) > 0.8 then 257 | lVHF_Radio_PRESET = 3 258 | elseif mainPanelDevice:get_argument_value(119) > 0.8 then 259 | lVHF_Radio_PRESET = 4 260 | else 261 | lVHF_Radio_PRESET = "" 262 | end 263 | ExportScript.Tools.SendDataDAC("2001", lVHF_Radio_PRESET) 264 | end 265 | 266 | ----------------------------- 267 | -- Custom functions -- 268 | ----------------------------- -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/Su-25.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/Su-25.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua: -------------------------------------------------------------------------------- 1 | -- Su-25T Export 2 | 3 | ExportScript.FoundFCModule = true 4 | ExportScript.Version.Su25T = "1.2.1" 5 | 6 | -- auxiliary function 7 | dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") 8 | 9 | ----------------------------------------- 10 | -- FLAMING CLIFFS AIRCRAFT / Su-25T -- 11 | -- FC aircraft don't support GetDevice -- 12 | ----------------------------------------- 13 | 14 | function ExportScript.ProcessIkarusFCHighImportanceConfig() 15 | local lFunctionTyp = "Ikarus" -- function type for shared function 16 | local myData = LoGetSelfData() 17 | 18 | if (myData) then 19 | local lLatitude = myData.LatLongAlt.Lat -- LATITUDE 20 | local lLongitude = myData.LatLongAlt.Long -- LONGITUDE 21 | 22 | local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ?C 23 | local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ?C 24 | --[[ 25 | local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE 26 | local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter) 27 | local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter) 28 | local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second) 29 | local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian) 30 | 31 | local lHeading = myData.Heading -- HEADING (Radian) 32 | local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second) 33 | local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second) 34 | local lMachNumber = LoGetMachNumber() -- MACH 35 | local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian) 36 | 37 | local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1) 38 | local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1) 39 | local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1) 40 | local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD 41 | 42 | local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian) 43 | local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian) 44 | local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second) 45 | local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter) 46 | local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second) 47 | 48 | local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data 49 | local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian) 50 | local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian) 51 | local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian) 52 | 53 | local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM % 54 | local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM % 55 | 56 | local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG) 57 | local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG) 58 | 59 | local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... 60 | local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,... 61 | ]] 62 | 63 | local lDistanceToWay = 999 64 | local lRoute = LoGetRoute() 65 | 66 | if (myData and lRoute) then -- if neither are nil 67 | local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude) 68 | --lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2) 69 | lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2) 70 | end 71 | 72 | -- IAS-TAS Indicator 73 | ExportScript.AF.FC_Russian_AirSpeed_1100hkm() 74 | 75 | -- AOA Indicator and Accelerometer 76 | ExportScript.AF.FC_Russian_AOA_Su25() 77 | 78 | -- ADI 79 | ExportScript.AF.FC_Russian_ADI_Old() 80 | 81 | -- HSI 82 | ExportScript.AF.FC_Russian_HSI(lDistanceToWay) 83 | 84 | -- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition) 85 | ExportScript.AF.FC_Russian_VVI_Old() 86 | 87 | -- Radar Altimeter (below 100m is warning light on) 88 | ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100) 89 | 90 | -- Barometric Altimeter 91 | ExportScript.AF.FC_Russian_BarometricAltimeter_late_special() 92 | 93 | -- Tachometer (RPM) 94 | ExportScript.AF.FC_Russian_EngineRPM() 95 | 96 | -- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID) 97 | ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70) 98 | 99 | -- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID) 100 | ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71) 101 | 102 | -- Clock from Ka-50 103 | ExportScript.AF.FC_Russian_Clock_late() 104 | else 105 | ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.") 106 | end 107 | end 108 | 109 | function ExportScript.ProcessDACConfigHighImportance() 110 | local lFunctionTyp = "DAC" -- function type for shared function 111 | 112 | -- your script 113 | 114 | end 115 | 116 | function ExportScript.ProcessIkarusFCLowImportanceConfig() 117 | local lFunctionTyp = "Ikarus" -- function type for shared function 118 | -- Weapon Panel 119 | ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp) 120 | 121 | -- SPO15 Radar Warning Reciver 122 | ExportScript.AF.FC_SPO15RWR(lFunctionTyp) 123 | 124 | -- EKRAN Message 125 | ExportScript.AF.FC_EKRAN() 126 | 127 | -- Mechanical Configuration Indicator 128 | ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp) 129 | 130 | -- Fuel Quantity Indicator 131 | ExportScript.AF.FC_FuelQuantityIndicator(lFunctionTyp) 132 | 133 | local lEngineInfo = LoGetEngineInfo() 134 | if lEngineInfo ~= nil then 135 | -- Hydraulic Pressure Left 136 | ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85) 137 | 138 | -- Hydraulic Pressure Right 139 | ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86) 140 | end 141 | 142 | local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... 143 | if lMechInfo ~= nil then 144 | -- Wheelbrakes Hydraulic Pressure Left 145 | ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87) 146 | 147 | -- Wheelbrakes Hydraulic Pressure Right 148 | ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88) 149 | end 150 | 151 | -- (x < 0 and 'negative' or 'non-negative') 152 | --[[ 153 | local lPayloadInfo = LoGetPayloadInfo() 154 | ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo)) 155 | 156 | local lSnares = LoGetSnares() -- Flare and Chaff 157 | ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares)) 158 | 159 | local lSightingSystemInfo = LoGetSightingSystemInfo() 160 | ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)) 161 | 162 | local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C 163 | ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo)) 164 | 165 | local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C 166 | ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation)) 167 | 168 | local lLockedTargetInformation = LoGetLockedTargetInformation() 169 | ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation)) 170 | 171 | local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode 172 | ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs)) 173 | 174 | local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... 175 | ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo)) 176 | 177 | local lMCPState = LoGetMCPState() -- Warnlichter 178 | ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState)) 179 | 180 | local lControlPanel_HSI = LoGetControlPanel_HSI() 181 | ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI)) 182 | 183 | local lRadioBeaconsStatus = LoGetRadioBeaconsStatus() 184 | ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus)) 185 | 186 | local lEngineInfo = LoGetEngineInfo() 187 | ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo)) 188 | ]] 189 | -- Weapon Control System 190 | -- local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string 191 | -- values from LoGetTargetInformation().type 192 | -- ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType)) 193 | end 194 | 195 | function ExportScript.ProcessDACConfigLowImportance() 196 | local lFunctionTyp = "DAC" -- function type for shared function 197 | -- Weapon Panel 198 | ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp) 199 | -- SPO15 Radar Warning Reciver 200 | ExportScript.AF.FC_SPO15RWR(lFunctionTyp) 201 | -- Mechanical Configuration Indicator 202 | ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp) 203 | -- Fuel 204 | ExportScript.AF.FC_FuelQuantityIndicator(lFunctionTyp) 205 | 206 | ExportScript.AF.FC_StatusLamp() 207 | ExportScript.AF.FC_SightingSystem() 208 | end 209 | 210 | ----------------------------- 211 | -- Custom functions -- 212 | ----------------------------- 213 | 214 | function ExportScript.AF.FC_SightingSystem() 215 | local lSightingSystemInfo = LoGetSightingSystemInfo() 216 | if lSightingSystemInfo == nil then 217 | return 218 | end 219 | --ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9 220 | --[[ 221 | [PRF] = { 222 | [selection] = string: "ILV" 223 | [current] = string: "MED" 224 | } 225 | [laser_on] = boolean: "false" 226 | [scale] = { 227 | [azimuth] = number: "0.52359873056412" 228 | [distance] = number: "10000" 229 | } 230 | [radar_on] = boolean: "false" 231 | [optical_system_on] = boolean: "false" 232 | [LaunchAuthorized] = boolean: "false" 233 | [ECM_on] = boolean: "false" 234 | [Manufacturer] = string: "RUS" 235 | [TDC] = { 236 | [y] = number: "0" 237 | [x] = number: "0" 238 | } 239 | [ScanZone] = { 240 | [coverage_H] = { 241 | [min] = number: "0" 242 | [max] = number: "20000" 243 | } 244 | [size] = { 245 | [azimuth] = number: "1.0471974611282" 246 | [elevation] = number: "0.17453290522099" 247 | } 248 | [position] = { 249 | [exceeding_manual] = number: "0" 250 | [distance_manual] = number: "0" 251 | [azimuth] = number: "0" 252 | [elevation] = number: "0" 253 | } 254 | } 255 | ]] 256 | ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 ) 257 | --ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 ) 258 | ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 ) 259 | ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 ) 260 | --ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 ) 261 | end 262 | 263 | function ExportScript.AF.FC_FlareChaff() 264 | local lSnares = LoGetSnares() -- Flare and Chaff 265 | if lSnares == nil then 266 | return 267 | end 268 | --ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares)) 269 | 270 | --[chaff] = number: "128" 271 | --[flare] = number: "128" 272 | end 273 | 274 | function ExportScript.AF.FC_StatusLamp() 275 | local lMCPState = LoGetMCPState() -- Warning Lights 276 | if lMCPState == nil then 277 | return 278 | end 279 | --ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState)) 280 | --[[ 281 | [RightTailPlaneFailure] = boolean: "false" 282 | [EOSFailure] = boolean: "false" 283 | [ECMFailure] = boolean: "false" 284 | [RightAileronFailure] = boolean: "false" 285 | [MasterWarning] = boolean: "false" 286 | [RightEngineFailure] = boolean: "false" 287 | [CannonFailure] = boolean: "false" 288 | [MLWSFailure] = boolean: "false" 289 | [ACSFailure] = boolean: "false" 290 | [RadarFailure] = boolean: "false" 291 | [HelmetFailure] = boolean: "false" 292 | [HUDFailure] = boolean: "false" 293 | [LeftMainPumpFailure] = boolean: "false" 294 | [RightWingPumpFailure] = boolean: "false" 295 | [LeftWingPumpFailure] = boolean: "false" 296 | [MFDFailure] = boolean: "false" 297 | [RWSFailure] = boolean: "false" 298 | [GearFailure] = boolean: "false" 299 | [HydraulicsFailure] = boolean: "false" 300 | [AutopilotFailure] = boolean: "true" 301 | [FuelTankDamage] = boolean: "false" 302 | [LeftAileronFailure] = boolean: "false" 303 | [CanopyOpen] = boolean: "false" 304 | [RightMainPumpFailure] = boolean: "false" 305 | [StallSignalization] = boolean: "false" 306 | [LeftEngineFailure] = boolean: "false" 307 | [AutopilotOn] = boolean: "false" 308 | [LeftTailPlaneFailure] = boolean: "false" 309 | ]] 310 | 311 | ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 ) 312 | ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 ) 313 | ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 ) 314 | ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 ) 315 | ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 ) 316 | ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 ) 317 | ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 ) 318 | ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 ) 319 | ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 ) 320 | ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 ) 321 | ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 ) 322 | ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 ) 323 | ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 ) 324 | ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 ) 325 | ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 ) 326 | ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 ) 327 | ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 ) 328 | ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 ) 329 | ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 ) 330 | ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 ) 331 | ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 ) 332 | ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 ) 333 | ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 ) 334 | ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 ) 335 | ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 ) 336 | ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 ) 337 | ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 ) 338 | ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 ) 339 | 340 | local lEngineInfo = LoGetEngineInfo() 341 | if lEngineInfo ~= nil then 342 | --ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo)) 343 | ExportScript.Tools.SendDataDAC("728", lEngineInfo.EngineStart.left ) -- lamp start left engine 1 (0|1) 344 | ExportScript.Tools.SendDataDAC("729", lEngineInfo.EngineStart.right ) -- lamp start right engine 1 (0|1) 345 | end 346 | 347 | local lAoA = LoGetAngleOfAttack() 348 | if lAoA ~= nil then 349 | lAoA = lAoA * 57.3 350 | ExportScript.Tools.SendDataDAC("730", (lAoA > 20.0 and 1 or 0) ) -- lamp start AOA warning (0|1) 351 | end 352 | end 353 | 354 | function ExportScript.AF.FC_FuelQuantityIndicator(FunctionTyp) 355 | local lFunctionTyp = FunctionTyp or "Ikarus" 356 | -- Fuel quantity shows the fuel remaining in all tanks 357 | local lEngineInfo = LoGetEngineInfo() 358 | if lEngineInfo == nil then 359 | return 360 | end 361 | --ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo)) 362 | --[[ 363 | [fuel_external] = number: "0" 364 | [Temperature] = { 365 | [left] = number: "626.99444580078" 366 | [right] = number: "626.99444580078" 367 | } 368 | [RPM] = { 369 | [left] = number: "87.453765869141" 370 | [right] = number: "87.453758239746" 371 | } 372 | [FuelConsumption] = { 373 | [left] = number: "0.1500396137767" 374 | [right] = number: "0.1500396137767" 375 | } 376 | [fuel_internal] = number: "3773.2749023438" 377 | [EngineStart] = { 378 | [left] = number: "0" 379 | [right] = number: "0" 380 | } 381 | [HydraulicPressure] = { 382 | [left] = number: "210" 383 | [right] = number: "210" 384 | } 385 | lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank 386 | ]] 387 | 388 | local lTotalFuel = lEngineInfo.fuel_internal 389 | --local lTotalFuel = string.format("%3d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10) 390 | --local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg 391 | --local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg 392 | local lFuelCounter = {[0] = 0.0, [1] = 0.11, [2] = 0.22, [3] = 0.33, [4] = 0.44, [5] = 0.55, [6] = 0.66, [7] = 0.77, [8] = 0.88, [9] = 0.99} 393 | lTotalFuel = string.format("%03d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil")) -- auf drei stellen bringen 394 | 395 | local lExtTank1 = 1.0 -- external tanks 396 | local lExtTank2 = 1.0 -- inner tanks 397 | 398 | local lPayloadInfo = LoGetPayloadInfo() 399 | if lPayloadInfo ~= nil then 400 | --ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo)) 401 | if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or 402 | lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5) 403 | lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0) 404 | end 405 | if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or 406 | lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8) 407 | lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0) 408 | end 409 | end 410 | -- TotalFuel_100 411 | -- TotalFuel_10 412 | -- TotalFuel_1 413 | -- Light1 414 | -- Light2 415 | -- Light3 416 | -- Light4 417 | -- Light5 418 | -- BingoLight 419 | 420 | if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then 421 | ExportScript.Tools.SendData(300, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 1, 1))])) 422 | ExportScript.Tools.SendData(301, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 2, 2))])) 423 | ExportScript.Tools.SendData(302, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 3, 3))])) 424 | ExportScript.Tools.SendData(303, lExtTank1) -- external tanks 425 | ExportScript.Tools.SendData(304, lExtTank2) -- inner tanks 426 | ExportScript.Tools.SendData(305, (lEngineInfo.fuel_internal < 2800.0 and 1 or 0)) -- inner wing tank 427 | ExportScript.Tools.SendData(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank 428 | ExportScript.Tools.SendData(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank 429 | ExportScript.Tools.SendData(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel 430 | end 431 | 432 | if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then 433 | ExportScript.Tools.SendDataDAC("300", string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)) -- total fuel in kg 434 | --ExportScript.Tools.SendDataDAC("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg 435 | --ExportScript.Tools.SendDataDAC("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg 436 | ExportScript.Tools.SendDataDAC(303, lExtTank1) -- external tanks 437 | ExportScript.Tools.SendDataDAC(304, lExtTank2) -- inner tanks 438 | ExportScript.Tools.SendDataDAC(305, (lEngineInfo.fuel_internal < 2800.0 and 1 or 0)) -- inner wing tank 439 | ExportScript.Tools.SendDataDAC(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank 440 | ExportScript.Tools.SendDataDAC(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank 441 | ExportScript.Tools.SendDataDAC(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel 442 | end 443 | end -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/Su-27.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/Su-33.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/Scripts/DCS-ExportScript/ExportsModules/Su-33.lua -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua: -------------------------------------------------------------------------------- 1 | -- TF-51D Export 2 | 3 | ExportScript.FoundDCSModule = true 4 | ExportScript.Version.TF51D = "1.2.1" 5 | 6 | ExportScript.ConfigEveryFrameArguments = 7 | { 8 | --[[ 9 | every frames arguments 10 | based of "mainpanel_init.lua" 11 | Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) 12 | [DeviceID] = "Format" 13 | [4] = "%.4f", <- floating-point number with 4 digits after point 14 | [19] = "%0.1f", <- floating-point number with 1 digit after point 15 | [129] = "%1d", <- decimal number 16 | [5] = "%.f", <- floating point number rounded to a decimal number 17 | ]] 18 | -- Flight Instruments 19 | [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} 20 | [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} 21 | -- Altimeter 22 | [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} 23 | [96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} 24 | [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} 25 | [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} 26 | -- Artificial horizon 27 | [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} 28 | [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} 29 | [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} 30 | [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} 31 | -- directional gyro 32 | [12] = "%.4f", -- GyroHeading 33 | -- turn indicator 34 | [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} 35 | [28] = "%.4f", -- Slipball {-1.0, 1.0} 36 | -- oxygen pressure indicator 37 | [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} 38 | [33] = "%.4f", -- Oxygen_Flow_Blinker 39 | -- fuel system 40 | [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} 41 | [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} 42 | [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} 43 | -- A-11 clock 44 | [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} 45 | [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} 46 | [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} 47 | -- AN5730 remote compass 48 | [1] = "%.4f", -- CompassHeading 49 | [2] = "%.4f", -- CommandedCourse 50 | [3] = "%.4f", -- CommandedCourseKnob 51 | -- TailRadarWarning 52 | [161] = "%.f", -- Lamp TailRadarWarning 53 | -- SCR-522A Control panel 54 | [122] = "%.f", -- A_channel_light 55 | [123] = "%.f", -- B_channel_light 56 | [124] = "%.f", -- C_channel_light 57 | [125] = "%.f", -- D_channel_light 58 | [126] = "%.f", -- Transmit_light 59 | -- hydraulic pressure 60 | [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} 61 | -- Landing gears handle 62 | [150] = "%.4f", -- Landing_Gear_Handle 63 | [151] = "%.4f", -- Landing_Gear_Handle_Indoor 64 | [80] = "%.f", -- LandingGearGreenLight 65 | [82] = "%.f", -- LandingGearRedLight 66 | -- gauges 67 | [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} 68 | [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} 69 | [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} 70 | [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} 71 | [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} 72 | [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} 73 | [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} 74 | [164] = "%.1f", -- Left_Fluor_Light 75 | [165] = "%.1f", -- Right_Fluor_Light 76 | [59] = "%.f", -- Hight_Blower_Lamp 77 | -- Trimmer 78 | [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} 79 | [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} 80 | [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} 81 | [174] = "%.4f", -- Control_Lock_Bracket 82 | [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} 83 | [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} 84 | [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} 85 | [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} 86 | -- light 87 | [185] = "%.1f", -- Left_cockpit_light 88 | [186] = "%.1f", -- Right_cockpit_light 89 | [190] = "%.4f", -- warEmergencyPowerLimWire 90 | } 91 | 92 | ExportScript.ConfigArguments = 93 | { 94 | --[[ 95 | arguments for export in low tick interval 96 | based on "clickabledata.lua" 97 | ]] 98 | -- Right Swich Panel 99 | [102] = "%d", -- Generator Connect/Disconnect 100 | [103] = "%d", -- Battery Connect/Disconnect 101 | [104] = "%d", -- Gun Heating ON/OFF 102 | [105] = "%d", -- Pitot Heating ON/OFF 103 | [106] = "%d", -- Wing Position Lights Bright/Off/Dim 104 | [107] = "%d", -- Tail Position Lights Bright/Off/Dim 105 | [108] = "%d", -- Red Recognition Light Key/Off/Steady 106 | [109] = "%d", -- Green Recognition Light Key/Off/Steady 107 | [110] = "%d", -- Amber Recognition Light Key/Off/Steady 108 | [111] = "%d", -- Recognition Lights Key 109 | [112] = "%d", -- Circuit Protectors Reset 110 | [100] = "%.4f", -- Right Fluorescent Light (rotary) 111 | [90] = "%.4f", -- Left Fluorescent Light (rotary) 112 | -- Flight Instrument panel 113 | [3] = "%.4f", -- Course Set (rotary) 114 | [13] = "%.4f", -- Heading Set/Cage (rotary) 115 | [179] = "%d", -- Heading Set/Cage Button 116 | [17] = "%.4f", -- Pitch Adjustment (rotary) 117 | [18] = "%.4f", -- Cage (rotary) 118 | [19] = "%d", -- Cage Button 119 | [8] = "%d", -- Winding/Adjustment Clock Button 120 | [7] = "%.4f", -- Winding/Adjustment Clock (rotary) 121 | [26] = "%.4f", -- Set Pressure (rotary) 122 | -- SCR-522A Control panel 123 | [117] = "%d", -- Radio ON/OFF 124 | [118] = "%d", -- A Channel Activate 125 | [119] = "%d", -- B Channel Activate 126 | [120] = "%d", -- C Channel Activate 127 | [121] = "%d", -- D Channel Activate 128 | [127] = "%.4f", -- Radio Lights Dimmer (rotary) 129 | [116] = "%.4f", -- Radio Audio Volume (rotary) 130 | [44] = "%d", -- Microphone On 131 | [129] = "%d", -- Switch Locking Lever 132 | [128] = "%d", -- Radio Mode Transmit/Receive/Remote 133 | ------------- 134 | [71] = "%.4f", -- Cockpit Lights (rotary) 135 | [66] = "%0.1f", -- Ignition Off/Right/Left/Both 136 | [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On 137 | [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off 138 | -- Bomb Arm/Chemical 139 | [69] = "%d", -- Left Bomb Arm/Chemical 140 | [70] = "%d", -- Right Bomb Arm/Chemical 141 | -- Release Mode 142 | [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm 143 | -- Engine Control Panel 144 | [58] = "%d", -- Supercharger Switch Cover 145 | [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH 146 | [60] = "%d", -- High Blower Lamp Test 147 | [61] = "%d", -- Fuel Booster On/Off 148 | [62] = "%d", -- Oil Dilute Activate 149 | [63] = "%d", -- Starter Activate 150 | [64] = "%d", -- Starter Switch Cover 151 | [65] = "%d", -- Primer Activate 152 | -- Oxygen Regulator 153 | [131] = "%d", -- Auto-Mix On-Off 154 | [130] = "%0.4f", -- Oxygen Emergency By-pass 155 | -- Fuel system 156 | [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank 157 | [86] = "%d", -- Fuel Shut-Off Valve ON/OFF 158 | -- AN/APS-13 159 | [114] = "%d", -- ail Warning Radar Power ON/OFF 160 | [115] = "%d", -- Tail Warning Radar Test 161 | [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) 162 | ------------- 163 | [79] = "%d", -- Hydraulic Release Knob 164 | [94] = "%.4f", -- Flaps Control Handle (rotary) 165 | [84] = "%d", -- Parking Brake Handle 166 | [81] = "%d", -- Safe Landing Gear Light Test 167 | [83] = "%d", -- Unsafe Landing Gear Light Test 168 | -- Detrola receiver 169 | [137] = "%.4f", -- Detrola Frequency Selector (rotary) 170 | [138] = "%.4f", -- Detrola Volume (rotary) 171 | -- canopy 172 | [147] = "%.4f", -- Canopy Hand Crank (rotary) 173 | [149] = "%d", -- Canopy Emergency Release Handle 174 | -- AN/ARA-8 175 | [152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING 176 | [153] = "%d", -- Homing Adapter Power On/Off 177 | [154] = "%d", -- Homing Adapter's Circuit Breaker 178 | -- SCR-695 179 | [139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 180 | [140] = "%d", -- IFF Power On/Off 181 | [141] = "%d", -- IFF TIME/OFF/ON 182 | [142] = "%d", -- IFF Detonator Circuit On/Off 183 | [143] = "%d", -- IFF Distress Signal On/Off 184 | [145] = "%d", -- IFF Detonator Left 185 | [146] = "%d", -- IFF Detonator Right 186 | -- Trimmers 187 | [91] = "%.4f", -- Aileron Trim (rotary) 188 | [92] = "%.4f", -- Elevator Trim (rotary) 189 | [93] = "%.4f", -- Rudder Trim (rotary) 190 | ------------- 191 | [157] = "%.4f", -- Defroster (rotary) 192 | [158] = "%.4f", -- Cold Air (rotary) 193 | [159] = "%.4f", -- Hot Air (rotary) 194 | ------------- 195 | [89] = "%d", -- Landing Light On/Off 196 | [168] = "%d", -- Coolant Control Cover 197 | [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control 198 | [169] = "%d", -- Oil Control Cover 199 | [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control 200 | [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) 201 | [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) 202 | [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH 203 | [43] = "%.4f", -- Throttle (rotary) 204 | [46] = "%.4f", -- Propeller RPM (rotary) 205 | [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position 206 | [48] = "%.4f", -- Lock Throttle (rotary) 207 | [49] = "%.4f", -- Lock Propeller & Mixture (rotary) 208 | [176] = "%d", -- G-meter reset 209 | [183] = "%d", -- Mirror 210 | --Gunsight Selector 211 | [41] = "%d", -- Sight On/Off 212 | [39] = "%d", -- Fixed Reticle Mask Lever 213 | [40] = "%0.1f", -- Sight Mode, Fixed Sight/Fixed-Gyro Sight/Gyro Sight 214 | [42] = "%.1f", -- Gun Sight Brightness 215 | [35] = "%.1f", -- Wing Span Selector 216 | ------------- 217 | [132] = "%.4f", -- Left Payload Salvo 218 | [133] = "%.4f" -- Right Payload Salvo 219 | } 220 | 221 | ----------------------------- 222 | -- HIGH IMPORTANCE EXPORTS -- 223 | -- done every export event -- 224 | ----------------------------- 225 | 226 | -- Pointed to by ProcessIkarusDCSHighImportance 227 | function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) 228 | --[[ 229 | every frame export to Ikarus 230 | Example from A-10C 231 | Get Radio Frequencies 232 | get data from device 233 | local lUHFRadio = GetDevice(54) 234 | ExportScript.Tools.SendData("ExportID", "Format") 235 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 236 | 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)) 237 | ]] 238 | end 239 | 240 | function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) 241 | --[[ 242 | every frame export to DAC 243 | Example from A-10C 244 | Get Radio Frequencies 245 | get data from device 246 | local UHF_RADIO = GetDevice(54) 247 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 248 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 249 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 250 | 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)) 251 | ]] 252 | end 253 | ----------------------------------------------------- 254 | -- LOW IMPORTANCE EXPORTS -- 255 | -- done every gExportLowTickInterval export events -- 256 | ----------------------------------------------------- 257 | 258 | -- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance 259 | function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) 260 | --[[ 261 | export in low tick interval to Ikarus 262 | Example from A-10C 263 | Get Radio Frequencies 264 | get data from device 265 | local lUHFRadio = GetDevice(54) 266 | ExportScript.Tools.SendData("ExportID", "Format") 267 | ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data 268 | 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)) 269 | ]] 270 | end 271 | 272 | function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) 273 | --[[ 274 | every frame export to hardware 275 | Example from A-10C 276 | Get Radio Frequencies 277 | get data from device 278 | local UHF_RADIO = GetDevice(54) 279 | ExportScript.Tools.SendDataDAC("ExportID", "Format") 280 | ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) 281 | ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) 282 | 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)) 283 | ]] 284 | 285 | --===================================================================================== 286 | --[[ 287 | ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) 288 | ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) 289 | 290 | -- list_indication get tehe value of cockpit displays 291 | local ltmp1 = 0 292 | for ltmp2 = 0, 20, 1 do 293 | ltmp1 = list_indication(ltmp2) 294 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 295 | end 296 | ]] 297 | --[[ 298 | -- getmetatable get function name from devices 299 | local ltmp1 = 0 300 | for ltmp2 = 1, 70, 1 do 301 | ltmp1 = GetDevice(ltmp2) 302 | ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) 303 | ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) 304 | end 305 | ]] 306 | end 307 | 308 | ----------------------------- 309 | -- Custom functions -- 310 | ----------------------------- 311 | -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/lib/Maps.lua: -------------------------------------------------------------------------------- 1 | -- Ikarus and D.A.C. Export Script 2 | -- 3 | -- Map Config File 4 | -- 5 | -- Copyright by Michael aka McMicha 2014 6 | -- Contact dcs2arcaze.micha@farbpigmente.org 7 | -- 8 | -- This file contains the data to identify the loaded map. 9 | -- 10 | -- The data can be read in the editor. 11 | -- Load the corresponding map and read the latitude and longitude values and write specify the decimal degree format (convert from degrees, decimal to decimal degrees). 12 | -- Lat1 and Long1 contain the coordinates of the upper left corner. 13 | -- Lat2 and Long2 contain the coordinates of the lower right corner. 14 | -- 15 | 16 | ExportScript.Version.Maps = "1.2.1" 17 | 18 | -- Maps 19 | ExportScript.Maps = {} 20 | -- Caucasus Map 21 | ExportScript.Maps.CaucasusBase = {} 22 | ExportScript.Maps.CaucasusBase.Lat1 = 48.384867 -- high left Latitude 48° 23. 92 N 23 | ExportScript.Maps.CaucasusBase.Long1 = 26.779467 -- high left Longitude 26° 46.768 E 24 | ExportScript.Maps.CaucasusBase.Lat2 = 38.865183 -- low right Latitude 38° 51.911 N 25 | ExportScript.Maps.CaucasusBase.Long2 = 47.14225 -- low right Longitude 47° 8.535 E 26 | -- Nevada (NTTR) Map 27 | ExportScript.Maps.Nevada = {} -- Nevada Map 28 | ExportScript.Maps.Nevada.Lat1 = 37.578333 -- high left Latitude 37° 34' 42" N 29 | ExportScript.Maps.Nevada.Long1 = -119.964722 -- high left Longitude 119° 57' 53" W 30 | ExportScript.Maps.Nevada.Lat2 = 34.651667 -- low right Latitude 34° 39' 06" N 31 | ExportScript.Maps.Nevada.Long2 = -114.536111 -- low right Longitude 114° 32' 10" W 32 | -- Normandy Map 33 | ExportScript.Maps.Normandy = {} -- Normandy Map 34 | ExportScript.Maps.Normandy.Lat1 = 53.85556 -- high left Latitude 53° 51' 20" N 35 | ExportScript.Maps.Normandy.Long1 = -15.02667 -- high left Longitude 15° 01' 36" W 36 | ExportScript.Maps.Normandy.Lat2 = 45.07167 -- low right Latitude 45° 04' 18" N 37 | ExportScript.Maps.Normandy.Long2 = 8.437222 -- low right Longitude 08° 26' 14" E 38 | -- Persian Gulf Map 39 | ExportScript.Maps.PersianGulf = {} 40 | ExportScript.Maps.PersianGulf.Lat1 = 30.50833 -- high left Latitude 30° 20.630 N 41 | ExportScript.Maps.PersianGulf.Long1 = 45.15167 -- high left Longitude 44° 54.906 E 42 | ExportScript.Maps.PersianGulf.Lat2 = 22.43528 -- low right Latitude 22° 24.127 N 43 | ExportScript.Maps.PersianGulf.Long2 = 61.67306 -- low right Longitude 61° 36.263 E 44 | -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/lib/genericRadio.lua: -------------------------------------------------------------------------------- 1 | -- Ikarus and D.A.C. Export Script 2 | -- 3 | -- generic Radio File 4 | -- 5 | -- Copyright by Michael aka McMicha 2014 6 | -- Contact dcs2arcaze.micha@farbpigmente.org 7 | 8 | ExportScript.Version.genericRadio = "1.2.1" 9 | 10 | --[[ 11 | -- Config and execute in function ExportScript.ProcessDACConfigLowImportance() 12 | 13 | -- genericRadioConf for example A-10C Radio AN/ARC-164 UHF 14 | ExportScript.genericRadioConf = {} 15 | ExportScript.genericRadioConf['maxRadios'] = 1 -- numbers of aviables/supported radios 16 | ExportScript.genericRadioConf[1] = {} -- first radio 17 | ExportScript.genericRadioConf[1]['Name'] = "AN/ARC-164 UHF" -- name of radio 18 | ExportScript.genericRadioConf[1]['DeviceID'] = 54 -- DeviceID for GetDevice from device.lua 19 | ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active 20 | ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- multiplicator from Hz to MHz 21 | ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style 22 | ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change 23 | ExportScript.genericRadioConf[1]['minFrequency'] = 220.000 -- lowest frequency 24 | ExportScript.genericRadioConf[1]['maxFrequency'] = 314.450 -- highest frequency 25 | ExportScript.genericRadioConf[1]['Power'] = {} -- power button active 26 | ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3008 -- power button id from cklickable.lua 27 | ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua 28 | ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua 29 | ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active 30 | ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3011 -- volume button id from cklickable.lua 31 | ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active 32 | ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 161 -- ManualPreset argument id from cklickable.lua 33 | ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua 34 | -- ExportScript.genericRadioConf[1]['Preset']['ButtonID2'] = 3002 -- preset button id from cklickable.lua 35 | -- Preset based on switchlogic on clickabledata.lua 36 | ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20",[1.00]="01"} 37 | ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.05 -- minimal step for preset change 38 | -- ExportScript.genericRadioConf[1]['Preset']['Step2'] = -0.05 -- minimal step for preset change 39 | ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active 40 | ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 170 -- ManualPreset argument id from cklickable.lua 41 | ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3010 -- squelch button id from cklickable.lua 42 | ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua 43 | ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua 44 | ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset 45 | ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3015 -- load button id from cklickable.lua 46 | ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active 47 | ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 167 -- ManualPreset argument id from cklickable.lua 48 | ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua 49 | ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua 50 | ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua 51 | 52 | ... 53 | 54 | ExportScript.genericRadio(nil, nil)]] 55 | 56 | function ExportScript.genericRadio(key, value) 57 | --ExportScript.Tools.WriteToLog('genericRadioConf: '..ExportScript.Tools.dump(ExportScript.genericRadioConf)) 58 | if type(ExportScript.genericRadioConf) ~= "table" then 59 | ExportScript.Tools.WriteToLog("No Radio defined.") 60 | return 61 | end 62 | 63 | local lRotaryFrequency_1, lRotaryFrequency_2, lVolume, lPreset, lLoad, lSquelch, lManualPreset, lPower, lDevice, lClickAction, lSetFrequency = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil 64 | local lMainPanelDevice = GetDevice(0) 65 | 66 | if ExportScript.AF.genericRadio == nil then 67 | ExportScript.AF.genericRadio = 0 68 | end 69 | if ExportScript.AF.genericRadioFrequency1 == nil then 70 | ExportScript.AF.genericRadioFrequency1 = 0.0 71 | end 72 | if ExportScript.AF.genericRadioFrequency2 == nil then 73 | ExportScript.AF.genericRadioFrequency2 = 0.0 74 | end 75 | if ExportScript.AF.genericRadioPower == nil then 76 | ExportScript.AF.genericRadioPower = {} 77 | end 78 | if ExportScript.AF.genericRadioPresetManual == nil then 79 | ExportScript.AF.genericRadioPresetManual = {} 80 | end 81 | if ExportScript.AF.genericRadioSquelch == nil then 82 | ExportScript.AF.genericRadioSquelch = {} 83 | end 84 | if ExportScript.AF.genericRadioPreset == nil then 85 | ExportScript.AF.genericRadioPreset = {} 86 | end 87 | 88 | if key == "3001" then 89 | ExportScript.AF.genericRadio = tonumber(value) 90 | end 91 | if key == "3002" then 92 | lRotaryFrequency_1 = tonumber(value) 93 | end 94 | if key == "3003" then 95 | lRotaryFrequency_2 = tonumber(value) 96 | end 97 | if key == "3004" then 98 | lVolume = tonumber(value) 99 | end 100 | if key == "3005" then 101 | lPreset = tonumber(value) 102 | end 103 | if key == "3006" then 104 | lLoad = tonumber(value) 105 | end 106 | if key == "3007" then 107 | lSquelch = tonumber(value) 108 | end 109 | if key == "3008" then 110 | lManualPreset = tonumber(value) 111 | end 112 | if key == "3009" then 113 | lPower = tonumber(value) 114 | end 115 | 116 | local lPresetChannelFrequency = "-" -- ID 3000 117 | local lPresetChannel = "-" -- ID 3001 118 | local lFrequency = "-" -- ID 3002 119 | 120 | if ExportScript.AF.genericRadio == 0 or ExportScript.AF.genericRadio > ExportScript.genericRadioConf['maxRadios'] then 121 | if ExportScript.AF.genericRadio ~= 0 then 122 | ExportScript.Tools.WriteToLog("Radio Nr. "..ExportScript.AF.genericRadio.." not defined.") 123 | end 124 | ExportScript.Tools.SendDataDAC("3000", lPresetChannelFrequency) 125 | ExportScript.Tools.SendDataDAC("3001", lPresetChannel) 126 | ExportScript.Tools.SendDataDAC("3002", lFrequency) 127 | ExportScript.Tools.SendDataDAC("3010", 0) 128 | ExportScript.Tools.SendDataDAC("3011", 0) 129 | ExportScript.Tools.SendDataDAC("3012", 0) 130 | ExportScript.Tools.SendDataDAC("3013", 0) 131 | return 132 | end 133 | 134 | --------------------------------------------------- 135 | local lRADIO = GetDevice(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID']) 136 | 137 | -- check status of the radio 138 | if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then 139 | if lRADIO:is_on() then 140 | ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 141 | else 142 | ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0 143 | end 144 | end 145 | 146 | -- check Manual/Preset switch 147 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset'] ~= nil then 148 | if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then 149 | ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ArgumentID']), 1) == ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ValueOn']) and 1 or 0) 150 | end 151 | else 152 | ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0 153 | end 154 | 155 | -- check Squelch switch 156 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch'] ~= nil then 157 | if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then 158 | ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ArgumentID']), 1) == ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ValueOn']) and 1 or 0) 159 | end 160 | else 161 | ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 162 | end 163 | 164 | if ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] == nil then 165 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = 0 166 | end 167 | 168 | if lRADIO:is_on() then 169 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset'] ~= nil then 170 | --lPresetChannel = string.format("%s", ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['List'][ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ArgumentID']), 2)]) 171 | --ExportScript.Tools.WriteToLog('Preset index: '..ExportScript.Tools.dump(ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ArgumentID']), string.match(string.reverse(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']), '.')))) 172 | lPresetChannel = string.format("%s", ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['List'][ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ArgumentID']), string.match(string.reverse(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']), '.'))]) 173 | end 174 | 175 | lFrequency = ExportScript.Tools.round(lRADIO:get_frequency()/ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyMultiplicator'] , 3, "floor") 176 | lFrequency = string.format(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyFormat'], lFrequency) 177 | 178 | lPresetChannelFrequency = string.format("%s%s", lPresetChannel, lFrequency) 179 | lPresetChannelFrequency = lPresetChannelFrequency:gsub(" ", "0") 180 | lPresetChannelFrequency = lPresetChannelFrequency:gsub("-", "") 181 | --ExportScript.Tools.WriteToLog('lPresetChannel: '..ExportScript.Tools.dump(lPresetChannel)) 182 | --ExportScript.Tools.WriteToLog('lFrequency: '..ExportScript.Tools.dump(lFrequency)) 183 | --ExportScript.Tools.WriteToLog('lPresetChannelFrequency: '..ExportScript.Tools.dump(lPresetChannelFrequency)) 184 | -- setFrequency == true 185 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['setFrequency'] then 186 | -- minimal frequency, for example lMinFrequency1=220, lMinFrequency2=0 from 220.000 187 | local lMinFrequency1, lMinFrequency2 = math.modf(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['minFrequency']) 188 | lMinFrequency2 = lMinFrequency2 * 1000 189 | -- maximal frequency, for example lMaxFrequency1=314, lMaxFrequency2=975 from 314.975 190 | local lMaxFrequency1, lMaxFrequency2 = math.modf(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['maxFrequency']) 191 | lMaxFrequency2 = lMaxFrequency2 * 1000 192 | 193 | if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then 194 | 195 | local lTmpFrequency = ExportScript.Tools.StrSplit(lFrequency, "%.") -- %. um den Punkt als Punkt zu suchen 196 | 197 | if type(lTmpFrequency) == "table" and lTmpFrequency[1] ~= nil then 198 | lTmpFrequency[1] = tonumber(lTmpFrequency[1]) 199 | if lTmpFrequency[2] == nil then 200 | lTmpFrequency[2] = 0 201 | else 202 | lTmpFrequency[2] = tonumber(lTmpFrequency[2]) 203 | local ltmp = string.format("%.0f", lTmpFrequency[2] / ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']) 204 | lTmpFrequency[2] = ltmp * ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'] 205 | end 206 | if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then 207 | lTmpFrequency[1] = lTmpFrequency[1] - 1 208 | if lTmpFrequency[1] == (lMinFrequency1 - 1) then 209 | lTmpFrequency[1] = lMaxFrequency1 210 | end 211 | ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 212 | else 213 | lTmpFrequency[1] = lTmpFrequency[1] + 1 214 | if lTmpFrequency[1] == (lMaxFrequency1 + 1) then 215 | lTmpFrequency[1] = lMinFrequency1 216 | end 217 | ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 218 | end 219 | 220 | lTmpFrequency[2] = string.format("%.3f", lTmpFrequency[2] / 1000) 221 | lTmpFrequency = string.format("%.3f", lTmpFrequency[1] + lTmpFrequency[2]) 222 | lTmpFrequency = tonumber(lTmpFrequency) 223 | lSetFrequency = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 224 | Frequency = lTmpFrequency * 1000000} 225 | 226 | else 227 | ExportScript.Tools.WriteToLog("1. generic "..ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Name'].." Radio, don't split frequency: "..lFrequency) 228 | end 229 | end 230 | 231 | if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then 232 | 233 | local lTmpFrequency = ExportScript.Tools.StrSplit(lFrequency, "%.") 234 | 235 | if type(lTmpFrequency) == "table" and lTmpFrequency[1] ~= nil then 236 | lTmpFrequency[1] = tonumber(lTmpFrequency[1]) 237 | if lTmpFrequency[2] == nil then 238 | lTmpFrequency[2] = 0 239 | else 240 | lTmpFrequency[2] = tonumber(lTmpFrequency[2]) 241 | local ltmp = string.format("%.0f", lTmpFrequency[2] / ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']) 242 | lTmpFrequency[2] = ltmp * ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'] 243 | end 244 | if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then 245 | lTmpFrequency[2] = lTmpFrequency[2] - ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'] 246 | if lTmpFrequency[2] == (ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'] * -1) then 247 | lTmpFrequency[2] = lMaxFrequency2 248 | end 249 | ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 250 | else 251 | lTmpFrequency[2] = lTmpFrequency[2] + ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'] 252 | if lTmpFrequency[2] == (lMaxFrequency2 + ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']) then 253 | lTmpFrequency[2] = 0 254 | end 255 | ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 256 | end 257 | 258 | lTmpFrequency[2] = string.format("%.3f", lTmpFrequency[2] / 1000) 259 | lTmpFrequency = string.format("%.3f", lTmpFrequency[1] + lTmpFrequency[2]) 260 | lTmpFrequency = tonumber(lTmpFrequency) 261 | lSetFrequency = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 262 | Frequency = lTmpFrequency * 1000000} 263 | 264 | else 265 | ExportScript.Tools.WriteToLog("2. generic "..ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Name'].." Radio, don't split frequency: "..lFrequency) 266 | end 267 | end 268 | end 269 | 270 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset'] ~= nil then 271 | if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then 272 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID2'] == nil and ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step2'] == nil then 273 | local lTempPresetKeys = {} 274 | for k,v in pairs(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['List']) do 275 | table.insert(lTempPresetKeys, k) 276 | end 277 | 278 | local lMinKey = math.min(unpack(lTempPresetKeys)) 279 | local lMaxKey = math.max(unpack(lTempPresetKeys)) 280 | 281 | if lPreset > ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] then 282 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] + ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step'] 283 | if ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] > lMaxKey then 284 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lMinKey 285 | end 286 | else 287 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] - ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step'] 288 | if ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] < lMinKey then 289 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lMaxKey 290 | end 291 | end 292 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 293 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID'], 294 | Value = ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio]} 295 | else 296 | if lPreset < ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] or lPreset == 0.0 or lPreset == 2.0 then 297 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 298 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID'], 299 | Value = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']} 300 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lPreset 301 | else 302 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 303 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID2'], 304 | Value = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step2']} 305 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lPreset 306 | end 307 | ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lPreset 308 | end 309 | end 310 | end 311 | end 312 | 313 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Volume'] ~= nil then 314 | if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then 315 | lVolume = lVolume / 2 316 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 317 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Volume']['ButtonID'], 318 | Value = lVolume} 319 | end 320 | end 321 | 322 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load'] ~= nil then 323 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ButtonID'] ~= nil then 324 | if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then 325 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 326 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ButtonID'], 327 | Value = lLoad} 328 | end 329 | end 330 | end 331 | 332 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch'] ~= nil then 333 | if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then 334 | if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then 335 | -- Squelch off 336 | lSquelch = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ValueOff'] 337 | ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 338 | elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then 339 | -- Squelch on 340 | lSquelch = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ValueOn'] 341 | ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0 342 | end 343 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 344 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ButtonID'], 345 | Value = lSquelch} 346 | end 347 | end 348 | 349 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset'] ~= nil then 350 | if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then 351 | if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then 352 | -- Manual 353 | lManualPreset = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ValueManual'] 354 | ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0 355 | elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0 then 356 | -- Preset 357 | lManualPreset = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ValuePreset'] 358 | ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0 359 | end 360 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 361 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ButtonID'], 362 | Value = lManualPreset} 363 | end 364 | end 365 | 366 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power'] ~= nil then 367 | if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then 368 | if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then 369 | -- Power off 370 | lPower = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power']['ValueOff'] 371 | ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0 372 | elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then 373 | --Power on 374 | lPower = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power']['ValueOn'] 375 | ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 376 | end 377 | lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'], 378 | ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power']['ButtonID'], 379 | Value = lPower} 380 | end 381 | end 382 | 383 | ExportScript.Tools.SendDataDAC("3000", lPresetChannelFrequency) 384 | ExportScript.Tools.SendDataDAC("3001", lPresetChannel) 385 | ExportScript.Tools.SendDataDAC("3002", lFrequency) 386 | ExportScript.Tools.SendDataDAC("3010", ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio]) 387 | ExportScript.Tools.SendDataDAC("3011", ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio]) 388 | ExportScript.Tools.SendDataDAC("3012", ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio]) 389 | -- is only for radios with a lamp for Load button, for example Ka-50 Load Button is Autotune with lamp 390 | if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load'] ~= nil and ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ArgumentID'] ~= nil then 391 | ExportScript.Tools.SendDataDAC("3013", lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ArgumentID'])) 392 | else 393 | ExportScript.Tools.SendDataDAC("3013", 0) 394 | end 395 | 396 | if lClickAction ~= nil then 397 | lDevice = GetDevice(lClickAction.DeviceID) 398 | if type(lDevice) == "table" then 399 | --ExportScript.Tools.WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") 400 | lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value) 401 | end 402 | elseif lSetFrequency ~= nil then 403 | lDevice = GetDevice(lSetFrequency.DeviceID) 404 | if type(lDevice) == "table" and lDevice:is_on() then 405 | --ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") 406 | lDevice:set_frequency(lSetFrequency.Frequency) 407 | else 408 | ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") 409 | end 410 | end 411 | end -------------------------------------------------------------------------------- /Scripts/DCS-ExportScript/lib/utf8.lua: -------------------------------------------------------------------------------- 1 | -- Provides UTF-8 aware string functions implemented in pure lua: 2 | -- * string.utf8len(s) 3 | -- * string.utf8sub(s, i, j) 4 | -- 5 | -- All functions behave as their non UTF-8 aware counterparts with the exception 6 | -- that UTF-8 characters are used instead of bytes for all units. 7 | -- 8 | -- Note: all validations had been removed due to awesome usage specifics. 9 | --[[ 10 | Copyright (c) 2006-2007, Kyle Smith 11 | Modified by Alexander Yakushev, 2010-2013. 12 | All rights reserved. 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | * Redistributions of source code must retain the above copyright notice, 16 | this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | * Neither the name of the author nor the names of its contributors may be 21 | used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 27 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | --]] 34 | 35 | -- ABNF from RFC 3629 36 | -- 37 | -- UTF8-octets = *( UTF8-char ) 38 | -- UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4 39 | -- UTF8-1 = %x00-7F 40 | -- UTF8-2 = %xC2-DF UTF8-tail 41 | -- UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / 42 | -- %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) 43 | -- UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / 44 | -- %xF4 %x80-8F 2( UTF8-tail ) 45 | -- UTF8-tail = %x80-BF 46 | -- 47 | 48 | -- returns the number of bytes used by the UTF-8 character at byte i in s 49 | -- also doubles as a UTF-8 character validator 50 | 51 | local utf8 = {} 52 | 53 | function utf8.charbytes (s, i) 54 | -- argument defaults 55 | i = i or 1 56 | local c = string.byte(s, i) 57 | 58 | -- determine bytes needed for character, based on RFC 3629 59 | if c > 0 and c <= 127 then 60 | -- UTF8-1 61 | return 1 62 | elseif c >= 194 and c <= 223 then 63 | -- UTF8-2 64 | local c2 = string.byte(s, i + 1) 65 | return 2 66 | elseif c >= 224 and c <= 239 then 67 | -- UTF8-3 68 | local c2 = s:byte(i + 1) 69 | local c3 = s:byte(i + 2) 70 | return 3 71 | elseif c >= 240 and c <= 244 then 72 | -- UTF8-4 73 | local c2 = s:byte(i + 1) 74 | local c3 = s:byte(i + 2) 75 | local c4 = s:byte(i + 3) 76 | return 4 77 | end 78 | end 79 | 80 | -- returns the number of characters in a UTF-8 string 81 | function utf8.len (s) 82 | local pos = 1 83 | local bytes = string.len(s) 84 | local len = 0 85 | 86 | while pos <= bytes and len ~= chars do 87 | local c = string.byte(s,pos) 88 | len = len + 1 89 | 90 | pos = pos + utf8.charbytes(s, pos) 91 | end 92 | 93 | if chars ~= nil then 94 | return pos - 1 95 | end 96 | 97 | return len 98 | end 99 | 100 | -- functions identically to string.sub except that i and j are UTF-8 characters 101 | -- instead of bytes 102 | function utf8.sub (s, i, j) 103 | j = j or -1 104 | 105 | if i == nil then 106 | return "" 107 | end 108 | 109 | local pos = 1 110 | local bytes = string.len(s) 111 | local len = 0 112 | 113 | -- only set l if i or j is negative 114 | local l = (i >= 0 and j >= 0) or utf8.len(s) 115 | local startChar = (i >= 0) and i or l + i + 1 116 | local endChar = (j >= 0) and j or l + j + 1 117 | 118 | -- can't have start before end! 119 | if startChar > endChar then 120 | return "" 121 | end 122 | 123 | -- byte offsets to pass to string.sub 124 | local startByte, endByte = 1, bytes 125 | 126 | while pos <= bytes do 127 | len = len + 1 128 | 129 | if len == startChar then 130 | startByte = pos 131 | end 132 | 133 | pos = pos + utf8.charbytes(s, pos) 134 | 135 | if len == endChar then 136 | endByte = pos - 1 137 | break 138 | end 139 | end 140 | 141 | return string.sub(s, startByte, endByte) 142 | end 143 | 144 | -- replace UTF-8 characters based on a mapping table 145 | function utf8.replace (s, mapping) 146 | local pos = 1 147 | local bytes = string.len(s) 148 | local charbytes 149 | local newstr = "" 150 | 151 | while pos <= bytes do 152 | charbytes = utf8.charbytes(s, pos) 153 | local c = string.sub(s, pos, pos + charbytes - 1) 154 | newstr = newstr .. (mapping[c] or c) 155 | pos = pos + charbytes 156 | end 157 | 158 | return newstr 159 | end 160 | 161 | return utf8 -------------------------------------------------------------------------------- /Scripts/Export.lua: -------------------------------------------------------------------------------- 1 | 2 | -- load the DCS ExportScript for DAC and Ikarus 3 | dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]]) 4 | -------------------------------------------------------------------------------- /docu/Documentation-in-English.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/docu/Documentation-in-English.pdf -------------------------------------------------------------------------------- /docu/Dokumentation-in-Deutsch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/docu/Dokumentation-in-Deutsch.pdf -------------------------------------------------------------------------------- /docu/flowchart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s-d-a/DCS-ExportScripts/0df634fb4edb72450e67f2a6502ead38e54f218b/docu/flowchart.jpg --------------------------------------------------------------------------------