mirror of
https://github.com/weyne85/DCS-ExportScripts.git
synced 2025-10-29 16:58:18 +00:00
321 lines
14 KiB
Lua
321 lines
14 KiB
Lua
-- FW-190D9 Dora
|
||
-- Version 0.9.9
|
||
|
||
gES_FoundDCSModule = true
|
||
|
||
gES_GlassCockpitConfigEveryFrameArguments =
|
||
{
|
||
-- Flight Instruments
|
||
[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}
|
||
[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}
|
||
--TrimmNeedle
|
||
[76] = "%.4f", -- TrimmNeedle {-1.0, 1.0}
|
||
--ADF
|
||
[29] = "%.4f", -- ADF_Vertical {-1.0, 1.0}
|
||
[30] = "%.4f", -- ADF_Horizont {-1.0, 1.0}
|
||
-- Altimeter
|
||
[35] = "%.4f", -- Altimeter_km {0.0, 10.0} = {0.0, 1.0}
|
||
[32] = "%.4f", -- Altimeter_m {0.0, 1000.0} = {0.0, 1.0}
|
||
[33] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0}
|
||
-- Artificial horizon
|
||
[37] = "%.4f", -- AHorizon_Pitch {0.33, -0.33}
|
||
[38] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
|
||
[40] = "%.4f", -- TurnNeedle {-1.0, 1.0}
|
||
[41] = "%.4f", -- Slipball {-1.0, 1.0}
|
||
--oxygen pressure indicator
|
||
[112] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
||
[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||
--Remote compass
|
||
[45] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||
[44] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||
-- Engine
|
||
[46] = "%.4f", -- Manifold_Pressure {0.5, 2.5} = {0.0, 1.0}
|
||
[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}
|
||
[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}
|
||
[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}
|
||
[95] = "%.4f", -- Oil_Pressure {0.0, 15.0} -- at = {0, 1.0}
|
||
[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}
|
||
-- Fuel
|
||
[94] = "%.4f", -- Fuel_Pressure {0.0, 3.0} -- at = {0.0, 1.0}
|
||
[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}
|
||
--???[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}
|
||
[100] = "%.4f", -- Fuel_Low_Fwd {0.0, 1.0}
|
||
[101] = "%.4f", -- Fuel_Low_Rear {0.0, 1.0}
|
||
[195] = "%.4f", -- Fluor_Light {0.0, 1.0}
|
||
--Clock
|
||
[21] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0} = {0.0, 1.0}
|
||
[22] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} = {0.0, 1.0}
|
||
[23] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0} = {0.0, 1.0}
|
||
[27] = "%.4f", -- CLOCK_chrono_minutes {0.0, 15.0} = {0.0, 1.0}
|
||
--Ammon Counter
|
||
[52] = "%.4f", -- Ammo_Counter_1 {0.0, 500.0} = {0.0, 1.0}
|
||
[55] = "%.4f", -- Ammo_Counter_2 {0.0, 500.0} = {0.0, 1.0}
|
||
[58] = "%.4f", -- Ammo_Counter_3 {0.0, 500.0} = {0.0, 1.0}
|
||
[61] = "%.4f", -- Ammo_Counter_4 {0.0, 500.0} = {0.0, 1.0}
|
||
-- Gun_Fire
|
||
[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
||
[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
||
[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
||
[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
||
--Target System
|
||
[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}
|
||
--Bomb Lamps
|
||
[196] = "%1d", -- BombLamp_1 {0.0, 1.0}
|
||
[197] = "%1d", -- BombLamp_2 {0.0, 1.0}
|
||
[198] = "%1d", -- BombLamp_3 {0.0, 1.0}
|
||
[199] = "%1d", -- BombLamp_4 {0.0, 1.0}
|
||
[137] = "%1d", -- RocketEmCvr {0.0, 1.0}
|
||
--Gear Lamps
|
||
[68] = "%1d", -- L_GEAR_UP {0.0, 1.0}
|
||
[69] = "%1d", -- L_GEAR_DOWN {0.0, 1.0}
|
||
[70] = "%1d", -- R_GEAR_UP {0.0, 1.0}
|
||
[71] = "%1d", -- R_GEAR_DOWN {0.0, 1.0}
|
||
--Flaps Lamps
|
||
[72] = "%1d", -- FLAPS_UP {0.0, 1.0}
|
||
[73] = "%1d", -- FLAPS_START {0.0, 1.0}
|
||
[74] = "%1d" -- FLAPS_DOWN {0.0, 1.0}
|
||
}
|
||
gES_GlassCockpitConfigArguments =
|
||
{
|
||
[159] = "%.2f", -- Radiator Flaps Control (axis) 1.0 in 0.4 steps
|
||
[160] = "%1d", -- Cold Start/Wind Screen Washer {0, 1}
|
||
--Engine Control Panel
|
||
[75] = "%.1f", -- Magneto Switch (Off, M1, M2, M1+M2) {0.0, 0.3, 0.6, 0.9}
|
||
[104] = "%1d", -- Starter Switch Cover {0, 1}
|
||
[105] = "%.1f", -- Starter Switch. Left Button - Starter Power. Right Button - Magnetic Clutch {0.0, 0.5, 1.0}
|
||
[91] = "%1d", -- MBG Emergency Mode Handle {0, 1}
|
||
[85] = "%1d", -- MW-50 Switch {0, 1}
|
||
--Fuel system
|
||
[90] = "%.1f", -- Fuel Tank Selector Valve (CLOSE/FORWARD/AFT/BOTH) {0.0, 0.1, 0.2, 0.3}
|
||
[99] = "%.1f", -- Fuel Gauge Selector (FORWARD/NONE/AFT) {0.0, 0.5, 1.0}
|
||
--[161] = "%1d", -- "MW-B4 Selector (Not Functional)
|
||
[162] = "%1d", -- Primer Pump {0, 1}
|
||
--electric system
|
||
[79] = "%1d", -- Electric Kill-switch
|
||
[163] = "%1d", -- Emergency Equipment Destruction {0, 1}
|
||
--Circuit Breakers
|
||
[138] = "%1d", -- Circuit Breakers Cover {0, 1}
|
||
[141] = "%1d", -- Flaps, Trimmer, Artificial Horizon Power On {0, 1}
|
||
[142] = "%1d", -- Flaps, Trimmer, Artificial Horizon Power Off {0, 1}
|
||
[143] = "%1d", -- Landing Gear Power On {0, 1}
|
||
[144] = "%1d", -- Landing Gear Power Off {0, 1}
|
||
[145] = "%1d", -- Pitot and Heating Cover On {0, 1}
|
||
[146] = "%1d", -- Pitot and Heating Cover Off {0, 1}
|
||
[147] = "%1d", -- FuG25a On {0, 1}
|
||
[148] = "%1d", -- FuG25a Off {0, 1}
|
||
[149] = "%1d", -- FuG16ZY On {0, 1}
|
||
[150] = "%1d", -- FuG16ZY Off {0, 1}
|
||
[151] = "%1d", -- Instrument Lights, Gun-sight, Indicators, Compass, Starter On {0, 1}
|
||
[152] = "%1d", -- Instrument Lights, Gun-sight, Indicators, Compass, Starter Off {0, 1}
|
||
[153] = "%1d", -- Generator On {0, 1}
|
||
[154] = "%1d", -- Generator Off {0, 1}
|
||
[155] = "%1d", -- Battery On {0, 1}
|
||
[156] = "%1d", -- Battery Off {0, 1}
|
||
--Circuit Breakers of additional panel
|
||
[121] = "%1d", -- Navigation Lights On {0, 1}
|
||
[120] = "%1d", -- Navigation Lights Off {0, 1}
|
||
[123] = "%1d", -- Forward Tank Pump On {0, 1}
|
||
[122] = "%1d", -- Forward Tank Pump Off {0, 1}
|
||
[125] = "%1d", -- Rear Tank Pump On {0, 1}
|
||
[124] = "%1d", -- Rear Tank Pump Off {0, 1}
|
||
[127] = "%1d", -- Auxiliary Tank Pump On {0, 1}
|
||
[126] = "%1d", -- Auxiliary Tank Pump Off {0, 1}
|
||
[129] = "%1d", -- MW-50 On {0, 1}
|
||
[128] = "%1d", -- MW-50 Off {0, 1}
|
||
--canopy
|
||
[115] = "%1d", -- Canopy Emergency Release Handle {0, 1}
|
||
[114] = "%.2f", -- Canopy Hand Crank (axis)
|
||
-- Throttle
|
||
[200] = "", -- Throttle Lock {0, 1}
|
||
--gauges
|
||
[34] = "%.2f", -- Altimeter Pressure Set (axis)
|
||
[39] = "%.2f", -- Horizon Cage (axis) {0.0 - 0.511 in 0.04 steps}
|
||
[43] = "%.2f", -- Course Set (axis)
|
||
--flaps
|
||
[62] = "%1d", -- Flaps Up {0, 1}
|
||
[63] = "%1d", -- Flaps Take Off {0, 1}
|
||
[64] = "%1d", -- Flaps Landing {0, 1}
|
||
--Landing Gears Retraction
|
||
[65] = "%1d", -- Landing Gears Retraction {0, 1}
|
||
[66] = "%1d", -- Landing Gears Retraction Cover {0, 1}
|
||
[67] = "%1d", -- Landing Gears Extending {0, 1}
|
||
[89] = "%1d", -- Landing Gear Emergency Release Handle {0, 1}
|
||
--Trimmer
|
||
[77] = "%1d", -- Stabilizer Trimmer Up/Down {-1, 0, 1}
|
||
--Clock
|
||
[24] = "%.2f", -- Turnable Bezel (axis) in 0.2 steps
|
||
[25] = "%.2f", -- Wind/Set Knob (axis) in 0.1 steps
|
||
[26] = "%1d", -- Start - Stop Button {0, 1}
|
||
[28] = "%1d", -- Stopwatch Button {0, 1}
|
||
--weapons
|
||
[48] = "%.2f", -- Master Arm
|
||
[51] = "%.2f", -- Set Gun 1 Ammunition Count (axis) in 0.4 steps
|
||
[54] = "%.2f", -- Set Gun 2 Ammunition Count (axis) in 0.4 steps
|
||
[57] = "%.2f", -- Set Gun 3 Ammunition Count (axis) in 0.4 steps
|
||
[60] = "%.2f", -- Set Gun 4 Ammunition Count (axis) in 0.4 steps
|
||
[107] = "%1d", -- Main Rocket Switch {0, 1}
|
||
[108] = "%1d", -- Rocket Emergency Release {0, 1}
|
||
[109] = "%.2f", -- Bomb Fusing Selector {0.0, 0.1, 0.2, 0.3, 0.4}
|
||
[92] = "%1d", -- Jettison Fuselage Stores {0, 1}
|
||
--Gunsight
|
||
[132] = "%1d", -- EZ42 Power Switch {0, 1}
|
||
[131] = "%.2f", -- Target Wingspan (axis) in 0.1 steps
|
||
[134] = "%1d", -- Gunsight Night Filter {0, 1}
|
||
[4] = "%.2f", -- Target Distance (axis) in 0.1 steps
|
||
[135] = "%.2f", -- Gunsight Brightness (axis) in 0.1 steps
|
||
[191] = "%.2f", -- Aiming correction 1 (axis) in 0.1 steps
|
||
--Instrument Lights Brightness
|
||
[78] = "", -- Instrument Lights Brightness (axis) in 0.4 steps
|
||
--Radio
|
||
[81] = "%.1f", -- Radio Channel Selector {0.0, 0.1, 0.2, 0.3}
|
||
[83] = "%.2f", -- Radio Volume (axis) in 0.04 steps
|
||
[84] = "%1d", -- FT FT / Y ZF Mode Switch {0, 1}
|
||
[82] = "%.2f", -- Radio Tuning (+/-30 kHz) (axis) in 0.04 steps
|
||
--Oxygen
|
||
[110] = "%.2f", -- Oxygen Flow Valve (axis) in 0.04 steps
|
||
[190] = "%1d", -- Oxygen Emergency Knob {0, 1}
|
||
--IFF
|
||
[86] = "%1d", -- IFF Channel Selector {-1, 0, 1}
|
||
[88] = "%1d" -- IFF Check {0, 1}
|
||
}
|
||
|
||
-----------------------------
|
||
-- HIGH IMPORTANCE EXPORTS --
|
||
-- done every export event --
|
||
-----------------------------
|
||
|
||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||
if gES_GlassCockpitType == 1 then
|
||
-- HELIOS Version 1.3
|
||
elseif gES_GlassCockpitType == 2 then
|
||
-- HawgTouch Version 1.6
|
||
-- Altimeter_km, Altimeter_m, Altimeter_Pressure
|
||
SendData("2000", string.format("%0.3f;%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(35),
|
||
mainPanelDevice:get_argument_value(32),
|
||
mainPanelDevice:get_argument_value(33)))
|
||
|
||
-- LwAtt - AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball
|
||
SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(38),
|
||
mainPanelDevice:get_argument_value(37),
|
||
mainPanelDevice:get_argument_value(40),
|
||
mainPanelDevice:get_argument_value(41)))
|
||
|
||
-- LwHead - CompassHeading, CommandedCourse liefert nur 0.000
|
||
SendData("2002", string.format("%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(45),
|
||
mainPanelDevice:get_argument_value(44)))
|
||
|
||
-- LwClock - CLOCK_currtime_hours, CLOCK_currtime_minutes, CLOCK_currtime_seconds, CLOCK_chrono_minutes
|
||
SendData("2003", string.format("%0.3f;%0.3f;%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(21),
|
||
mainPanelDevice:get_argument_value(22),
|
||
mainPanelDevice:get_argument_value(23),
|
||
mainPanelDevice:get_argument_value(27)))
|
||
|
||
-- LwDblP - Oil_Pressure; Fuel_Pressure;
|
||
SendData("2004", string.format("%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(95),
|
||
mainPanelDevice:get_argument_value(94)))
|
||
|
||
-- now not ID
|
||
-- LwAFN2 - AFN2_Horizontal_Needle, AFN2_Vertical_Needle, AFN2_Signal_Lamp
|
||
--SendData("2005", string.format("%0.3f;%0.3f;%0.3f",
|
||
-- mainPanelDevice:get_argument_value(),
|
||
-- mainPanelDevice:get_argument_value(),
|
||
-- mainPanelDevice:get_argument_value()))
|
||
|
||
-- Gear - L_GEAR_UP, L_GEAR_DOWN, R_GEAR_UP, R_GEAR_DOWN, FLAPS_UP, FLAPS_START, FLAPS_DOWN
|
||
SendData("2007", string.format("%0.3f;%0.3f;%0.3f;%0.3f;%0.3f;%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(68),
|
||
mainPanelDevice:get_argument_value(69),
|
||
mainPanelDevice:get_argument_value(70),
|
||
mainPanelDevice:get_argument_value(71),
|
||
mainPanelDevice:get_argument_value(72),
|
||
mainPanelDevice:get_argument_value(73),
|
||
mainPanelDevice:get_argument_value(74)))
|
||
-- Ammo counter 1
|
||
SendData("2008", string.format("%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(52),
|
||
mainPanelDevice:get_argument_value(50)))
|
||
-- Ammo counter 2
|
||
SendData("2009", string.format("%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(55),
|
||
mainPanelDevice:get_argument_value(164)))
|
||
-- Ammo counter 3
|
||
SendData("2010", string.format("%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(58),
|
||
mainPanelDevice:get_argument_value(165)))
|
||
-- Ammo counter 4
|
||
SendData("2011", string.format("%0.3f;%0.3f",
|
||
mainPanelDevice:get_argument_value(61),
|
||
mainPanelDevice:get_argument_value(166)))
|
||
end
|
||
end
|
||
|
||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||
-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll
|
||
-- In der Regel sind das die Statusanzeigen
|
||
|
||
-- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware
|
||
-- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen
|
||
-- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der <20>bergeben DCS ID aus dem Spiel ausliest
|
||
-- 178 ist die DCS ID von dem man die Werte haben will
|
||
-- Description
|
||
-- SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE
|
||
-- SendDataHW("", mainPanelDevice:get_argument_value()) --
|
||
end
|
||
|
||
-----------------------------------------------------
|
||
-- LOW IMPORTANCE EXPORTS --
|
||
-- done every gExportLowTickInterval export events --
|
||
-----------------------------------------------------
|
||
|
||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
||
end
|
||
|
||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||
--[[
|
||
every frame export to hardware
|
||
Example from A-10C
|
||
Get Radio Frequencies
|
||
get data from device
|
||
local UHF_RADIO = GetDevice(54)
|
||
SendDataHW("ExportID", "Format")
|
||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||
]]
|
||
|
||
--=====================================================================================
|
||
--[[
|
||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
||
|
||
local ltmp1 = 0
|
||
for ltmp2 = 0, 13, 1 do
|
||
ltmp1 = list_indication(ltmp2)
|
||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||
end
|
||
]]
|
||
--[[
|
||
local ltmp1 = 0
|
||
for ltmp2 = 1, 73, 1 do
|
||
ltmp1 = GetDevice(ltmp2)
|
||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||
end
|
||
]]
|
||
end
|
||
|
||
-----------------------------
|
||
-- Custom functions --
|
||
-----------------------------
|
||
|
||
function genericRadio(key, value, hardware)
|
||
end
|