Initial commit

This commit is contained in:
mcmicha 2015-07-30 01:35:28 +02:00
commit 103275b10a
23 changed files with 21585 additions and 0 deletions

1241
ExportsModules/A-10A.lua Normal file

File diff suppressed because it is too large Load Diff

1884
ExportsModules/A-10C.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,401 @@
-- Bf-109K-4 Kurfürst
-- Version 0.9.9
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
[1] = "%.4f", -- MW50 pressure {0.0, 3.0}kg/cm2 = {0.0, 1.0}
[2] = "%.4f", -- Airspeed Gauge {0, 100, 150, 200, 700, 750, 900, 1000} = {0.0, 0.1, 0.15, 0.2, 0.7, 0.75, 0.9, 1.0}
-- Artificial horizon Fl_22415
[3] = "%.4f", -- turn indicator {-1.0, 1.0}
[4] = "%.4f", -- Bank {1.0, -1.0}
[5] = "%.4f", -- Pitch {1.0, -1.0}
[6] = "%.4f", -- Slipball {-1.0, 1.0}
[7] = "%.4f", -- Caged {0.0, 1.0}
--Altitude Gauge
[8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0}
[9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0}
[10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0}
--[11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0}
-- AN5730 remote compass
[13] = "%.4f", -- CompassHeading {0.0, 1.0}
--[12] = "%.4f", -- CommandedCourse {0.0, 1.0}
-- AFN2 blind landing system
[14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0}
[15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0}
[16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0}
--Dual-Range Pressure Gauge
[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0}
[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0}
[27] = "%.4f", -- Coolant_Temperature {-1, 0, 130} = {-1, 0, 1}
[28] = "%.4f", -- Oil_Temperature {-1, 0, 130} = {-1, 0, 1}
[29] = "%.4f", -- Engine_RPM {400.0, 3600.0} = {0.0, 1.0}
-- propeller pitch indicator, changed 1hour every 6degrees of pitch change
[30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0}
[31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0}
-- Manifold_Pressure
[32] = "%.4f", -- Manifold_Pressure {0.6, 1.8} = {0.0, 1.0}
--fuel system
[33] = "%.4f", -- Fuel_Tank_Fuselage {-1.0, 0.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0} -- Liters = {-1.0, 0.0, 0.07, 0.175, 0.31, 0.52, 0.73, 0.88, 1.0}
--oxygen pressure indicator
[34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
[35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
-- Variometer
[36] = "%.2f", -- Variometer {-30, -10, -5, 0, 5, 10, 30} = {-0.3, -0.1, -0.05, 0.0, 0.05, 0.1, 0.3}
--Weapon gauges
[40] = "%.4f", -- MG131_0_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
[41] = "%.4f", -- MG131_1_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
[42] = "%.4f", -- MG131_0_Klappanker {0.0, 60.0} = {0.0, 1.0}
[43] = "%.4f", -- MG131_1_Klappanker {0.0, 60.0} = {0.0, 1.0}
[44] = "%1d", -- LeftWing_MG151_Control_Lamp {0.0, 1.0}
[45] = "%1d", -- RightWing_MG151_Control_Lamp {0.0, 1.0}
-- Landing Gear Light
[56] = "%1d", -- LandingGearRedLight {0.0, 1.0}
[57] = "%1d", -- LandingGearGreenLightLeft {0.0, 1.0}
[58] = "%1d", -- LandingGearGreenLightRight {0.0, 1.0}
-- Pitot_Heat_Lamp
[135] = "%1d" -- Pitot_Heat_Lamp {0.0, 29.0} = {0.0, 1.0}
-- Fuel_Reserve_Lamp
--???[135] = "%1d" -- Fuel_Reserve_Lamp
}
gES_GlassCockpitConfigArguments =
{
-- FuseBox Controls - Electrical Switches
-- RH Fuse Box Circuit Breakers
-- Left Row
-- A 100 - Generator Cut-Off Relay
[114] = "%1d", -- Generator On {0, 1}
[151] = "%1d", -- Generator OFF {0, 1}
-- D 100 - Heating CB
[115] = "%1d", -- Pitot/Windscreen Heating On {0, 1}
[152] = "%1d", -- Pitot/Windscreen Heating OFF {0, 1}
-- C 100 - Navigation Lights CB
[116] = "%1d", -- Nav. Lights On {0, 1}
[153] = "%1d", -- Nav. Lights OFF {0, 1}
-- C 101 - Instrument Panel Illumination CB {0, 1}
[117] = "%1d", -- UV Lights On {0, 1}
[154] = "%1d", -- UV Lights Off {0, 1}
-- V 101 - Drop Ordnance & Optional Armament CB
[118] = "%1d", -- Wing / Drop Ordnance On {0, 1}
[155] = "%1d", -- Wing / Drop Ordnance Off {0, 1}
-- V 100 - Systematic & Ignition CB
[119] = "%1d", -- Ignition On {0, 1}
[156] = "%1d", -- Ignition Off {0, 1}
-- Spotlights CB - TODO implement when landing lights rustsatz is available
--[] = "%1d", -- Spotlights On {0, 1}
--[] = "%1d", -- Spotlights Off {0, 1}
-- Right Row
-- A 101 - Battery Cut-Off Relay
[120] = "%1d", -- Battery On {0, 1}
[157] = "%1d", -- Battery Off {0, 1}
-- F 135 - Radio CB - Labelled "FuG 16"
[121] = "%1d", -- Radio On {0, 1}
[158] = "%1d", -- Radio Off {0, 1}
-- F 211 - IFF CB - Labelled "FuG 25a"
[122] = "%1d", -- IFF On {0, 1}
[159] = "%1d", -- IFF Off {0, 1}
-- E 101 - Fuel Pump CB - Labelled "Tankpumpe"
[123] = "%1d", -- Fuel Pump On {0, 1}
[160] = "%1d", -- Fuel Pump Off {0, 1}
-- Ignition Controls and Starter and Motor-Related Switches
-- Magneto Selector
[59] = "%.1f", -- Magnetos (Off, M1, M2, M1+M2) {0.0, 0.1, 0.2, 0.3}
-- Starter Handle Cover
[51] = "%.1d", -- Starter Handle Cover {0, 1}
-- Starter Turn Handle
[52] = "%.1d", -- Starter {0, 1}
-- WM-Kommandgerat Toggle
[62] = "%.1d", -- Governor Automation {0, 1}
-- Dashboard and Secondary Switches
-- A 104 - Kill Switch
[49] = "%.1d", -- Kill Switch {0, 1}
-- Button T - Gun Camera Trigger
[149] = "%.1d", -- Button T {0, 1}
-- SZKK3 Weapons Control Master Switch
[37] = "%.1d", -- Weapons Master {0, 1}
-- LH SZ 500 Ammo Counter
[38] = "%.1f", -- Left Ammo Counter Setter Pinion (axis) {0.0 - 0.0}
-- RH SZ 500 Ammo Counter
[39] = "%.1f", -- Right Ammo Counter Setter Pinion (axis) {0.0 - 0.0}
-- MW50 Operational Toggle
[60] = "%.1d", -- MW50 Boost {0, 1}
-- Wing Cannons Toggle
[61] = "%.1d", -- Wing Cannons {0, 1}
-- MK 108 / Wing Guns Toggle
[62] = "%.1d", -- MK 108 / R 21 {0, 1}
-- R 101 ZSK 244 A Bomb Panel Master Switch
-- Operated internally via ZSK 244 A Mode Control
-- R 101 ZSK 244 A Mode Selector
[64] = "%.1f", -- Bomb Fusing Selector (DIVE (INSTANT), DIVE (DELAYED), OFF, LEVEL (DELAYED), LEVEL (INSTANT)) {0.0, 0.25, 0.5, 0.75, 1.0}
-- Illumination Controls
-- C 102 LH UV Lamp Rheostat
[80] = "%.1f", -- Left UV Lamp Brightness (axis) {0.0 - 0.5}
-- C 103 RH UV Lamp Rheostat
[82] = "%.1f", -- Right UV Lamp Brightness (axis) {0.0 - 0.5}
-- Oxygen Apparatus Controls
-- Apparatus Connecting Valve
[127] = "%.1d", -- Oxygen Operating Valve {0, 1}
[126] = "%.1d", -- Oxygen Emergency By-Pass {0, 1}
-- Main Panel Controls
-- Undercarriage Controls
-- U/C Plungers Cover
[53] = "%.1d", -- Undercarriage Controls Cover {0, 1}
[54] = "%.1d", -- Undercarriage Raise {1.0, 1.0}
[55] = "%.1d", -- Undercarriage Lower {1.0, 1.0}
[63] = "%.1d", -- Undercarriage Emergency Release
-- Fuel and MW50 Systems Controls
-- Fuel Primer Hand Pump
[140] = "%.1d", -- Fuel Priming Pump {0, 1}
-- Schnellstop Lever
[88] = "%.1d", -- Engine Stop {0, 1}
-- Booster Pumps Lever
[87] = "%.1f", -- Booster Pumps (Off, P1, P2, P1+P2) {0.0, 0.1, 0.2, 0.3}
-- Stoff-Kraftstoff Ventilbatterie Lever
[96] = "%.1d", -- MW / Fuel {0, 1}
-- Fuel Jettison Knob
[112] = "%.1d", -- "Fuel / MW Jettison {0, 1}
-- Coolant System Controls
-- Radiator Mode Lever {0, 1}
[113] = "%.1f", -- Radiators Mode (Drive Off, Open, Automatic, Close) {0.0, 0.1, 0.2, 0.3}
-- LH Radiator Hose Cut-Off Pull Handle
[90] = "%.1d", -- LH Radiator Cut-Off {0, 1}
-- RH Radiator Hose Cut-Off Pull Handle
[91] = "%.1d", -- RH Radiator Cut-Off {0, 1}
-- Navigation Instruments
-- Altimeter
[11] = "%.2f", -- Altimeter Pressure Set (axis) 1.0 in 0.04 steps
-- Artificial Horizon
[7] = "%.2f", -- Horizon Cage (axis) {0.0, 0.511} in 0.04 steps
-- Repeater Compass
[12] = "%.2f", -- Course Set (axis) 0.0 in 0.04 steps
-- Instruments
-- Clock Scale
[21] = "%.8f", -- Scale Set (axis) 0.0 in 0.01612434 steps
-- Clock Setter Pinion
[22] = "%.1f", -- Adjusting Knob (axis) 0.0 in 0.1 steps
-- Clock Freeze Lever
[23] = "%.1d", -- Time Setting Lever {0, 1}
-- Clock Stopwatch Button
[24] = "%.1d", -- Start/Stop/Reset Chronometer
-- P 112 Gun Sight Brightness Rheostat {0, 1}
[48] = "%.1f", -- Gun Sight Brightness (axis) 0.5 in 0.1 steps
-- P 112 Gun Sight Folding Controls
[139] = "%.1d", -- Gunsight Fold {0, 1}
-- P 112 Gun Sight Smoked Screen Controls
[47] = "%.1d", -- Gunsight Smoked Screen {0, 1}
-- Radio Controls
-- FUG16
[128] = "%.1f", -- FuG16ZY Preset Selector (1, 2, TR, SQ) {0.0, 0.1, 0.2, 0.3}
[129] = "%.2f", -- FuG16 ZY Fine Tune (axis) 0.5 in 0.05 steps
[130] = "%.2f", -- FuG16 ZY Volume (axis) 0.0 in 0.04 steps
[131] = "%.1d", -- "Mic. On/Off {0, 1}
-- FUG25
[132] = "%.1f", -- FuG25 Mode Selector (1, 2) {0.0, 1.0}
[133] = "%.1d", -- FuG25 Test {0, 1}
-- Left Wall Controls
-- Tail Wheel Lock Handle
[97] = "%.1d", -- Tail Wheel Lock {0, 1}
-- Cockpit Open/Close Control
[136] = "%.1d", -- Canopy (Open/Close) {0, 1}
-- Cockpit Jettison Pull Handle
[83] = "%.1d", -- Jettison Canopy {0, 1}
-- Trim Wheel
[141] = "%.1d", -- Stabilizer Trim Nose Up {0, 1}
[142] = "%.1d", -- Stabilizer Trim Nose Down {0, 1}
-- Flaps Wheel
[143] = "%.1d", -- Extend Flaps {0, 1}
[144] = "%.1d", -- Retract Flaps {0, 1}
-- Notwurf / Ordinance Dump
[92] = "%.1d", -- Ordinance Emergency Release
-- Right Wall Controls
-- RH Cockpit Vent
--[99] = "%.1d", -- Cockpit Vent {0, 1}
-- Flare Gun Trigger
[72] = "%.1d", -- Fire Flare Gun
-- Engine Controls & Quadrant
-- Ground Crew Signal -- TODO remove
[145] = "%.1d", -- Signal Starter Crew {0, 1}
-- Propellor Control Rocker
[85] = "%.1f", -- Decrease RPM {1.0, -1.0}
-- Radio Transmit Button
[150] = "%.1d", -- Microphone On {0, 1}
-- E 103 Propellor Automation Switch
[89] = "%.1d", -- Governor Automation {0, 1}
-- Cold Weather Start Valve Handle
[86] = "%.1d" -- Cold Weather Start {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
-- LwMW50P
--SendData("1", string.format("%0.4f", mainPanelDevice:get_argument_value(1)))
-- LwASI
--SendData("2", string.format("%0.4f", mainPanelDevice:get_argument_value(2)))
-- ME4KH2OTemp
--SendData("27", string.format("%0.4f", mainPanelDevice:get_argument_value(27)))
-- ME4KOilTemp
--SendData("28", string.format("%0.4f", mainPanelDevice:get_argument_value(28)))
-- LwMAP
--SendData("32", string.format("%0.4f", mainPanelDevice:get_argument_value(32)))
-- ME4KFuel
--SendData("33", string.format("%0.4f", mainPanelDevice:get_argument_value(33)))
-- LwO2P
--SendData("34", string.format("%0.4f", mainPanelDevice:get_argument_value(34)))
-- LwBlink
--SendData("35", string.format("%0.4f", mainPanelDevice:get_argument_value(35)))
-- LwVSI
--SendData("36", string.format("%0.4f", mainPanelDevice:get_argument_value(36)))
-- LwALT
--Altimeter_km, Altimeter_m, Altimeter_Pressure
--[8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0}
--[9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0}
--[10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0}
--[11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0}
SendData("2000", string.format("%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(9),
mainPanelDevice:get_argument_value(8),
mainPanelDevice:get_argument_value(10)))
-- LwAtt
--AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball
--[3] = "%.4f", -- turn indicator {-1.0, 1.0}
--[4] = "%.4f", -- Bank {1.0, -1.0}
--[5] = "%.4f", -- Pitch {1.0, -1.0}
--[6] = "%.4f", -- Slipball {-1.0, 1.0}
--[7] = "%.4f", -- Caged {0.0, 1.0}
SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(4),
mainPanelDevice:get_argument_value(5),
mainPanelDevice:get_argument_value(3),
mainPanelDevice:get_argument_value(6)))
-- LwHead
--CompassHeading, CommandedCourse
--[13] = "%.4f", -- CompassHeading {0.0, 1.0}
--[12] = "%.4f", -- CommandedCourse {0.0, 1.0}
SendData("2002", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(13),
mainPanelDevice:get_argument_value(12)))
-- LwClock,
-- No Id for Clock
--CLOCK_currtime_hours, CLOCK_currtime_minutes, CLOCK_currtime_seconds, CLOCK_chrono_minutes
--SendData("2003", string.format("%0.2f;%0.2f;%0.2f;%0.2f", mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value()))
-- LwDblP
--Oil_Pressure; Fuel_Pressure;
--[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0}
--[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0}
SendData("2004", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(26),
mainPanelDevice:get_argument_value(25)))
-- LwAFN2
--AFN2_Horizontal_Needle, AFN2_Vertical_Needle, AFN2_Signal_Lamp
--[14] = "%.4f", -- AFN2_Horizontal_Needle {0.0, 1.0}
--[15] = "%.4f", -- AFN2_Vertical_Needle {-1.0, 1.0}
--[16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0}
SendData("2005", string.format("%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(14),
mainPanelDevice:get_argument_value(15),
mainPanelDevice:get_argument_value(16)))
-- LwProp
--Propeller_Pitch_Hour; Propeller_Pitch_Minute
--[30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0}
--[31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0}
SendData("2006", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(30),
mainPanelDevice:get_argument_value(31)))
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 ü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()) --
SendDataHW("16", mainPanelDevice:get_argument_value(16)) -- AFN2_Signal_Lamp
SendDataHW("35", mainPanelDevice:get_argument_value(35) > 0.8 and 1 or 0) -- Oxygen_Flow_Blinker
SendDataHW("42", mainPanelDevice:get_argument_value(42) > 0.8 and 1 or 0) -- MG131_0_Klappanker
SendDataHW("43", mainPanelDevice:get_argument_value(43) > 0.8 and 1 or 0) -- MG131_1_Klappanker
SendDataHW("44", mainPanelDevice:get_argument_value(44)) -- LeftWing_MG151_Control_Lamp
SendDataHW("45", mainPanelDevice:get_argument_value(45)) -- RightWing_MG151_Control_Lamp
SendDataHW("56", mainPanelDevice:get_argument_value(56)) -- LandingGearRedLight
SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- LandingGearGreenLightLeft
SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- LandingGearGreenLightRight
SendDataHW("135", mainPanelDevice:get_argument_value(135) > 0.8 and 1 or 0) -- Pitot_Heat_Lamp
-- ??? SendDataHW("135", mainPanelDevice:get_argument_value(135)) -- Fuel_Reserve_Lamp
-- Bomb lamps ????
--[[
WriteToLog('AFN2_Signal_Lamp: '..dump(mainPanelDevice:get_argument_value(16)))
WriteToLog('Oxygen_Flow_Blinker: '..dump(mainPanelDevice:get_argument_value(mainPanelDevice:get_argument_value(35))))
WriteToLog('MG131_0_Klappanker: '..dump(mainPanelDevice:get_argument_value(42)))
WriteToLog('MG131_1_Klappanker: '..dump(mainPanelDevice:get_argument_value(43)))
WriteToLog('LeftWing_MG151_Control_Lamp: '..dump(mainPanelDevice:get_argument_value(44)))
WriteToLog('RightWing_MG151_Control_Lamp: '..dump(mainPanelDevice:get_argument_value(46)))
WriteToLog('LandingGearRedLight: '..dump(mainPanelDevice:get_argument_value(56)))
WriteToLog('LandingGearGreenLightLeft: '..dump(mainPanelDevice:get_argument_value(57)))
WriteToLog('LandingGearGreenLightRight: '..dump(mainPanelDevice:get_argument_value(58)))
WriteToLog('Pitot_Heat_Lamp: '..dump(mainPanelDevice:get_argument_value(135)))
]]
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
]]
local lRADIO = GetDevice(14)
SendDataHW("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000))
--=====================================================================================
--[[
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, 16, 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

View File

@ -0,0 +1,106 @@
-- modul name
-- Version
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
-- Hier kommen alle Anzeigen rein die in HELOS/HawgTouch angezeigt werden sollen
-- [4] DCS ID, e.g. 4 for AOA
-- "%.4f" Format des Rückgabewerte, z.B. "%.4f" eine Floatzahl mit 4 Nachkommastellen, "%0.1f" eine Floatzahl mit führender 0 und einer Nachkommstelle, "%1d" eine Einstellige dezimalzahl
-- -- AOA, Description of DCS ID
[4] = "%.4f", -- AOA
[] = "", --
}
gES_GlassCockpitConfigArguments =
{
-- Hier kommen alle Schalter rein die in HELOS/HawgTouch angezeigt werden sollen
-- [101] DCS ID from Button, e.g. 22 for PTR-EXT-STORES-JETT (mergency Jettison External Stores)
-- "%.1" Format des Wertes der an DCS gesendet werden soll, Beschreibung siehe oben
-- -- PTR-EXT-STORES-JETT (mergency Jettison External Stores) Description of DCS ID
[101] = "%.1f", -- PTR-EXT-STORES-JETT (mergency Jettison External Stores)
[] = "", --
}
-----------------------------
-- 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
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 ü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)
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
end
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

1229
ExportsModules/F-15C.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,440 @@
-- F-86 Export
-- Version 0.9.9 BETA
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
-- Mechanic clock
[19] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0} = {0.0, 1.0}
[18] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} = {0.0, 1.0}
--[37] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0} = {0.0, 1.0}
--[56] = "%.4f", -- CLOCK_flight_time_meter_status {0.0, 0.2} = {0.0, 1.0}
--[52] = "%.4f", -- CLOCK_flight_hours {0.0, 12.0} = {0.0, 1.0}
--[53] = "%.4f", -- CLOCK_flight_minutes {0.0, 60.0} = {0.0, 1.0}
[37] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0, 60.0} = {0.0, 1.0}
[1006] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0, 60.0} = {0.0, 1.0}
-- flight gauge
-- Airspeeed
[178] = "%.4f", -- Airspeeed {0.0, 25.7, 180.06, 334.4} = {0.0, 0.019, 0.494, 0.965}
[709] = "%.4f", -- AirspeeedDrum {0.0, 51.4444444} = {0.0, 1.0}
[8] = "%.4f", -- AirspeeedM1 {0.0, 25.7, 51.444, 308.67, 334.4} = {0.0, 0.02, 0.1, 0.6, 0.697}
-- Altimeter
[707] = "%.4f", -- Altimeter10000 {0 ,30480} = {0 ,1}
[523] = "%.4f", -- Altimeter1000 {0 ,3048} = {0 ,1}
[524] = "%.4f", -- Altimeter100 {0 ,304.8} = {0 ,1}
[700] = "%.4f", -- AltimeterHG {0 , 91.44} = {0 ,1}
-- Variometer
[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}
-- MachNumber
[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}
-- TurnIndicator
[25] = "%.4f", -- TurnIndicator {-1.0, 1.0}
-- SlipIndicator
[31] = "%.4f", -- SlipIndicator {-1.0, 1.0}
-- Accelerometer
[6] = "%.4f", -- Accelerometer {-5, 0, 10} = {-0.5, 0, 1.0}
[1003] = "%.4f", -- AccelerometerMin {-5.0, 0.0} = {-0.5, 0.0}
[1002] = "%.4f", -- AccelerometerMax {0.0, 10} = {0.0, 1.0}
-- GyroCompass
[711] = "%.4f", -- GyroCompassNeedle {1.0, 0.0}
[712] = "%.4f", -- GyroCompassScale {0.0, 1.0}
-- AttitudeIndicator
[713] = "%.4f", -- AttitudeIndicatorOffFlag {0.0, 1.0} = {1.0, 0.0}
[605] = "%.4f", -- AttitudeIndicatorPitch {-0.27, 0.27}
[606] = "%.4f", -- AttitudeIndicatorBank {1.0, -1.0}
[81] = "%.4f", -- AttitudeIndicatorPitchSphere {-1.0, 1.0}
[1005] = "%.4f", -- AttitudeIndicatorBankNeedle {1.0, -1.0}
-- engine gauges
-- Tachometer
[16] = "%.4f", -- Tachometer {0.0, 0.5, 0.504, 1.1} = {0.012, 0.482, 0.5, 1.0}
-- ExhaustTemperature
[12] = "%.4f", -- ExhaustTemperature {0.0, 1000.0} = {0.0, 1.0}
-- OilPressure
[112] = "%.4f", -- OilPressure {0.0, 100.0} = {0.023, 1.0}
-- FuelFlow
[531] = "%.4f", -- FuelFlow {0.0, 1.2599} = {0.0, 1.0}
-- electric system
[601] = "%.4f", -- VoltageDC {0.0, 30.0} = {0.0, 0.3}
[602] = "%.4f", -- Loadmeter {0.0, 400.0} = {0.0, 1.0}
-- hydraulic system
[109] = "%.4f", -- HydPress {0.0, 1.0} = {0.0, 1.0}
-- fuel system
[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}
-- oxygen system
[353] = "%.4f", -- OxygenPressure {0.0, 500.0} = {0, 1}
[705] = "%.1f", -- OxygenFlowBlinker {0.0, 1.0}
-- air system
[114] = "%.4f", -- CockpitAltimeter {0.0, 15240.0} = {0.0, 1.0}
-- radio compass
[804] = "%.4f", -- ARN6_Band {0.0, 3.0} = {0.0, 1.0}
[800] = "%.4f", -- ARN6_TuningMeter {0.0, 1.0}
[801] = "%.4f", -- ARN6_Tuning {0.0, 0.2} = {0.0, 1.0}
[600] = "%.4f", -- ARN6_Bearing {0.0, 1.0}
[814] = "%.4f", -- ARN6_Scale {1.0, 0.0}
[830] = "%.4f", -- ARN6_FreqScale {0.0, 1.0}
-- light system
[182] = "%.4f", -- IlluminationLights {0.0, 1.0}
[825] = "%.4f", -- StandByCompassLight {0.0, 1.0}
[180] = "%.4f", -- PrimaryInstLights {0.0, 1.0}
[185] = "%.4f", -- AuxiliaryInstrumentLights {0.0, 1.0}
[603] = "%.4f", -- LABS_roll_needle {-1.0, 1.0}
[604] = "%.4f", -- LABS_pitch_needle {-1.0, 1.0}
-- LAMPS
-- electric system
[617] = "%.1f", -- lamp_ELEC_GenOff {-1.0, 1.0}
[610] = "%.1f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
[611] = "%.1f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
[612] = "%.1f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
-- hydraulic system
[614] = "%.1f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
[39] = "%.1f", -- lamp_HYDRO_LeftGear {-1.0, 1.0}
[41] = "%.1f", -- lamp_HYDRO_RightGear {-1.0, 1.0}
[40] = "%.1f", -- lamp_HYDRO_NoseGear {-1.0, 1.0}
-- fuel system
[625] = "%.1f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
-- fire detection system
[615] = "%.1f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
[616] = "%.1f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
-- control system
[613] = "%.1f" -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
}
gES_GlassCockpitConfigArguments =
{
-- cockpit mechanics
[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0}
[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0}
[817] = "%.1f", -- Canopy Alternate Emergency Jettison Handle, IN/OUT {0.0, 1.0}
[816] = "%.1f", -- Canopy Declutch Handle, IN/OUT {0.0, 1.0}
-- electric
[653] = "%1d", -- Battery-Starter Switch, BATTERY/OFF/STARTER {-1, 1}
[643] = "%.1f", -- Instrument Power Switch, ALTERNATE/NORMAL {-1.0, 1.0}
[664] = "%.1f", -- Stop-Starter Button (Push to de-energize starter in case of malfunction) {0.0, 1.0}
[652] = "%1d", -- Engine Master Switch, ON/OFF {1}
[670] = "%.1f", -- Generator Switch, ON/OFF/RESET {1}
[687] = "%1d", -- Generator Warning Light (Push To Test) {1}
[680] = "%1d", -- Main Instrument (Three-phase) Inverter Failure Warning Light (Push to test) {1}
[681] = "%1d", -- Both Instrument (Main and alternate three-phase) Inverter Failure Warning Light (Push to test) {1}
[682] = "%1d", -- Main Radar (Single-phase) Inverter Failure Warning Light (Push to test) {1}
-- Circuit Breaker (left panel)
[760] = "%1d", -- Bomb Rocket Tank Salvo {0, 1}
[761] = "%1d", -- Bomb Sel. {0, 1}
[762] = "%1d", -- Gyr'Syn Compass {0, 1}
[763] = "%1d", -- 3f Inverter {0, 1}
[764] = "%1d", -- Turn Bank Ind. {0, 1}
[765] = "%1d", -- Rudder Trim & Take-Off Ind. {0, 1}
[766] = "%1d", -- Alt Ail. Trim {0, 1}
[767] = "%1d", -- Ail & Horiz. Trim & Alt Horiz. Trim {0, 1}
[768] = "%1d", -- LDG Light Control {0, 1}
[769] = "%1d", -- LDG Lights {0, 1}
[770] = "%1d", -- Fire Warn. {0, 1}
[771] = "%1d", -- Bus Tie-In Control {0, 1}
[772] = "%1d", -- Speed Brake {0, 1}
[773] = "%1d", -- Free Air & Oil Temp & Air Sel. {0, 1}
[774] = "%1d", -- LDG Gear Warn. {0, 1}
[775] = "%1d", -- LDG Gear Control {0, 1}
[776] = "%1d", -- LDG Gear Pos Ind. {0, 1}
[777] = "%1d", -- Fuel Booster AFT {0, 1}
[778] = "%1d", -- Alt Emerg. Hyd. Cont. & Hyd. Press Ind. {0, 1}
[779] = "%1d", -- Sight Power {0, 1}
[780] = "%1d", -- Sight Heater {0, 1}
[781] = "%1d", -- Sight A.C. Power Unit {0, 1}
[782] = "%1d", -- AN/ARN-6 Radio Compass {0, 1}
-- Circuit Breaker (right panel)
[783] = "%1d", -- Eng. Master Fuel Shut-Off {0, 1}
[784] = "%1d", -- Eng. Ign. {0, 1}
[785] = "%1d", -- Fuel Level {0, 1}
[786] = "%1d", -- Inv Gen. Failure Overvolt LTS Test {0, 1}
[787] = "%1d", -- Light Post IndCode {0, 1}
[788] = "%1d", -- Console & Ped LTS {0, 1}
[789] = "%1d", -- Fuel Boost FWD {0, 1}
[790] = "%1d", -- Wing Flap LH. {0, 1}
[791] = "%1d", -- Wing Flap RH. {0, 1}
[792] = "%1d", -- Light Fluor {0, 1}
[793] = "%1d", -- Sight Control {0, 1}
[794] = "%1d", -- AN/APC 3 Radio {0, 1}
[795] = "%1d", -- AN/APX-6 Radio IFF {0, 1}
-- Hydraulic Interface
[599] = "%1d", -- Landing Gear Handle, UP/DOWN {1, 0}
[710] = "%1d", -- Landing Gear Emergency-up Button (Ground-use only! Hold in until gear retracts completely) {1}
[631] = "%1d", -- Hydraulic Pressure Gage and Selector Switch, UTILITY/NORMAL/ALTERNATE {1}
[641] = "%1d", -- Speed Brake Emergency Lever {1, 0}
[684] = "%1d", -- Alternate-on Warning Light (Push to test) {1}
[706] = "%1d", -- Alternate Hydraulic Emergency Override Handle, IN/OUT {1, -1}
[647] = "%1d", -- Flight Control Switch, ALTERNATE ON/NORMAL/RESET {1}
[815] = "%1d", -- Landing Gear Warning Horn Cutout Button (Push to silence horn) {1}
-- Fuel Interface
[672] = "%1d", -- Fuel Densitometer Selection Switch, IN/OUT {2, -2}
[662] = "%.1f", -- Drop Tank Selector Switch {-0.1, 0.1}
[701] = "%1d", -- Drop Tank Jettison Button - Push to release drop tank(s) {1}
[695] = "%1d", -- Outboard Drop Tank Empty Indicator Light (Push to test) {1}
-- Oxygen Interface
[703] = "%1d", -- Oxygen Regulator Diluter Lever, NORMAL OXYGEN/100% OXYGEN {1, -1}
[704] = "%.4f", -- Oxygen Regulator Supply Lever (rotary) {0.0 to 1.0} in -0.5 steps
-- Fire Detection Interface
[635] = "%1d", -- Engine Fire Detector System Test Button {1,- 1}
[685] = "%1d", -- Forward Engine Compartment Fire-warning Light (Push to test) {1}
[686] = "%1d", -- Aft Engine Compartment Fire-warning Light (Push to test) {1}
-- Air Interface
[650] = "%1d", -- Cockpit Pressure Control Switch, PRESS/RAM {2, -2}
[651] = "%1d", -- Cockpit Pressure Schedule Selector Switch, 5 PSI/2.75 PSI {2, -2}
[646] = "%1d", -- Pitot Heater Switch, ON/OFF {2, -2}
[740] = "%.4f", -- Cockpit Air Temperature Control Rheostat (rotary) {0.0, 1.0} in 0.3 steps
--[736] = "%1d", -- Cockpit Air Temperature Control Switch Cover {1, -1}
[737] = "%.1f", -- Cockpit Air Temperature Control Switch, AUTO/OFF/HOT/COLD {-1.0, 1.0}
[645] = "%.1f", -- Engine Anti-Ice & Screen Switch, EXTEND/RET./ANTI-ICE {-1.0, 1.0}
[741] = "%1d", -- Air Outlet Selector Lever, FLOOR/BOTH/DEFROST {-1, 1}
-- Light Interface
[654] = "%1d", -- Compass Light Switch, ON/OFF {2, -2}
[813] = "%.1f", -- Instrument Panel Primary Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps
[811] = "%.1f", -- Instrument Panel Auxiliary Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps
[812] = "%.1f", -- Console and Panel Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps
-- Nav Lights Interface
[661] = "%.1f", -- Landing & Taxi Lights Switch, EXTEND&ON/OFF/RETRACT {-1.0, 0.0, 1.0}
[656] = "%.1f", -- Position and Fuselage Light Selector Switch, STEADY/OFF/FLASH {-1.0, 0.0, 1.0}
[655] = "%1d", -- Exterior Lighting Dimmer Switch, BRIGHT/DIM {2, -2}
-- Engine Interface
[630] = "%1d", -- Emergency Fuel Switch, ON/OFF {2, -2}
--[732] = "%1d", -- Emergency (In-air) Ignition Switch Cover {1, -1}
[733] = "%.1f", -- Emergency (In-air) Ignition Switch, ON/OFF {1.0, 1.0}
-- Control Interface
[649] = "%.1f", -- Lateral Alternate Trim Switch, NORMAL/OFF/LEFT/RIGHT {-0.1, 0.1}
[648] = "%.1f", -- Rudder Trim Switch, LEFT/OFF/RIGHT {-1.0, 1.0}
--[738] = "%1d", -- Longitudinal Alternate Trim Switch Cover {1, -1}
[739] = "%.1f", -- Longitudinal Alternate Trim Switch, NORMAL GRIP CONT/OFF/NOSE UP/NOSE DOWN {-0.1, 0.0, 0.1}
[683] = "%1d", -- Take-off (Trim) Position Indicator Light (Push to test) {1}
[735] = "%1d", -- Wing Flaps Handle {-1, 1}
-- radio ARC-27
[806] = "%.4f", -- AN/ARC-27 UHF Audio Volume Knob (rotary) {0.1, 0.9} in 0.5 steps
[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}
[805] = "%.1f", -- AN/ARC-27 UHF Power Switch, OFF/T/R/T/R + G REC/ADF {0.0, 0.1, 0.2, 0.3}
-- radio compass ARN-6
[802] = "%.4f", -- AN/ARN-6 Audio Volume Control (rotary) {0.1, 0.9} in 0.5 steps
[803] = "%.1f", -- AN/ARN-6 Frequency Band Switch {0.0, 0.1, 0.2, 0.3}
[667] = "%.1f", -- AN/ARN-6 Function Selector Switch, OFF/COMP/ANT./LOOP/CONT. {0.0, 0.1, 0.2, 0.3}
[666] = "%.1f", -- AN/ARN-6 LOOP L-R Switch {-1.0, 0.0, 1.0}
--[null] = "%.4f", -- AN/ARN-6 Tuning Crank {0.0, 1.0} in 0.01 steps
[657] = "%.1f", -- AN/ARN-6 Scale Light Switch, HI/OFF/LO {-0.1, 0.0, 0.1}
[826] = "%.4f", -- AN/ARN-6 East/West Variation Knob (rotary) {0.0, 1.0} in 0.05 steps
-- IFF APX-6
[810] = "%.1f", -- AN/APX-6 IFF Master Switch, EMERGENCY/NORM/LOW/STDBY/OFF {0.0, 0.1, 0.2, 0.3, 0.4}
[659] = "%.1f", -- AN/APX-6 IFF Mode 2 Switch, MODE 2/OUT/I/P {-0.1, 0.0, 0.1}
[660] = "%.1f", -- AN/APX-6 IFF Mode 3 Switch, MODE 3/OUT {0.0, 0.1}
--[808] = "%1d", -- AN/APX-6 IFF Destruct Switch Cover {1, -1}
[809] = "%1d", -- AN/APX-6 IFF Destruct Switch, OFF/ON {0, -1}
-- baro altimeter
--[null] = "%.4f", -- Altimeter reference pressure adjusting knob (rotary) {0.0, 1.0} in 0.1 steps
-- gyromag compass
--[null] = "%.4f", -- Compass Correction (rotary) {0.0, 1.0} in 0.05 steps
[598] = "%.1f", -- Directional Indicator Fast Slaving Switch {0.0, 1.0}
-- attitude indicator
[714] = "%.1f", -- Pull to Cage Knob {0.0, 1.0}
-- accelerometer
[1004] = "%.1f", -- Accelerometer Reset Knob {0.0, 1.0}
-- CLOCK
--[null] = "%1d", -- Set Clock Knob
[831] = "%1d", -- Elapsed Time Mechanism Button {0, 1}
-- A4 Gun Sight
[716] = "%.4f", -- A-4 Sight Wing Span Adjustment Knob (rotary) {0.0, 1.0} in 0.1 steps
[715] = "%.4f", -- A-4 Sight Radar Range Sweep Rheostat (rotary) {0.0, 1.0} in 0.1 steps
[734] = "%.4f", -- A-4 Sight Reticle Dimmer Control (rotary) {0, 0.74} in -0.2 steps
[755] = "%1d", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE {0, 1}
[755] = "%.4f", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE (rotary) {0.001, 0.999}
[642] = "%1d", -- A-4 Sight Filament Selector Switch, SECONDARY/PRIMARY {2, -2}
[721] = "%.1f", -- Variable Sight Selector Unit - Sight Function Selector Lever, ROCKET/GUN/BOMB {0.0, 0.1, 0.2}
[720] = "%1d", -- Variable Sight Selector Unit - Target Speed Switch, HI/LO {1, -1}
[722] = "%.4f", -- Variable Sight Selector Unit - Rocket Depression Angle Selector (rotary) {0.0, 1.0} in 0.6 steps
[727] = "%.4f", -- Bomb-Target Wind Control Knob (rotary) {0.0, 1.0} in 0.6 steps
-- weapon system
[639] = "", -- Demolition Bomb Release Selector Switch, AUTO RELEASE/MANUAL RELEASE {2,-2}
[641] = "%.1f", -- Demolition Bomb Arming Switch (Fuze Selection), ARM NOSE&TAIL/OFF/TAIL ONLY {-1.0, 0.0, 1.0}
[752] = "%.1f", -- Demolition Bomb Sequence Selector Switch, ALL/OFF/LEFT/RIGHT {0.0, 0.1, 0.2, 0.3, 0.4, 0.5}
[638] = "%.1f", -- Rocket Fuze (Arming) Switch, DELAY/OFF/INSTANT {-1.0, 0.0, 1.0}
[637] = "%1d", -- Rocket Jettison Switch, READY/OFF {2, -2}
--[750] = "%1d", -- Rocket Release Selector Switch Cover {1, -1}
[751] = "%.1f", -- Rocket Release Selector Switch, SINGLE/OFF/AUTO {-1.0, 0.0, 1.0}
[668] = "%.1f", -- Gun Selector Switch {-0.2, 0.2}
[665] = "%.1f", -- Gun-Missile Selector Switch, OFF/SIGHT CAMERA & RADAR/GUNS/MISSILE {0, 0.3}
[636] = "%1d", -- Gun Heater Switch, HEATER/OFF {2,- 2}
[663] = "%1d", -- Manual Pip Control Switch, BOMB/NORMAL {2, -2}
[796] = "%.1f", -- Manual Pip Control Change Calibrated Dials (Presets) {0.0, 0.3, 0.6, 0.9}
[797] = "%.4f", -- Manual Pip Control Knob (rotary) {0.0, 1.0} in 0.1 steps
[729] = "%.4f", -- A-4 Sight Bombing Altimeter Target Altitude Knob (rotary) {0.0, 1.0} in 0.015 steps
[731] = "%.4f", -- A-4 Sight Bombing Altimeter Index Altitude Handle (rotary) {0.0, 1.0} in -0.015 steps
[632] = "%1d", -- LABS Gyro Caging Switch, UNCAGE/CAGE {2,- 2}
[633] = "%1d", -- LABS Start Switch, ON/OFF {2, -2}
[634] = "%1d", -- LABS Change-over Switch, LABS/A-4 {2, -2}
[702] = "%1d", -- Bomb-Rocket-Tank Jettison Button {0.0, 1.0}
[820] = "%.1f", -- Missile Control Switch, LH & RH/RH/SALVO {-1.0, 0.0, 1.0}
[821] = "%.4f", -- Tone Volume (rotary) {0.0, 1.0} in 0.1 steps
[822] = "%.1f", -- Safe Launch Button {0.0, 1.0}
[1001] = "%.1f" -- Rocket Intervalometer {0.0, 1.0}
}
-----------------------------
-- 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
-- ACC
-- Accelerometer; AccelerometerMin; AccelerometerMax;
SendData(2001, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(6),
mainPanelDevice:get_argument_value(1003),
mainPanelDevice:get_argument_value(1002)))
-- ADI
-- AttitudeIndicatorPitch; AttitudeIndicatorBank; AttitudeIndicatorPitchSphere; AttitudeIndicatorBankNeedle; AttitudeIndicatorOffFlag
SendData(2002, string.format("%.4f;%.4f;%.4f;%.4f;%.1f",
mainPanelDevice:get_argument_value(605),
mainPanelDevice:get_argument_value(606),
mainPanelDevice:get_argument_value(81),
mainPanelDevice:get_argument_value(1005),
mainPanelDevice:get_argument_value(713)))
-- Altimeter
-- Altimeter10000; Altimeter1000; Altimeter100; AltimeterHG
SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(707),
mainPanelDevice:get_argument_value(523),
mainPanelDevice:get_argument_value(524),
mainPanelDevice:get_argument_value(700)))
-- Airspeed
-- Airspeed; AirspeedDrum; AirspeedM1
SendData(2004, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(178),
mainPanelDevice:get_argument_value(709),
mainPanelDevice:get_argument_value(8)))
-- RMI
-- ARN6_Bearing; ARN6_Scale
SendData(2008, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(600),
mainPanelDevice:get_argument_value(814)))
-- Clock
-- CLOCK_currtime_hours; CLOCK_currtime_minutes; CLOCK_currtime_seconds; CLOCK_seconds_meter_time_minutes; CLOCK_seconds_meter_time_seconds
-- CLOCK_currtime_hours; CLOCK_currtime_minutes; <= Beta
SendData(2005, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(19),
mainPanelDevice:get_argument_value(18)))
-- GyroCompass
-- GyroCompassNeedle; GyroCompassScale
SendData(2006, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(711),
mainPanelDevice:get_argument_value(712)))
-- Labs
-- LABS_roll_needle; LABS_pitch_needle
SendData(2007, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(603),
mainPanelDevice:get_argument_value(604)))
-- RMI
-- ARN6_Bearing; ARN6_Scale
SendData(2008, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(600),
mainPanelDevice:get_argument_value(814)))
-- Gear
-- Left; Right; Front
SendData(2010, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(39),
mainPanelDevice:get_argument_value(41),
mainPanelDevice:get_argument_value(40)))
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
-- light system
SendDataHW("182", mainPanelDevice:get_argument_value(182)) -- IlluminationLights {0.0, 1.0}
SendDataHW("825", mainPanelDevice:get_argument_value(825)) -- StandByCompassLight {0.0, 1.0}
SendDataHW("180", mainPanelDevice:get_argument_value(180)) -- PrimaryInstLights {0.0, 1.0}
SendDataHW("185", mainPanelDevice:get_argument_value(185)) -- AuxiliaryInstrumentLights {0.0, 1.0}
-- LAMPS
-- electric system
SendDataHW("617", mainPanelDevice:get_argument_value(617)) -- lamp_ELEC_GenOff {-1.0, 1.0}
SendDataHW("610", mainPanelDevice:get_argument_value(610)) -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
SendDataHW("611", mainPanelDevice:get_argument_value(611)) -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
SendDataHW("612", mainPanelDevice:get_argument_value(612)) -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
-- hydraulic system
SendDataHW("614", mainPanelDevice:get_argument_value(614)) -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
SendDataHW("39", mainPanelDevice:get_argument_value(39)) -- lamp_HYDRO_LeftGear {-1.0, 1.0}
SendDataHW("41", mainPanelDevice:get_argument_value(41)) -- lamp_HYDRO_RightGear {-1.0, 1.0}
SendDataHW("40", mainPanelDevice:get_argument_value(40)) -- lamp_HYDRO_NoseGear {-1.0, 1.0}
-- fuel system
SendDataHW("625", mainPanelDevice:get_argument_value(625)) -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
-- fire detection system
SendDataHW("615", mainPanelDevice:get_argument_value(615)) -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
SendDataHW("616", mainPanelDevice:get_argument_value(616)) -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
-- control system
SendDataHW("613", mainPanelDevice:get_argument_value(613)) -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
end
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

File diff suppressed because it is too large Load Diff

320
ExportsModules/FW-190D9.lua Normal file
View File

@ -0,0 +1,320 @@
-- 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

2015
ExportsModules/Ka-50.lua Normal file

File diff suppressed because it is too large Load Diff

1318
ExportsModules/Mi-8MT.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,454 @@
-- MiG-15Bis
-- Version 0.9.9 BETA
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
-- arguments for export every frame
-- based of "mainpanel_init.lua"
[225] = "%.4f", -- Canopy
[223] = "%.4f", -- LeftCanopyLever
[222] = "%.4f", -- RightCanopyLever
[224] = "%.4f", -- AftCanopyLever
[14] = "%.4f", -- Variometer
[28] = "%.4f", -- Altimeter_km
[29] = "%.4f", -- Altimeter_m
[31] = "%.4f", -- Altimeter_Pressure
[15] = "%.4f", -- CLOCK_currtime_hours
[16] = "%.4f", -- CLOCK_currtime_minutes
[22] = "%.4f", -- CLOCK_flight_time_meter_status
[18] = "%.4f", -- CLOCK_flight_hours
[19] = "%.4f", -- CLOCK_flight_minutes
[20] = "%.4f", -- CLOCK_seconds_meter_time_minutes
[17] = "%.4f", -- CLOCK_seconds_meter_time_seconds
[4] = "%.4f", -- IAS
[5] = "%.4f", -- TAS
[27] = "%.4f", -- MACH
[6] = "%.4f", -- AGK_47B_roll
[7] = "%.4f", -- AGK_47B_pitch
[11] = "%.4f", -- AGK_47B_failure_flag
[8] = "%.4f", -- AGK_47B_sideslip
[9] = "%.4f", -- AGK_47B_turn
[10] = "%.4f", -- AGK_47B_horizon
[35] = "%.4f", -- PRV_46_RAlt
[32] = "%.4f", -- PDK-45 HeadingScale
[33] = "%.4f", -- PDK-45 Heading
-- Weapon System
[95] = "%.4f", -- N37D_Ready_Lamp
[93] = "%.4f", -- NR23_TOP_Ready_Lamp
[94] = "%.4f", -- NR23_BOTTOM_Ready_Lamp
[100] = "%.4f", -- Tactical_Rel_Lamp
[98] = "%.4f", -- LEFT_BOMB_Lamp
[99] = "%.4f", -- RIGHT_BOMB_Lamp
-- electric system
[83] = "%.4f", -- VoltAmperMeter
[244] = "%.4f", -- lamps_lightness
-- hydraulic system
[168] = "%.4f", -- HydraulicPressureMain
[139] = "%.4f", -- HydraulicPressureGain
[169] = "%.4f", -- HydraulicPressureAirFlaps
[165] = "%.4f", -- HydraulicPressureAirGears
[172] = "%.4f", -- HydraulicPressureMainAir
-- gear system
[121] = "%.4f", -- LeftBrakePressure
[122] = "%.4f", -- RightBrakePressure
-- fuel system
[47] = "%.4f", -- FuelQuantity
-- air system
[188] = "%.4f", -- CanopyAirValveIndication
[39] = "%.4f", -- CockpitAltitude
[40] = "%.4f", -- PressureDifference
-- oxygen system
[48] = "%.4f", -- OxygenPressure
[60] = "%.4f", -- FlowBlinker
[49] = "%.4f", -- FlowPressure
-- Engine
[42] = "%.4f", -- EngineTachometer
[41] = "%.4f", -- EngineTemperature
[45] = "%.4f", -- OilTemperature
[44] = "%.4f", -- OilPressure
[43] = "%.4f", -- EngineFuelPressure
[46] = "%.4f", -- FuelPressure
-- radio compass
[238] = "%.4f", -- ARC5_Band
[176] = "%.4f", -- ARC5_TuningMeter
[175] = "%.4f", -- ARC5_Tuning
[38] = "%.4f", -- ARC5_Bearing
[239] = "%.4f", -- ARC5_FreqScale
-- Radio RSI-6K
[235] = "%.4f", -- RadioAntennaPower
[128] = "%.4f", -- RadioReceiverKnob
[127] = "%.4f", -- RadioReceiverInd
[144] = "%.4f", -- RadioReceiverGauge
[245] = "%.4f", -- ASP_3N_Range
-- Lamps
-- electric system
[57] = "%.4f", -- lamp_GeneratorOff
[58] = "%.4f", -- lamp_Ignition
-- power plant
[119] = "%.4f", -- lamp_IsolatingValve
-- gear system
[75] = "%.4f", -- lamp_LeftGearExt
[74] = "%.4f", -- lamp_LeftGearRet
[79] = "%.4f", -- lamp_RightGearExt
[78] = "%.4f", -- lamp_RightGearRet
[77] = "%.4f", -- lamp_NoseGearExt
[76] = "%.4f", -- lamp_NoseGearRet
[53] = "%.4f", -- lamp_ExtendGears
-- fuel system
[56] = "%.4f", -- lamp_Remain300
[50] = "%.4f", -- lamp_AftEmpty
[52] = "%.4f", -- lamp_DropTanks
[51] = "%.4f", -- lamp_BoostPressure
-- control system
[113] = "%.4f", -- lamp_TrimmerNeutral
[59] = "%.4f", -- lamp_FlapsExt
[124] = "%.4f", -- lamp_AirBrakeExt
-- fire extinguisher system
[135] = "%.4f", -- lamp_FireDetected
-- ARC-5
[183] = "%.4f", -- lamp_ARC_5
[218] = "%.4f", -- light_ARC_5_scale
-- MRP-48P
[54] = "%.4f", -- lamp_Marker
-- Light System
[226] = "%.4f", -- light_LeftUV
[215] = "%.4f", -- light_CenterUV
[227] = "%.4f", -- light_RightUV
[217] = "%.4f", -- light_Panels
[216] = "%.4f", -- light_AuxLeftPanel
-- Gun Camera
[55] = "%.4f" -- lamp_GunCamera
}
gES_GlassCockpitConfigArguments =
{
--[[
arguments for export in low tick interval
based on "clickabledata.lua"
]]
-- Cockpit mechanics
[221] = "%.4f", -- Emergency Canopy Jettison - Pull to jettison
[222] = "%.4f", -- Right Canopy Lever, OPEN/CLOSE
[224] = "%.4f", -- Aft Canopy Lever, OPEN/CLOSE
-- Control system
[114] = "%.4f", -- Elevator Trimmer Switch, PULL(CLIMB)/OFF/PUSH(DESCEND)
[142] = "%.4f", -- Aileron Trimmer Switch, LEFT/OFF/RIGHT
[207] = "%.4f", -- Wing Flaps Handle, RETRACT/NEUTRAL/20 degrees/55 degrees
[125] = "%.4f", -- Airbrake Switch, CLOSE/OPEN
[203] = "%.4f", -- Hydro Booster Lever, ON/OFF
[204] = "%.4f", -- Throttle Friction Lever
[198] = "%.4f", -- Airbrake Button, Hold to extend
-- Electric system
[84] = "%.4f", -- Ampere- & Voltmeter - Push to view Volts
[149] = "%.4f", -- Air Start Switch, ON/OFF
[81] = "%.4f", -- Pitot and Clock Heater Switch, ON/OFF
[200] = "%.4f", -- Engine Start Button - Push to start
[214] = "%.4f", -- Engine Start Button Cover
-- Circuit Breakers
[117] = "%.4f", -- Transfer Pump Switch, ON/OFF
[115] = "%.4f", -- Booster Pump Switch, ON/OFF
[120] = "%.4f", -- Ignition Switch, ON/OFF
[116] = "%.4f", -- Instruments and Lights Switch, ON/OFF
-- Right Panel
[152] = "%.4f", -- Accumulator Switch, ON/OFF
[153] = "%.4f", -- Generator Switch, ON/OFF
[151] = "%.4f", -- Nose Light Master Switch, ON/OFF
[154] = "%.4f", -- Trim Master Switch, ON/OFF
[155] = "%.4f", -- AGK-47B Artificial Horizon + DGMK-3 Switch, ON/OFF
[158] = "%.4f", -- Radio Switch, ON/OFF
[157] = "%.4f", -- Bombs Switch, ON/OFF
[156] = "%.4f", -- Emergency Drop Switch, ON/OFF
[159] = "%.4f", -- ARC Switch, ON/OFF
[160] = "%.4f", -- RV-2 Radio Altimeter Switch, ON/OFF
[161] = "%.4f", -- NR-23 Cannon Switch, ON/OFF
[162] = "%.4f", -- N-37D Cannon Switch, ON/OFF
[163] = "%.4f", -- ASP-3N Gunsight Switch, ON/OFF
[164] = "%.4f", -- S-13 Gun Camera Switch, ON/OFF
-- HydroSystem
[171] = "%.4f", -- Emergency Flaps Valve
[167] = "%.4f", -- Emergency Gears Valve
[170] = "%.4f", -- Emergency Flaps Valve Cover
[166] = "%.4f", -- Emergency Gears Valve Cover
[186] = "%.4f", -- Emergency System Filling Valve
[242] = "%.4f", -- Air Net Valve
[241] = "%.4f", -- Cockpit Filling Valve
-- Gear System
[71] = "%.4f", -- Landing Gear Handle, UP/DOWN
[72] = "%.4f", -- Gear Lamps Test Button - Push to test
[210] = "%.4f", -- Right Emergency Gear Release Handle
[209] = "%.4f", -- Left Emergency Gear Release Handle
[85] = "%.4f", -- Landing Gear Handle Lock, Lock/Unlock
-- Fuel System
[82] = "%.4f", -- Drop Tank Signal Switch, ON/OFF
[141] = "%.4f", -- Oxygen Supply Valve
[143] = "%.4f", -- Air Valve
[243] = "%.4f", -- Oxygen Emergency Valve
-- Conditioning and Heating System
[187] = "%.4f", -- Cockpit Air Valve
[86] = "%.4f", -- Ventilation Valve
-- Internal Lights System
[184] = "%.4f", -- Left UV Light Rheostat
[185] = "%.4f", -- Right UV Light Rheostat
[220] = "%.4f", -- Panels Light Rheostat
-- Nav Lights System
[111] = "%.4f", -- External Lights Switch, ON/OFF
[80] = "%.4f", -- Nose Light Switch, ON/OFF
-- Power Plant
[208] = "%.4f", -- Engine Stop, CLOSE/OPEN
[118] = "%.4f", -- Isolating Valve Switch, ON/OFF
-- Fire Extinguisher System
[136] = "%.4f", -- Engine Fire Extinguisher Button Cover
[137] = "%.4f", -- Engine Fire Extinguisher Button
[138] = "%.4f", -- Engine Fire Warning Light Test Button - Push to test
-- Signal Flares
[129] = "%.4f", -- Signal Flare Switch, ON/OFF
[130] = "%.4f", -- Signal Flare Yellow Button
[131] = "%.4f", -- Signal Flare Green Button
[132] = "%.4f", -- Signal Flare Red Button
[133] = "%.4f", -- Signal Flare White Button
----------------------------------------------------
-- Devices
-- AGK-47B
[12] = "%.4f", -- AGK-47B Artificial Horizon Cage - Pull to cage
[13] = "%.4f", -- AGK-47B Artificial Horizon Zero Pitch Trim Knob
--VD-15
[30] = "%.4f", -- Barometric Pressure QFE Knob
--PRV-46
[36] = "%.4f", -- PRV-46 Radar Altimeter Indicator Range Switch, 120m/1200m AGL
[37] = "%.4f", -- PRV-46 Radar Altimeter Indicator Power Switch, ON/OFF
--PDK-45
[34] = "%.4f", -- Heading Knob
[61] = "%.4f", -- Fast Slave Button
-- CLOCK
[23] = "%.4f", -- AChS-1 Cockpit Chronograph Left Knob
[25] = "%.4f", -- AChS-1 Cockpit Chronograph Right Knob
-- Weapon System
[92] = "%.4f", -- N-37D Cannon Reload Button
[90] = "%.4f", -- NR-23 (Top) Cannon Reload Button
[91] = "%.4f", -- NR-23 (Bottom) Cannon Reload Button
[96] = "%.4f", -- Tactical Release Switch, ON/OFF
[97] = "%.4f", -- Emergency Release Button
[104] = "%.4f", -- Emergency Release Button Cover
--ASP-3N Gunsight
[101] = "%.4f", -- ASP-3N Gunsight Mode, GYRO/FIXED
[106] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever
[103] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever
[102] = "%.4f", -- ASP-3N Gunsight Brightness Knob
[201] = "%.4f", -- ASP-3N Gunsight Target Distance
[105] = "%.4f", -- ASP-3N Gunsight Color Filter, ON/OFF
-- ARC-5 radio compass
[180] = "%.4f", -- ARC-5 Audio Volume Control
[177] = "%.4f", -- ARC-5 Frequency Band Switch
[174] = "%.4f", -- ARC-5 Function Selector Switch, OFF/COMP/ANT./LOOP
[178] = "%.4f", -- ARC-5 LOOP L-R Switch
[175] = "%.4f", -- ARC-5 Tuning Crank
[181] = "%.4f", -- ARC-5 Scale Light Control
[173] = "%.4f", -- ARC-5 TLG-TLF Switch
[182] = "%.4f", -- ARC-5 Take Control Button
[123] = "%.4f", -- ARC-5 Near/Far NDB Switch
[146] = "%.4f", -- ARC-5 NDB 1 Switch
[147] = "%.4f", -- ARC-5 NDB 2 Switch
[148] = "%.4f", -- ARC-5 NDB 3 Switch
-- RSI-6K radio
[126] = "%.4f", -- RSI-6K Audio Volume Control
[232] = "%.4f", -- RSI-6K Wave Control
[230] = "%.4f", -- RSI-6K Antenna Control
[231] = "%.4f", -- RSI-6K Wave Lock
[233] = "%.4f", -- RSI-6K Antenna Lock
[128] = "%.4f", -- RSI-6K Receiver Tuning
[140] = "%.4f", -- RSI-6K Receive/ARC
[240] = "%.4f", -- RSI-6K Forced Mode, ON/OFF
[202] = "%.4f", -- Microphone Button
}
-----------------------------
-- 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
-- ADI
-- AGK_47B_roll;AGK_47B_pitch;AGK_47B_failure_flag;AGK_47B_sideslip;
-- AGK_47B_turn;AGK_47B_horizon
SendData(2001, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.1f",
mainPanelDevice:get_argument_value(6),
mainPanelDevice:get_argument_value(7),
mainPanelDevice:get_argument_value(11),
mainPanelDevice:get_argument_value(8),
mainPanelDevice:get_argument_value(9),
mainPanelDevice:get_argument_value(10)))
-- Altimeter
-- Altimeter_km;Altimeter_m;Altimeter_Pressure
SendData(2002, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(28),
mainPanelDevice:get_argument_value(29),
mainPanelDevice:get_argument_value(31)))
-- Airspeed
-- IAS;TAS
SendData(2003, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(4),
mainPanelDevice:get_argument_value(5)))
-- Brake
-- LeftBrakePressure;RightBrakePressure
SendData(2004, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(121),
mainPanelDevice:get_argument_value(122)))
-- Cockpit
-- CockpitAltitude;PressureDifference;
SendData(2005, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(39),
mainPanelDevice:get_argument_value(40)))
-- FuelFlow
-- OilTemperature;OilPressure;EngineFuelPressure;
SendData(2006, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(45),
mainPanelDevice:get_argument_value(44),
mainPanelDevice:get_argument_value(43)))
-- Gear
-- lamp_LeftGearExt;lamp_LeftGearRet;lamp_RightGearExt;lamp_RightGearRet;lamp_NoseGearExt;
-- lamp_NoseGearRet;lamp_ExtendGears
SendData(2007, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f;%.3f",
mainPanelDevice:get_argument_value(75),
mainPanelDevice:get_argument_value(74),
mainPanelDevice:get_argument_value(79),
mainPanelDevice:get_argument_value(78),
mainPanelDevice:get_argument_value(77),
mainPanelDevice:get_argument_value(76),
mainPanelDevice:get_argument_value(53)))
-- GyroCompass
-- HeadingScale;Heading
SendData(2008, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(32),
mainPanelDevice:get_argument_value(33)))
-- VoltAmpMeter
-- VoltAmperMeter; lamps_lightness;
SendData(2009, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(83),
mainPanelDevice:get_argument_value(244)))
-- Clock
-- CLOCK_currtime_hours;CLOCK_currtime_minutes;CLOCK_flight_time_meter_status;
-- CLOCK_flight_hours; CLOCK_flight_minutes;CLOCK_seconds_meter_time_minutes;
-- CLOCK_seconds_meter_time_seconds
SendData(2010, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f;%.3f",
mainPanelDevice:get_argument_value(15),
mainPanelDevice:get_argument_value(16),
mainPanelDevice:get_argument_value(22),
mainPanelDevice:get_argument_value(18),
mainPanelDevice:get_argument_value(19),
mainPanelDevice:get_argument_value(20),
mainPanelDevice:get_argument_value(17)))
-- Compass
-- heading, pitch, bank
SendData(2011, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(33),
mainPanelDevice:get_argument_value(7),
mainPanelDevice:get_argument_value(6)))
end
end
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
-- SendDataHW("", mainPanelDevice:get_argument_value()) --
-- Lamps
-- electric system
SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- lamp_GeneratorOff
SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- lamp_Ignition
-- power plant
SendDataHW("119", mainPanelDevice:get_argument_value(119)) -- lamp_IsolatingValve
-- gear system
SendDataHW("75", mainPanelDevice:get_argument_value(75)) -- lamp_LeftGearExt
SendDataHW("74", mainPanelDevice:get_argument_value(74)) -- lamp_LeftGearRet
SendDataHW("79", mainPanelDevice:get_argument_value(79)) -- lamp_RightGearExt
SendDataHW("78", mainPanelDevice:get_argument_value(78)) -- lamp_RightGearRet
SendDataHW("77", mainPanelDevice:get_argument_value(77)) -- lamp_NoseGearExt
SendDataHW("76", mainPanelDevice:get_argument_value(76)) -- lamp_NoseGearRet
SendDataHW("53", mainPanelDevice:get_argument_value(53)) -- lamp_ExtendGears
-- fuel system
SendDataHW("56", mainPanelDevice:get_argument_value(56)) -- lamp_Remain300
SendDataHW("50", mainPanelDevice:get_argument_value(50)) -- lamp_AftEmpty
SendDataHW("52", mainPanelDevice:get_argument_value(52)) -- lamp_DropTanks
SendDataHW("51", mainPanelDevice:get_argument_value(51)) -- lamp_BoostPressure
-- control system
SendDataHW("113", mainPanelDevice:get_argument_value(113)) -- lamp_TrimmerNeutral
SendDataHW("59", mainPanelDevice:get_argument_value(59)) -- lamp_FlapsExt
SendDataHW("124", mainPanelDevice:get_argument_value(124)) -- lamp_AirBrakeExt
-- fire extinguisher system
SendDataHW("135", mainPanelDevice:get_argument_value(135)) -- lamp_FireDetected
-- ARC-5
SendDataHW("183", mainPanelDevice:get_argument_value(183)) -- lamp_ARC_5
SendDataHW("218", mainPanelDevice:get_argument_value(218)) -- light_ARC_5_scale
-- MRP-48P
SendDataHW("54", mainPanelDevice:get_argument_value(54)) -- lamp_Marker
-- Light System
SendDataHW("226", mainPanelDevice:get_argument_value(226)) -- light_LeftUV
SendDataHW("215", mainPanelDevice:get_argument_value(215)) -- light_CenterUV
SendDataHW("227", mainPanelDevice:get_argument_value(227)) -- light_RightUV
SendDataHW("217", mainPanelDevice:get_argument_value(217)) -- light_Panels
SendDataHW("216", mainPanelDevice:get_argument_value(216)) -- light_AuxLeftPanel
-- Gun Camera
SendDataHW("55", mainPanelDevice:get_argument_value(55)) -- lamp_GunCamera
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
end
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

View File

@ -0,0 +1,831 @@
-- MiG-21Bis Export
-- Version 0.9.9 BETA
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
--[[
every frames arguments
based of "mainpanel_init.lua"
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
[DeviceID] = "Format"
[4] = "%.4f", <- floating-point number with 4 digits after point
[19] = "%0.1f", <- floating-point number with 1 digit after point
[129] = "%1d", <- decimal number
]]
[239] = "%.1f", -- CANOPY_anti_ice
--ALCOHOL, COMPRESSED_AIR other similar stuff == == == == == == == == == == == == == == == == == == == == == == =
[411] = "%.1f", -- ALCOHOL
[413] = "%.1f", -- COMPRESSED_AIR_main
[414] = "%.1f", -- COMPRESSED_AIR_aux
-- OXYGENE SYSTEM (pilot only, engine O2 separated) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[59] = "%.1f", -- OXYGENE_instrument_IK52
[60] = "%.1f", -- OXYGENE_instrument_IK52_blinking_lungs
[58] = "%.1f", -- OXYGENE_instrument_M2000
--GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[9] = "%.1f", -- GEAR_NOSE_UP_LIGHT
[12] = "%.1f", -- GEAR_NOSE_DOWN_LIGHT
[10] = "%.1f", -- GEAR_LEFT_UP_LIGHT
[13] = "%.1f", -- GEAR_LEFT_DOWN_LIGHT
[11] = "%.1f", -- GEAR_RIGHT_UP_LIGHT
[14] = "%.1f", -- GEAR_RIGHT_DOWN_LIGHT
-- AIRBRAKES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[316] = "%.1f", -- AIRBRAKES_button
[7] = "%.1f", -- AIRBRAKES_3D
-- INSTRUMENTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[100] = "%.4f", -- IAS_indicator
[101] = "%.4f", -- TAS_indicator
[102] = "%.4f", -- M_indicator
-- Baro altimeter subgroup --------------------------------------------------------------------------------------------------------------------------
[104] = "%.4f", -- H_indicator_needle_m
[112] = "%.4f", -- H_indicator_needle_km
--/N/ KSI subgroup (NPP) --------------------------------------------------------------------------------------------------------------------------
[178] = "%.1f", -- KSI_switch
[258] = "%.1f", -- KSI_adjust_button
[111] = "%.1f", -- KSI_course_indicator
[68] = "%.1f", -- KSI_course_set_needle
-- RSBN subgroup ------------------------------------------------------------------------------------------------------------------------------------------------
[176] = "%.1f", -- RSBN_switch
[548] = "%.1f", -- RSBN_azimut_korekcija_LIGHT
[549] = "%.1f", -- RSBN_dalnost_korekcija_LIGHT
[417] = "%.1f", -- RSBN_distance_meter
[355] = "%.1f", -- RSBN_distance_meter_Hundreds
[356] = "%.1f", -- RSBN_distance_meter_Tens
[357] = "%.1f", -- RSBN_distance_meter_Singles
[587] = "%.1f", -- RSBN_NPP_kurs_blinker
[588] = "%.1f", -- RSBN_NPP_glisada_blinker
[590] = "%.4f", -- RSBN_NPP_kurs_needle
[589] = "%.4f", -- RSBN_NPP_glisada_needle
[567] = "%.1f", -- RSBN_KPP_kren_blinker
[568] = "%.1f", -- RSBN_KPP_tangaz_blinker
[565] = "%.4f", -- RSBN_KPP_kurs_director
[566] = "%.4f", -- RSBN_KPP_glisada_director
--/N/ ARK subgroup ---------------------------------------------------------------------------------------------------------------------------------
[174] = "%.1f", -- ARK_switch
[254] = "%.1f", -- ARK_dal_bliz_selector
[36] = "%.4f", -- ARK_RSBN_needle
-- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------
[175] = "%.1f", -- RADIO_ALTIMETER_MARKER_switch
[103] = "%.4f", -- RADIO_ALTIMETER_indicator
[500] = "%.1f", -- LOW_ALT_LIGHT
-- UUA and SUA subgroup -----------------------------------------------------------------------------------------------------------------------------------------------------------
[105] = "%.4f", -- UUA_indicator
[537] = "%.1f", -- AOA_WARNING_LIGHT
-- DA-200 subgroup ---------------------------------------------------------------------------------------------------------------------------------------------------------
[107] = "%.6f", -- DA200_TurnNeedle
[106] = "%.4f", -- DA200_VerticalVelocity
[31] = "%.1f", -- DA200_Slipball
[177] = "%.1f", -- KPP_switch
[259] = "%.1f", -- KPP_ARRETIR
[535] = "%.1f", -- KPP_ARRETIR_light
[108] = "%.4f", -- KPP_Bank
[109] = "%.4f", -- KPP_Pitch
-- ACCELEROMETER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[110] = "%.4f", -- ACCELEROMETER
[228] = "%.4f", -- RESET_G_needle
[113] = "%.4f", -- MAX_G_needle
[114] = "%.4f", -- MIN_G_needle
--TRIMMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[172] = "%.1f", -- TRIMMER_switch
[519] = "%.1f", -- TRIMMER_light
--PITOT TUBES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[229] = "%.1f", -- PITOT_TUBES_SELECTOR
[279] = "%.1f", -- PITOT_TUBES_HEATING_main
[280] = "%.1f", -- PITOT_TUBES_HEATING_aux
[406] = "%.1f", -- PITOT_TUBES_STATUS
-- FREEZING EFFECTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[410] = "%.1f", -- FREEZING_level_absolute
[543] = "%.1f", -- FREEZING_EFFECTS_canopy
--/N/ DC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[124] = "%.4f", -- DC_BUS_V_needle
[165] = "%.1f", -- DC_BUS_battery
[155] = "%.1f", -- DC_BUS_battery_heat
[510] = "%.1f", -- DC_GENERATOR_LIGHT
[16666] = "%.1f", -- DC_GENERATOR
[563] = "%.1f", -- DC_BUS
[55] = "%.1f", -- DC_BUS_ISA_K
--/N/ AC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[564] = "%.1f", -- AC_BUS
[15366] = "%.1f", -- AC_BUS_PO7501
[15466] = "%.1f", -- AC_BUS_PO7502
[16466] = "%.1f", -- AC_BUS_Emerg_Inverter
[16966] = "%.1f", -- AC_GENERATOR
[511] = "%.1f", -- AC_GENERATOR_LIGHT
--/N/ FUEL PUMPS & FUEL SYSTEM == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[159] = "%.1f", -- FUEL_PUMP_3
[160] = "%.1f", -- FUEL_PUMP_1
[161] = "%.1f", -- FUEL_PUMP_RASHOD
[402] = "%.4f", -- FUEL_PRESSURE { 0, 45 } ????
[52] = "%.1f", -- FUEL_METER
--FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[501] = "%.1f", -- FUEL_LIGHT_FUELPODC
[502] = "%.1f", -- FUEL_LIGHT_1GR
[503] = "%.1f", -- FUEL_LIGHT_450
[504] = "%.1f", -- FUEL_LIGHT_3GR
[505] = "%.1f", -- FUEL_LIGHT_FUELPODW
[506] = "%.1f", -- FUEL_LIGHT_RASHOD
--ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[403] = "%.1f", -- ENGINE_START_DEVICE_STATUS { -1, 0, 1, 2 }
[509] = "%.1f", -- START_DEVICE_ZAZIG_LIGHT
[415] = "%.1f", -- ENGINE_OXYGENE_STATUS
[61] = "%.4f", -- ENGINE_OXYGENE_manometer
-- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[624] = "%.1f", -- SPS_state
[625] = "%.4f", -- KONUS_efficiency
[626] = "%.4f", -- SOPLO_efficiency
[50] = "%.4f", -- ENGINE_RPM
[670] = "%.4f", -- ENGINE_RPM2
[51] = "%.4f", -- ENGINE_TEMP
[404] = "%.4f", -- ENGINE_STRESS
[507] = "%.1f", -- FORSAZ_1_LIGHT
[508] = "%.1f", -- FORSAZ_2_LIGHT
[512] = "%.1f", -- NOZZLE_LIGHT
[517] = "%.1f", -- KONUS_LIGHT
[513] = "%.1f", -- OIL_LIGHT
[627] = "%.4f", -- OIL_PRESSURE
[534] = "%.1f", -- FIRE_LIGHT
[405] = "%.1f", -- ENGINE_SURGE_DOORS_POZITION { -1, 0, 1 }
-- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[418] = "%.4f", -- PRIMARY_GIDRO_Pressure
[419] = "%.4f", -- SECONDARY_GIDRO_Pressure
[126] = "%.4f", -- PRIMARY_GIDRO_Pressure_needle
[125] = "%.4f", -- SECONDARY_GIDRO_Pressure_needle
[171] = "%.1f", -- GIDRO_NR27_switch
[319] = "%.1f", -- GIDRO_ailerones_busters_switch
[515] = "%.1f", -- HYDRAULIC_LIGHT
[514] = "%.1f", -- BUSTER_LIGHT
--HELMET == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[306] = "%.1f", -- HELMET_heat_man_auto_switch
[310] = "%.1f", -- HELMET_quick_heat_button
[595] = "%.1f", -- HELMET_visor_switch
--AIR CONDITIONING == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[412] = "%.4f", -- AIR_CONDITION_cockpit_temperature
-- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[541] = "%.1f", -- CANOPY_WARNING_LIGHT
[542] = "%.1f", -- SORC_LIGHT
[407] = "%.1f", -- WARNING_LIGHTS_CHECK_STATE
[516] = "%.1f", -- MARKER_LIGHT
[518] = "%.1f", -- STABILISATOR_LIGHT
[520] = "%.1f", -- CHECK_GEAR_LIGHT
[521] = "%.1f", -- FLAPS_LIGHT
[522] = "%.1f", -- AIRBRAKE_LIGHT
[523] = "%.1f", -- CENTRAL_PYLON_LIGHT
[524] = "%.1f", -- RATO_L_LIGHT
[525] = "%.1f", -- RATO_R_LIGHT
[526] = "%.1f", -- PYLON_1_ON_LIGHT
[527] = "%.1f", -- PYLON_2_ON_LIGHT
[528] = "%.1f", -- PYLON_3_ON_LIGHT
[529] = "%.1f", -- PYLON_4_ON_LIGHT
[530] = "%.1f", -- PYLON_1_OFF_LIGHT
[531] = "%.1f", -- PYLON_2_OFF_LIGHT
[532] = "%.1f", -- PYLON_3_OFF_LIGHT
[533] = "%.1f", -- PYLON_4_OFF_LIGHT
-- GIRO DEVICES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[536] = "%.1f", -- GIRO_ARRETIR
[408] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_STATE
[409] = "%.1f", -- GIRO_DA200_KSI_SAU_RLS_STATE
[162] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_switch
[163] = "%.1f", -- GIRO_DA200_KSI_SAU_RLS_switch
-- ASP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[539] = "%.1f", -- ASP_TGT_ACQUIRED_LIGHT
[538] = "%.1f", -- ASP_LAUNCH
[540] = "%.1f", -- ASP_DISENGAGE
[67] = "%.1f", -- GUN_camera_3D
[551] = "%.1f", -- ASP_DISTANCE
[552] = "%.4f", -- ASP_DISTANCE_MISSILE
[553] = "%.1f", -- RADAR_ERROR
[554] = "%.1f", -- RADAR_LOW_ALT
[555] = "%.1f", -- RADAR_FIX_BEAM
[556] = "%.1f", -- ASP_SCALE_BASE
[557] = "%.1f", -- ASP_SCALE_ANGLE
[558] = "%.1f", -- RADAR_LAUNCH
[559] = "%.1f", -- RADAR_MISSILE_HEAD_RDY
[560] = "%.1f", -- RADAR_JAMMED
[561] = "%.1f", -- RADAR_BROKEN
[562] = "%.1f", -- RADAR_DISENGAGE
[571] = "%.1f", -- RADAR_19A_1
[572] = "%.1f", -- RADAR_19A_2
[573] = "%.1f", -- RADAR_19A_3
[574] = "%.1f", -- RADAR_19A_4
[575] = "%.1f", -- RADAR_19A_5
[576] = "%.1f", -- RADAR_19A_6
[577] = "%.1f", -- RADAR_19A_7
[578] = "%.1f", -- RADAR_19A_8
[579] = "%.1f", -- SEAT_HEIGHT
[580] = "%.1f", -- IAB_BOX
[581] = "%.1f", -- IAB_LIGHT_1
[582] = "%.1f", -- IAB_LIGHT_2
[583] = "%.1f", -- IAB_LIGHT_3
[584] = "%.1f", -- MISSILE_55_1
[585] = "%.1f", -- MISSILE_55_2
[586] = "%.1f", -- MISSILE_62
[63] = "%.1f", -- TACTICAL_DROP_ARMED
[591] = "%.1f", -- SPS_BOX
[592] = "%.1f", -- SPS_HIGH
[593] = "%.1f", -- SPS_ILLUMINATION
[594] = "%.1f", -- SPS_LAUNCH
[598] = "%.1f", -- GUV_BOX
[701] = "%.1f", -- GUV_LAUNCH
-- SARPP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[193] = "%.1f", -- SARPP_switch
-- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[546] = "%.1f", -- SAU_stabilization_LIGHT
[547] = "%.1f", -- SAU_privedenie_LIGHT
[544] = "%.1f", -- SAU_landing_COMMAND_LIGHT
[545] = "%.1f", -- SAU_landing_AUTO_LIGHT
-- ARU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[64] = "%.1f", -- ARU_3G_instrument
-- KONUS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[66] = "%.1f", -- KONUS_UPES_3_instrument
-- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[550] = "%.1f", -- GUN_GOTOVN_LIGHT
-- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
[601] = "%.1f", -- SPO_L_F
[602] = "%.1f", -- SPO_R_F
[603] = "%.1f", -- SPO_R_B
[604] = "%.1f", -- SPO_L_B
[605] = "%.1f", -- SPO_MUTED
-- SOD == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[606] = "%.1f", -- SOD_ANSWER
[607] = "%.1f", -- SRZO_ON
[608] = "%.1f", -- SRZO_CODE
[609] = "%.1f", -- SRZO_CIPH
[611] = "%.1f", -- SRZO_ERROR
[613] = "%.1f", -- ASP_BACKLIGHT_ON
[614] = "%.1f", -- ASP_BACKLIGHT_INTENSITY
[618] = "%.1f", -- NEEDLES_PHOSPHOR_LIGHT
[152] = "%.1f", -- RED_PANELLIGHT
[619] = "%.1f", -- RED_FLOODLIGHT
[620] = "%.1f", -- WHITE_PANELLIGHT
[621] = "%.1f", -- RED_INSTRUMENT
[622] = "%.1f", -- ASP_GLASS_LIGHT_INTENSITY
[652] = "%.4f", -- H_indicator_needle_max
[655] = "%.4f", -- COCKPIT_PRESSURE_ALTIMETER
[656] = "%.4f", -- COCKPIT_PRESSURE
}
gES_GlassCockpitConfigArguments =
{
--[[
arguments for export in low tick interval
based on "clickabledata.lua"
]]
-- cockpit mechanics
--[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0}
--[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0}
-- DC & AC buses & giro devices
[165] = "%.1f", -- Battery On/Off
[155] = "%.1f", -- Battery Heat On/Off
[166] = "%.1f", -- DC Generator On/Off
[169] = "%.1f", -- AC Generator On/Off
[153] = "%.1f", -- PO-750 Inverter #1 On/Off
[154] = "%.1f", -- PO-750 Inverter #2 On/Off
[164] = "%.1f", -- Emergency Inverter
-- GIRO
[162] = "%.1f", -- Giro, NPP, SAU, RLS Signal, KPP Power On/Off
[163] = "%.1f", -- DA-200 Signal, Giro, NPP, RLS, SAU Power On/Off
-- FUEL_PUMPS & FUEL_SYSTEM (merged)
[159] = "%.1f", -- Fuel Tanks 3rd Group, Fuel Pump
[160] = "%.1f", -- Fuel Tanks 1st Group, Fuel Pump
[161] = "%.1f", -- Drain Fuel Tank, Fuel Pump
[274] = "%.1f", -- Fuel Quantity Set
-- ENGINE START DEVICE
[302] = "%.1f", -- APU On/Off
[288] = "%.1f", -- Engine Cold / Normal Start
[289] = "%.1f", -- Start Engine
[301] = "%.1f", -- Engine Emergency Air Start
[616] = "%.1f", -- Engine Stop/Lock
-- ACCELEROMETER
[228] = "%.1f", -- Accelerometer Reset
-- PITOT TUBES and related things that use dc bus for heating
[229] = "%.1f", -- Pitot tube Selector Main/Emergency
[279] = "%.1f", -- Pitot tube/Periscope/Clock Heat
[280] = "%.1f", -- Secondary Pitot Tube Heat
-- DA-200
[261] = "%.1f", -- Variometer Set
-- ENGINE
[308] = "%.1f", -- Anti surge doors - Auto/Manual
[300] = "%.1f", -- Afterburner/Maximum Off/On
[320] = "%.1f", -- Emergency Afterburner Off/On
-- FIRE EXTINGUISHER
[303] = "%.1f", -- Fire Extinguisher Off/On
[324] = "%.1f", -- Fire Extinguisher Cover
[325] = "%.1f", -- Fire Extinguisher
-- LIGHTS
[612] = "%.1f", -- Cockpit Texts Back-light default_axis
[156] = "%.1f", -- Instruments Back-light default_axis
[157] = "%.1f", -- Main Red Lights default_axis
[222] = "%.1f", -- Main White Lights default_axis
[194] = "%.1f", -- Navigation Lights Off/Min/Med/Max
[323] = "%.1f", -- Landing Lights Off/Taxi/Land
-- LIGHTS WARNING
[195] = "%.1f", -- CheckWarningLights11
[196] = "%.1f", -- CheckWarningLights21
[273] = "%.1f", -- CheckWarningLights31
[282] = "%.1f", -- CheckWarningLights41
[283] = "%.1f", -- CheckWarningLights51
[322] = "%.1f", -- CheckWarningLights61
[657] = "%.1f", -- SORC
-- Radio
[173] = "%.1f", -- Radio System On/Off
[208] = "%.1f", -- Radio / Compass
[209] = "%.1f", -- Squelch On/Off
[210] = "%.1f", -- Radio Volume
[211] = "%.1f", -- Radio Channel
[315] = "%.1f", -- Radio PTT
-- ARK
[174] = "%.1f", -- ARK On/Off
[198] = "%.1f", -- ARK Sound
[212] = "%.1f", -- ARK Change
[189] = "%.1f", -- ARK Zone
[197] = "%.1f", -- ARK Mode - Antenna / Compass
[254] = "%.1f", -- Marker Far/Near
-- RSBN
[176] = "%.1f", -- RSBN On/Off
[240] = "%.1f", -- RSBN Mode Land/Navigation/Descend
[340] = "%.1f", -- RSBN / ARK
[294] = "%.1f", -- RSBN Identify
[347] = "%.1f", -- RSBN self-test
--RSBN Panel
[345] = "%.1f", -- RSBN Sound
[351] = "%.1f", -- RSBN Navigation
[352] = "%.1f", -- PRMG Landing
[366] = "%.1f", -- RSBN Reset
[367] = "%.1f", -- RSBN Bearing
[368] = "%.1f", -- RSBN Distance
-- SAU
[179] = "%.1f", -- SAU On/Off
[180] = "%.1f", -- SAU Pitch On/Off
[343] = "%.1f", -- SAU - Stabilize
[376] = "%.1f", -- SAU cancel current mode
[377] = "%.1f", -- SAU - Recovery
[344] = "%.1f", -- SAU Preset - Limit Altitude
[341] = "%.1f", -- SAU - Landing - Command
[342] = "%.1f", -- SAU - Landing - Auto
[348] = "%.1f", -- SAU Reset/Off
-- SPO
[202] = "%.1f", -- SPO-10 RWR On/Off
[226] = "%.1f", -- SPO-10 Test
[227] = "%.1f", -- SPO-10 Night / Day
[225] = "%.1f", -- SPO-10 Volume
-- SRZO IFF
[188] = "%.1f", -- SRZO IFF Coder/Decoder On/Off
[192] = "%.1f", -- SRZO Codes
[346] = "%.1f", -- IFF System 'Type 81' On/Off
[190] = "%.1f", -- Emergency Transmitter Cover
[191] = "%.1f", -- Emergency Transmitter On/Off
[427] = "%.1f", -- SRZO Self Destruct Cover
[428] = "%.1f", -- SRZO Self Destruct
-- SOD
[200] = "%.1f", -- SOD IFF On/Off
[199] = "%.1f", -- SOD Identify
[201] = "%.1f", -- SOD Wave Selector 3/1/2
[204] = "%.1f", -- SOD Modes
-- RADAR
[205] = "%.1f", -- Radar Off/Prep/On
[206] = "%.1f", -- Low Altitude Off/Comp/On
[207] = "%.1f", -- Locked Beam On/Off
[266] = "%.1f", -- Radar Screen Magnetic Reset
[330] = "%.1f", -- Radar Interferes - Continues
[331] = "%.1f", -- Radar Interferes - Temporary
[332] = "%.1f", -- Radar Interferes - Passive
[333] = "%.1f", -- Radar Interferes - Weather
[334] = "%.1f", -- Radar Interferes - IFF
[335] = "%.1f", -- Radar Interferes - Low Speed
[336] = "%.1f", -- Radar Interferes - Self-test
[337] = "%.1f", -- Radar Interferes - Reset
[378] = "%.1f", -- Lock Target
[623] = "%.1f", -- Radar Polar Filter
-- SPRD
[167] = "%.1f", -- SPRD (RATO) System On/Off
[168] = "%.1f", -- SPRD (RATO) Drop System On/Off
[252] = "%.1f", -- SPRD (RATO) Start Cover
[253] = "%.1f", -- SPRD (RATO) Start
[317] = "%.1f", -- SPRD (RATO)t Drop Cover
[318] = "%.1f", -- SPRD (RATO) Drop
-- CONTROL SYSTEM ------------- subsystems --------------------------------------------
-- SPS
[293] = "%.1f", -- SPS System Off/On
-- ARU
[295] = "%.1f", -- ARU System - Manual/Auto
[296] = "%.1f", -- ARU System - Low Speed/Neutral/High Speed
-- Airbrake
[316] = "%.1f", -- Airbrake - Out/In
-- Gear brakes
[299] = "%.1f", -- ABS Off/On
[238] = "%.1f", -- Nosegear Brake Off/On
[237] = "%.1f", -- Emergency Brake
-- Gears
[326] = "%.1f", -- Gear Handle Fixator
[327] = "%.1f", -- Gear Up/Neutral/Down
[223] = "%.1f", -- Main Gears Emergency Release Handle
[281] = "%.1f", -- Nose Gear Emergency Release Handle
-- Flaps
[311] = "%.1f", -- Flaps Neutral
[312] = "%.1f", -- Flaps Take-Off
[313] = "%.1f", -- Flaps Landing
[314] = "%.1f", -- Flaps Reset buttons
-- Drag chute
[298] = "%.1f", -- Release Drag Chute
[304] = "%.1f", -- Drop Drag Chute Cover
[305] = "%.1f", -- Drop Drag Chute
--TRIMMER
[172] = "%.1f", -- Trimmer On/Off
[379] = "%.1f", -- Trimmer Pitch Up/Down
-- KONUS
[170] = "%.1f", -- Nosecone On/Off
[309] = "%.1f", -- Nosecone Control - Manual/Auto
[236] = "%.1f", -- Nosecone manual position controller
-- SOPLO
[291] = "%.1f", -- Engine Nozzle 2 Position Emergency Control
--MAIN_HYDRO and BUSTER_HYDRO == == == == == == == == == == == == == == == == == == == TEMPORARY MERGED == == == == == == == == == == == == == == == == == == == == == ==
[171] = "%.1f", -- Emergency Hydraulic Pump On/Off
[319] = "%.1f", -- Aileron Booster - Off/On
--KPP
[177] = "%.1f", -- KPP Main/Emergency
[259] = "%.1f", -- KPP Cage
[260] = "%.1f", -- KPP Set
--IAS / TAS / KSI (NPP)
[178] = "%.1f", -- NPP On/Off
[258] = "%.1f", -- NPP Adjust
[263] = "%.1f", -- NPP Course set
-- ALTIMETER and radioALTIMETER
[175] = "%.1f", -- Radio Altimeter/Marker On/Off
[284] = "%.1f", -- Dangerous Altitude Warning Set
[262] = "%.1f", -- Altimeter pressure knob
-- OXYGENE_SYSTEM
[285] = "%.1f", -- Helmet Air Condition Off/On
[286] = "%.1f", -- Emergency Oxygen Off/On
[287] = "%.1f", -- Mixture/Oxygen
-- CANOPY
[328] = "%.1f", -- Hermetize Canopy
[329] = "%.1f", -- Secure Canopy
[375] = "%.1f", -- Canopy Open
[385] = "%.1f", -- Canopy Close
[239] = "%.1f", -- Canopy Anti Ice
[224] = "%.1f", -- Canopy Emergency Release Handle
[649] = "%.1f", -- Canopy Ventilation System
-- ASP Gunsight
[186] = "%.1f", -- ASP Optical sight On/Off
[241] = "%.1f", -- ASP Main Mode - Manual/Auto
[242] = "%.1f", -- ASP Mode - Bombardment/Shooting
[243] = "%.1f", -- ASP Mode - Missiles-Rockets/Gun
[244] = "%.1f", -- ASP Mode - Giro/Missile
[249] = "%.1f", -- Pipper On/Off
[250] = "%.1f", -- Fix net On/Off
[245] = "%.1f", -- Target Size
[246] = "%.1f", -- Intercept Angle
[247] = "%.1f", -- Scale Backlights control
[248] = "%.1f", -- Pipper light control
[251] = "%.1f", -- Fix Net light control
[384] = "%.1f", -- TDC Range / Pipper Span control
-- WEAPON_CONTROL
[181] = "%.1f", -- Missiles - Rockets Heat On/Off
[182] = "%.1f", -- Missiles - Rockets Launch On/Off
[183] = "%.1f", -- Pylon 1-2 Power On/Off
[184] = "%.1f", -- Pylon 3-4 Power On/Off
[185] = "%.1f", -- GS-23 Gun On/Off
[187] = "%.1f", -- Guncam On/Off
[277] = "%.1f", -- Tactical Drop Cover
[278] = "%.1f", -- Tactical Drop
[275] = "%.1f", -- Emergency Missile/Rocket Launcher Cover
[276] = "%.1f", -- Emergency Missile/Rocket Launcher
[256] = "%.1f", -- Drop Wing Fuel Tanks Cover
[257] = "%.1f", -- Drop Wing Fuel Tanks
[386] = "%.1f", -- Drop Center Fuel Tank
[269] = "%.1f", -- Drop Payload - Outer Pylons Cover
[270] = "%.1f", -- Drop Payload - Outer Pylons
[271] = "%.1f", -- Drop Payload - Inner Pylons Cover
[272] = "%.1f", -- Drop Payload - Inner Pylons
[230] = "%.1f", -- Weapon Mode - Air/Ground
[231] = "%.1f", -- Weapon Mode - IR Missile/Neutral/SAR Missile
[232] = "%.1f", -- Activate Gun Loading Pyro - 1
[233] = "%.1f", -- Activate Gun Loading Pyro - 2
[234] = "%.1f", -- Activate Gun Loading Pyro - 3
[235] = "%.1f", -- Weapon Selector
[297] = "%.1f", -- Missile Seeker Sound
[381] = "%.1f", -- Fire Gun
[382] = "%.1f", -- Release Weapon
[383] = "%.1f", -- Release Weapon Cover
-- HELMET_VISOR
[306] = "%.1f", -- Helmet Heat - Manual/Auto
[310] = "%.1f", -- Helmet Quick Heat
[369] = "%.1f", -- Helmet visor - off/on
-- AIR CONDITIONING
[292] = "%.1f", -- Cockpit Air Condition Off/Cold/Auto/Warm
-- SARPP
[193] = "%.1f", -- SARPP-12 Flight Data Recorder On/Off
-- Flight Control
-- Dummy buttons/switches
[632] = "%.1f", -- Radar emission - Cover
[633] = "%.1f", -- Radar emission - Combat/Training
[634] = "%.1f", -- G-Suit Max/Min valve
[635] = "%.1f", -- Electric Bus Nr.1 - Cover
[636] = "%.1f", -- Electric Bus Nr.1
[637] = "%.1f", -- Electric Bus Nr.2
[638] = "%.1f", -- 1.7 Mach Test Button - Cover
[639] = "%.1f", -- 1.7 Mach Test Button
[640] = "%.1f", -- BU-45 Buster System Separation
[642] = "%.1f", -- SOD Control PBU-1
[641] = "%.1f", -- SOD Control PBU-2
[643] = "%.1f", -- Eject
[644] = "%.1f", -- Ejection Seat Emergency Oxygen
[645] = "%.1f", -- UK-2M Mic Amplifier M/L
[646] = "%.1f", -- UK-2M Mic Amplifier GS/KM
[647] = "%.1f", -- Suit Ventilation
[648] = "%.1f", -- Harness Separation
[650] = "%.1f", -- Harness Loose/Tight
[651] = "%.1f", -- Throttle Fixation
-- IAB PBK-3
[387] = "%.1f", -- Emergency Jettison
[388] = "%.1f", -- Emergency Jettison Armed / Not Armed
[389] = "%.1f", -- Tactical Jettison
[390] = "%.1f", -- Special AB / Missile-Rocket-Bombs-Cannon
[391] = "%.1f", -- Brake Chute
[392] = "%.1f", -- Detonation Air / Ground
-- SPS 141-100
[393] = "%.1f", -- "On / Off"
[394] = "%.1f", -- Transmit / Receive
[395] = "%.1f", -- Program I / II
[396] = "%.1f", -- Continuous / Impuls
[397] = "%.1f", -- Test
[398] = "%.1f", -- Dispenser Auto / Manual
[399] = "%.1f", -- Off / Parallel / Full
[400] = "%.1f", -- Manual Activation button - Cover
[401] = "%.1f", -- Manual Activation button
-- GUV Control Box -/N/ GUV is useless, it's mostly anti-infantry weapon
[420] = "%.1f", -- On / Off
[421] = "%.1f", -- MAIN GUN / UPK Guns
[422] = "%.1f", -- LOAD 1
[425] = "%.1f", -- LOAD 2
[424] = "%.1f", -- LOAD 3
}
-----------------------------
-- HIGH IMPORTANCE EXPORTS --
-- done every export event --
-----------------------------
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
--[[
every frame export
Example from A-10C
Landing Gear
mainPanelDevice, basis panel
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
]]
-- Distance
-- distance_meter_Hundreds;distance_meter_Tens;distance_meter_Singles
-- 355; 356; 357;
SendData(2000, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(355),
mainPanelDevice:get_argument_value(356),
mainPanelDevice:get_argument_value(357)))
-- HSI
-- heading; requiredHeading; bearingNeedle; warningFlagG; warningFlagK; glide; side;
-- 111; 68; 590; 588; 587; glide; side;
SendData(2001, string.format("%0.4f;%0.4f;%0.4f;%0.1f;%0.1f",
mainPanelDevice:get_argument_value(111),
mainPanelDevice:get_argument_value(68),
mainPanelDevice:get_argument_value(590),
mainPanelDevice:get_argument_value(588),
mainPanelDevice:get_argument_value(587)))
-- mainPanelDevice:get_argument_value(???),
-- mainPanelDevice:get_argument_value(???)))
-- Altimeter
-- altituteMeter; altituteKM; baroPressure
-- 104; 112; 655;
SendData(2002, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(104),
mainPanelDevice:get_argument_value(112),
mainPanelDevice:get_argument_value(655)))
-- ADI
-- bank; pitch; steeringWarningFlag attitudeWarningFlag; desiredBank; desirePitch;
-- airSpeedDeviation; trackDeviation;heightDeviation;sideslip;
SendData(2003, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(108),
mainPanelDevice:get_argument_value(109)))
-- HydraulicPressure
-- PRIMARY_GIDRO_Pressure_needle, SECONDARY_GIDRO_Pressure_needle
-- 126; 125;
SendData(2004, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(126),
mainPanelDevice:get_argument_value(125)))
-- Mach
-- 101; 102;
SendData(2005, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(101),
mainPanelDevice:get_argument_value(102)))
-- Nosecone
-- KONUS_efficiency, KONUS_UPES_3_instrument
-- 625; 66;
SendData(2006, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(625),
mainPanelDevice:get_argument_value(66)))
-- RPM
-- ENGINE_RPM; ENGINE_RPM2
-- 50; 670;
SendData(2007, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(50),
mainPanelDevice:get_argument_value(670)))
-- VVI
-- DA200_VerticalVelocity; DA200_TurnNeedle; DA200_Slipball
-- 106; 107; 31;
SendData(2008, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(106),
mainPanelDevice:get_argument_value(107),
mainPanelDevice:get_argument_value(31)))
-- Wheelbrakes
-- LEFT_Wheelbrake;RIGHT_Wheelbrake;
-- ???; ???
-- SendData(2009, string.format("%0.4f;%0.4f",
-- mainPanelDevice:get_argument_value(???),
-- mainPanelDevice:get_argument_value(???)))
-- Gear
-- GEAR_NOSE_UP_LIGHT; GEAR_NOSE_DOWN_LIGHT; GEAR_LEFT_UP_LIGHT; GEAR_LEFT_DOWN_LIGHT;
-- GEAR_RIGHT_UP_LIGHT; GEAR_RIGHT_DOWN_LIGHT; AIRBRAKE_LIGHT; FLAPS_LIGHT; CHECK_GEAR_LIGHT;
-- 9; 12; 10; 13; 11; 14; 522; 521; 520;
SendData(2010, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(9),
mainPanelDevice:get_argument_value(12),
mainPanelDevice:get_argument_value(10),
mainPanelDevice:get_argument_value(13),
mainPanelDevice:get_argument_value(11),
mainPanelDevice:get_argument_value(14),
mainPanelDevice:get_argument_value(522),
mainPanelDevice:get_argument_value(521),
mainPanelDevice:get_argument_value(520)))
-- ACC
-- ACCELEROMETER; MAX_G_needle; MIN_G_needle
-- 110; 113; 114;
SendData(2012, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(110),
mainPanelDevice:get_argument_value(113),
mainPanelDevice:get_argument_value(114)))
-- SPO
-- SPO_L_F; SPO_R_F; SPO_R_B; SPO_L_B; SPO_MUTED
-- 601; 602; 603; 604; 605;
SendData(2013, string.format("%0.4f;%0.4f;%0.4f;%0.1f;%0.1f",
mainPanelDevice:get_argument_value(601),
mainPanelDevice:get_argument_value(602),
mainPanelDevice:get_argument_value(603),
mainPanelDevice:get_argument_value(604),
mainPanelDevice:get_argument_value(605)))
-- Clock
-- currtimeHours; currtimeMinutes; currtimeSeconds; flightTimeMeterStatus;
-- flightHours;flightMinutes; secondsMeterTimeMinutes; secondsMeterTimeSeconds;
-- 115; 116; 117; 118; 119; 120; 121; 122;
SendData(2014, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(115),
mainPanelDevice:get_argument_value(116),
mainPanelDevice:get_argument_value(117),
mainPanelDevice:get_argument_value(118),
mainPanelDevice:get_argument_value(119),
mainPanelDevice:get_argument_value(120),
mainPanelDevice:get_argument_value(121),
mainPanelDevice:get_argument_value(122)))
end
end
function ProcessHARDWAREConfigHighImportance(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
]]
--GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("9", mainPanelDevice:get_argument_value(9)) -- GEAR_NOSE_UP_LIGHT
SendDataHW("12", mainPanelDevice:get_argument_value(12)) -- GEAR_NOSE_DOWN_LIGHT
SendDataHW("10", mainPanelDevice:get_argument_value(10)) -- GEAR_LEFT_UP_LIGHT
SendDataHW("13", mainPanelDevice:get_argument_value(13)) -- GEAR_LEFT_DOWN_LIGHT
SendDataHW("11", mainPanelDevice:get_argument_value(11)) -- GEAR_RIGHT_UP_LIGHT
SendDataHW("14", mainPanelDevice:get_argument_value(14)) -- GEAR_RIGHT_DOWN_LIGHT
SendDataHW("522", mainPanelDevice:get_argument_value(522)) -- AIRBRAKE_LIGHT
SendDataHW("521", mainPanelDevice:get_argument_value(521)) -- FLAPS_LIGHT
SendDataHW("520", mainPanelDevice:get_argument_value(520)) -- CHECK_GEAR_LIGHT
-- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------
SendDataHW("500", mainPanelDevice:get_argument_value(500)) -- LOW_ALT_LIGHT
-- UUA and SUA subgroup -----------------------------------------------------------------------------------------------------------------------------------------------------------
SendDataHW("537", mainPanelDevice:get_argument_value(537)) -- AOA_WARNING_LIGHT
--/N/ DC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("510", mainPanelDevice:get_argument_value(510)) -- DC_GENERATOR_LIGHT
--TRIMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
SendDataHW("519", mainPanelDevice:get_argument_value(519)) -- TRIMMER_light
--/N/ AC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("511", mainPanelDevice:get_argument_value(511)) -- AC_GENERATOR_LIGHT
--FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
SendDataHW("501", mainPanelDevice:get_argument_value(501)) -- FUEL_LIGHT_FUELPODC
SendDataHW("502", mainPanelDevice:get_argument_value(502)) -- FUEL_LIGHT_1GR
SendDataHW("503", mainPanelDevice:get_argument_value(503)) -- FUEL_LIGHT_450
SendDataHW("504", mainPanelDevice:get_argument_value(504)) -- FUEL_LIGHT_3GR
SendDataHW("505", mainPanelDevice:get_argument_value(505)) -- FUEL_LIGHT_FUELPODW
SendDataHW("506", mainPanelDevice:get_argument_value(506)) -- FUEL_LIGHT_RASHOD
-- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("515", mainPanelDevice:get_argument_value(515)) -- HYDRAULIC_LIGHT
SendDataHW("514", mainPanelDevice:get_argument_value(514)) -- BUSTER_LIGHT
-- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("550", mainPanelDevice:get_argument_value(550)) -- GUN_GOTOVN_LIGHT
-- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
SendDataHW("601", mainPanelDevice:get_argument_value(601)) -- SPO_L_F
SendDataHW("602", mainPanelDevice:get_argument_value(602)) -- SPO_R_F
SendDataHW("603", mainPanelDevice:get_argument_value(603)) -- SPO_R_B
SendDataHW("604", mainPanelDevice:get_argument_value(604)) -- SPO_L_B
SendDataHW("605", mainPanelDevice:get_argument_value(605)) -- SPO_MUTED
-- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("546", mainPanelDevice:get_argument_value(546)) -- SAU_stabilization_LIGHT
SendDataHW("547", mainPanelDevice:get_argument_value(547)) -- SAU_privedenie_LIGHT
SendDataHW("544", mainPanelDevice:get_argument_value(544)) -- SAU_landing_COMMAND_LIGHT
SendDataHW("545", mainPanelDevice:get_argument_value(545)) -- SAU_landing_AUTO_LIGHT
-- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("541", mainPanelDevice:get_argument_value(541)) -- CANOPY_WARNING_LIGHT
SendDataHW("542", mainPanelDevice:get_argument_value(542)) -- SORC_LIGHT
SendDataHW("407", mainPanelDevice:get_argument_value(407)) -- WARNING_LIGHTS_CHECK_STATE
SendDataHW("516", mainPanelDevice:get_argument_value(516)) -- MARKER_LIGHT
SendDataHW("518", mainPanelDevice:get_argument_value(518)) -- STABILISATOR_LIGHT
SendDataHW("520", mainPanelDevice:get_argument_value(520)) -- CHECK_GEAR_LIGHT
SendDataHW("521", mainPanelDevice:get_argument_value(521)) -- FLAPS_LIGHT
SendDataHW("522", mainPanelDevice:get_argument_value(522)) -- AIRBRAKE_LIGHT
SendDataHW("523", mainPanelDevice:get_argument_value(523)) -- CENTRAL_PYLON_LIGHT
SendDataHW("524", mainPanelDevice:get_argument_value(524)) -- RATO_L_LIGHT
SendDataHW("525", mainPanelDevice:get_argument_value(525)) -- RATO_R_LIGHT
SendDataHW("526", mainPanelDevice:get_argument_value(526)) -- PYLON_1_ON_LIGHT
SendDataHW("527", mainPanelDevice:get_argument_value(527)) -- PYLON_2_ON_LIGHT
SendDataHW("528", mainPanelDevice:get_argument_value(528)) -- PYLON_3_ON_LIGHT
SendDataHW("529", mainPanelDevice:get_argument_value(529)) -- PYLON_4_ON_LIGHT
SendDataHW("530", mainPanelDevice:get_argument_value(530)) -- PYLON_1_OFF_LIGHT
SendDataHW("531", mainPanelDevice:get_argument_value(531)) -- PYLON_2_OFF_LIGHT
SendDataHW("532", mainPanelDevice:get_argument_value(532)) -- PYLON_3_OFF_LIGHT
SendDataHW("533", mainPanelDevice:get_argument_value(533)) -- PYLON_4_OFF_LIGHT
-- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
SendDataHW("507", mainPanelDevice:get_argument_value(507)) -- FORSAZ_1_LIGHT
SendDataHW("508", mainPanelDevice:get_argument_value(508)) -- FORSAZ_2_LIGHT
SendDataHW("512", mainPanelDevice:get_argument_value(512)) -- NOZZLE_LIGHT
SendDataHW("517", mainPanelDevice:get_argument_value(517)) -- KONUS_LIGHT
SendDataHW("513", mainPanelDevice:get_argument_value(513)) -- OIL_LIGHT
SendDataHW("534", mainPanelDevice:get_argument_value(534)) -- FIRE_LIGHT
--ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
SendDataHW("509", mainPanelDevice:get_argument_value(509)) -- START_DEVICE_ZAZIG_LIGHT
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
--[[
export in low tick interval to HELIOS
Example from A-10C
Landing Gear
mainPanelDevice, basis panel
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
]]
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
end
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
--[[
export in low tick interval to hardware
Example from A-10C
Get Radio Frequencies
get data from device
local lUHFRadio = GetDevice(54)
SendData("ExportID", "Format")
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
Device test, Device 2 to 32
is value "userdata", is only DLL intern functions
local ltmp1 = 0
for ltmp2 = 1, 32, 1 do
ltmp1 = GetDevice(ltmp2)
WriteToLog(ltmp2..': '..dump(ltmp1))
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
end
]]
end

841
ExportsModules/MiG-29A.lua Normal file
View File

@ -0,0 +1,841 @@
-- MiG-29A Export
-- Version 0.9.9 BETA
gES_FoundFCModule = true
-- auxiliary function
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / MiG-29A --
-- FC aircraft don't support GetDevice --
-----------------------------------------
function ProcessGlassCockpitFCHighImportanceConfig()
local myData = LoGetSelfData()
if (myData) then
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
local lHeading = myData.Heading -- HEADING (Radian)
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
local lMachNumber = LoGetMachNumber() -- MACH
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
local lDistanceToWay = 999
local lRoute = LoGetRoute()
if (myData and lRoute) then -- if neither are nil
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
end
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- customizing for HELOS
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
lBank = math.deg(lBank) -- BANK (Radian to Grad)
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
lHSI_RMI = 360 - lHSI_RMI
lIAS = lIAS * 3.6 -- change from m/s to km/h
SendData("1", string.format("%.2f", lPitch) )
SendData("2", string.format("%.2f", lBank) )
SendData("3", string.format("%.2f", lYaw) )
SendData("4", string.format("%.2f", lAltBar) )
SendData("5", string.format("%.2f", lAltRad) )
SendData("6", string.format("%.2f", lHSI_ADF) )
SendData("7", string.format("%.2f", lHSI_RMI) )
SendData("8", string.format("%.2f", lHeading) )
SendData("9", string.format("%.2f", lEngineRPMleft) )
SendData("10", string.format("%.2f", lEngineRPMright) )
SendData("11", string.format("%.2f", lEngineTempLeft) )
SendData("12", string.format("%.2f", lEngineTempRight) )
SendData("13", string.format("%.2f", lVVI) )
SendData("14", string.format("%.2f", lIAS) )
SendData("15", string.format("%.2f", lDistanceToWay) )
SendData("16", string.format("%.2f", lAoA) )
SendData("17", string.format("%.2f", lGlide) )
SendData("18", string.format("%.2f", lSide) )
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
local lRadToDCSsignd = math.pi
local lRadToDCSunsignd = math.pi * 2
local lDefaultNull = 0.0
local lDefaultOne = 1.0
-- IAS Indicator (IAS, Thousend) {"%.4f;%.4f"}
FC_Russian_AirSpeed_1000hkm(1)
-- AOA Indicator and Accelerometer (AOA, GLoad)
FC_Russian_AOA_MiG29(3)
-- ADI
FC_Russian_ADI_Old(4)
-- HSI
FC_Russian_HSI(lDistanceToWay, 5)
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
FC_Russian_VVI_Old(6)
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
FC_Russian_RadarAltimeter_1000m(100, 7)
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
FC_Russian_BarometricAltimeter_30000(8)
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
FC_Russian_EngineRPM(9)
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempLeft + 80, 10) -- differenc fromtechnical temperature to showing temperature
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempRight + 80, 11)
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
FC_Russian_Clock_ACS1(12)
-- Mach {max, Mach}
local lMachTmp = 0
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 0.0 -- minimaler Eingangswert
x_max = 3.0 -- maximaler Eingangswert
x = 1.65 -- aktueller Eingangswert
d_y = 1.0 -- Delta Ausgabewerte (y_max - y_min)
d_x = 3.0 -- Delta Eingangswerte (x_max - x_min)
m = 0.33333333333333333333333333333333 -- Steigung der linearen Funktion (d_y / d_x)
n = 0.00000000000000000000000000000001 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.55 -- Ergebnis (m * x + n)
]]
lMachTmp = 0.33333333333333333333333333333333 * lMachNumber + 0.00000000000000000000000000000001
SendData("13", string.format("%0.4f;%0.4f", lMachTmp, 0.0))
end
else
WriteToLog("Unknown FC Error, no LoGetSelfData.")
end
end
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
end
function ProcessGlassCockpitFCLowImportanceConfig()
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
FC_RadarWarning_SPO15(14)
-- Fuel Quantity Indicator
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
local lTotalFuel = lEngineInfo.fuel_internal + lEngineInfo.fuel_external
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
local lTotalFuel_7_5 = 0
local lTotalFuel_5_0 = 0
if lTotalFuel < 7500 then
if lTotalFuel > 5000 then
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 5000 -- minimaler Eingangswert
x_max = 7500 -- maximaler Eingangswert
x = 6000 -- aktueller Eingangswert
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
d_x = 2500 -- Delta Eingangswerte (x_max - x_min)
m = 0.0004 -- Steigung der linearen Funktion (d_y / d_x)
n = -2.0 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.4 -- Ergebnis (m * x + n)
]]
lTotalFuel_7_5 = 0.0004 * lTotalFuel + -2.0
else
lTotalFuel_7_5 = 0.0
end
else
lTotalFuel_7_5 = 1.0
end
if lTotalFuel < 5000 then
--[[
y_min = 0.04 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 0 -- minimaler Eingangswert
x_max = 5000 -- maximaler Eingangswert
x = 3000 -- aktueller Eingangswert
d_y = 0.96 -- Delta Ausgabewerte (y_max - y_min)
d_x = 5000 -- Delta Eingangswerte (x_max - x_min)
m = 0.000192 -- Steigung der linearen Funktion (d_y / d_x)
n = 0.04 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.616 -- Ergebnis (m * x + n)
]]
lTotalFuel_5_0 = 0.000192 * lTotalFuel + 0.04
else
lTotalFuel_5_0 = 1.0
end
-- TotalFuel_5_0
-- TotalFuel_7_5
-- Light1
-- Light2
-- Light3
-- Light4
-- BingoLight
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
lTotalFuel_5_0,
lTotalFuel_7_5,
0,
(lEngineInfo.fuel_internal < 3200.0 and 1 or 0), -- Tank warning 1
(lEngineInfo.fuel_internal < 2800.0 and 1 or 0), -- Tank warning 2
(lEngineInfo.fuel_internal < 1400.0 and 1 or 0), -- Tank warning 3
(lEngineInfo.fuel_internal < 800.0 and 1 or 0))) -- Tank warning 4
-- Hydraulic Pressure Left
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
-- Hydraulic Pressure Right
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
end
-- EKRAN Message
FC_EKRAN(16)
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo ~= nil then
--WriteToLog('lMechInfo: '..dump(lMechInfo))
local lWarningLight = 0.0
local lTrueAirSpeed = LoGetTrueAirSpeed()
if lTrueAirSpeed ~= nil then
--WriteToLog('lTrueAirSpeed: '..dump(lTrueAirSpeed))
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
end
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
-- left gear {0, 1}
-- right gear {0, 1}
-- nose gear {0, 1}
-- WarningLight
-- Flap 1
-- Flap 2
-- Nose Flap
-- Speedbreakes on {0, 1}
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d",
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
lWarningLight,
-- (lMechInfo.flaps.value > 0.47 and 1 or 0), -- flap 1
-- (lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap 2
(lMechInfo.flaps.status == 1 and 1 or 0), -- flap 1
(lMechInfo.flaps.status == 2 and 1 or 0), -- flap 2
(lMechInfo.noseflap.value > 0.1 and 1 or 0), -- noseflap
(lMechInfo.speedbrakes.status == 1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
-- Wheelbrakes Hydraulic Pressure Left
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
-- Wheelbrakes Hydraulic Pressure Right
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
end
-- Airintake
FC_Russian_AirIntake(21)
end
--(x < 0 and 'negative' or 'non-negative')
--[[
local lPayloadInfo = LoGetPayloadInfo()
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
local lSnares = LoGetSnares() -- Flare and Chaff
WriteToLog('lSnares: '..dump(lSnares))
local lSightingSystemInfo = LoGetSightingSystemInfo()
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
local lLockedTargetInformation = LoGetLockedTargetInformation()
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
WriteToLog('lMechInfo: '..dump(lMechInfo))
local lMCPState = LoGetMCPState() -- Warnlichter
WriteToLog('lMCPState: '..dump(lMCPState))
local lControlPanel_HSI = LoGetControlPanel_HSI()
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
local lEngineInfo = LoGetEngineInfo()
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
]]
-- Weapon Control System
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
-- values from LoGetTargetInformation().type
--WriteToLog('lNameByType: '..dump(lNameByType))
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
WeaponStatusPanel()
MechanicalDevicesIndicator()
StatusLamp()
FuelQuantityIndicator()
SightingSystem()
SPO15RWR()
FlareChaff()
end
-----------------------------
-- Custom functions --
-----------------------------
function SightingSystem(hardware)
local lHardware = hardware or 1
local lSightingSystemInfo = LoGetSightingSystemInfo()
if lSightingSystemInfo == nil then
return
end
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
--[[
[PRF] = {
[selection] = string: "ILV"
[current] = string: "MED"
}
[laser_on] = boolean: "false"
[scale] = {
[azimuth] = number: "0.52359873056412"
[distance] = number: "10000"
}
[radar_on] = boolean: "false"
[optical_system_on] = boolean: "false"
[LaunchAuthorized] = boolean: "false"
[ECM_on] = boolean: "false"
[Manufacturer] = string: "RUS"
[TDC] = {
[y] = number: "0"
[x] = number: "0"
}
[ScanZone] = {
[coverage_H] = {
[min] = number: "0"
[max] = number: "20000"
}
[size] = {
[azimuth] = number: "1.0471974611282"
[elevation] = number: "0.17453290522099"
}
[position] = {
[exceeding_manual] = number: "0"
[distance_manual] = number: "0"
[azimuth] = number: "0"
[elevation] = number: "0"
}
}
]]
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
end
function FlareChaff(hardware)
local lHardware = hardware or 1
local lSnares = LoGetSnares() -- Flare and Chaff
--WriteToLog('lSnares: '..dump(lSnares))
--[chaff] = number: "30"
--[flare] = number: "30"
SendDataHW("800", lSnares.chaff + lSnares.flare, lHardware )
end
function StatusLamp(hardware)
local lHardware = hardware or 1
local lMCPState = LoGetMCPState() -- Warnlichter
if lMCPState == nil then
return
end
--WriteToLog('lMCPState: '..dump(lMCPState))
--[[
[RightTailPlaneFailure] = boolean: "false"
[EOSFailure] = boolean: "false"
[ECMFailure] = boolean: "false"
[RightAileronFailure] = boolean: "false"
[MasterWarning] = boolean: "false"
[RightEngineFailure] = boolean: "false"
[CannonFailure] = boolean: "false"
[MLWSFailure] = boolean: "false"
[ACSFailure] = boolean: "false"
[RadarFailure] = boolean: "false"
[HelmetFailure] = boolean: "false"
[HUDFailure] = boolean: "false"
[LeftMainPumpFailure] = boolean: "false"
[RightWingPumpFailure] = boolean: "false"
[LeftWingPumpFailure] = boolean: "false"
[MFDFailure] = boolean: "false"
[RWSFailure] = boolean: "false"
[GearFailure] = boolean: "false"
[HydraulicsFailure] = boolean: "false"
[AutopilotFailure] = boolean: "true"
[FuelTankDamage] = boolean: "false"
[LeftAileronFailure] = boolean: "false"
[CanopyOpen] = boolean: "false"
[RightMainPumpFailure] = boolean: "false"
[StallSignalization] = boolean: "false"
[LeftEngineFailure] = boolean: "false"
[AutopilotOn] = boolean: "false"
[LeftTailPlaneFailure] = boolean: "false"
]]
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
SendDataHW("730", (lEngineInfo.RPM.left > 100.0 and 1 or 0), lHardware ) -- lamp after burner left engine
SendDataHW("731", (lEngineInfo.RPM.right > 100.0 and 1 or 0), lHardware ) -- lam after burner right engine
end
local lAccelerationUnits = LoGetAccelerationUnits()
if lAccelerationUnits ~= nil then
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
end
end
function WeaponStatusPanel(hardware)
local lHardware = hardware or 1
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
gES_PayloadInfo = LoGetPayloadInfo()
if gES_PayloadInfo == nil then
return
end
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
--[[ exsample
[Stations] = {
[1] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[2] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[3] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[4] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[5] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[6] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[7] = {
[CLSID] = string: "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "43"
[level1] = number: "1"
[level4] = number: "17"
[level2] = number: "3"
}
}
}
[CurrentStation] = number: "3"
[Cannon] = {
[shells] = number: "150"
}
]]
--[[
Weapon Panel
|
-------------------------------
| | | | | | |
1 2 3 C 4 5 6
]]
-- Payload Info
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
SendDataHW("100", gES_PayloadInfo.Cannon.shells ) -- count cannon shells
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
SendDataHW("103", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
SendDataHW("104", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
SendDataHW("105", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
--SendDataHW("106", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation )
-- defination
gES_TmpStationToPanel = {}
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
gES_TmpStationToPanel[2] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware } -- right
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
gES_TmpStationToPanel[4] = {Panel = 5, StationID = 103, CurrentID = 203, HardwareID = lHardware }
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 104, CurrentID = 204, HardwareID = lHardware }
gES_TmpStationToPanel[6] = {Panel = 4, StationID = 105, CurrentID = 205, HardwareID = lHardware }
if gES_PayloadInfo.CurrentStation ~= 0 then -- gegebenenfalls prüfen ob sich CurrentStation geändert hat
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
end
end
function FuelQuantityIndicator(hardware)
local lHardware = hardware or 1
-- Fuel quantity shows the fuel remaining in all tanks
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo == nil then
return
end
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[7].CLSID == 2BEC576B-CDF5-4B7F-961F-B0FA4312B841 -- ext 1500l Fuel Tank
]]
SendDataHW("300", string.format("%d", math.round(((lEngineInfo.fuel_internal + lEngineInfo.fuel_external) / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- internal fuel in kg
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
--[[
local lPayloadInfo = LoGetPayloadInfo()
if lPayloadInfo ~= nil then
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
if lPayloadInfo.Stations[7].CLSID == "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}" then -- center tanks presend and full
SendDataHW("303", ((lEngineInfo.fuel_external < 1200.0 ) and 1 or 0), lHardware )
else
SendDataHW("303", 1, lHardware )
end
if lPayloadInfo.Stations[3].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" or
lPayloadInfo.Stations[4].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" then -- external tank presend and full (panel 2 and 5)
SendDataHW("304", ((lEngineInfo.fuel_internal < 2830.0 ) and 1 or 0), lHardware )
else
SendDataHW("304", 1, lHardware )
end
else
SendDataHW("303", 1, lHardware )
SendDataHW("304", 1, lHardware )
end]]
SendDataHW("304", (lEngineInfo.fuel_internal < 3200.0 and 1 or 0), lHardware ) -- Tank warning 1
SendDataHW("305", (lEngineInfo.fuel_internal < 2800.0 and 1 or 0), lHardware ) -- Tank warning 2
SendDataHW("306", (lEngineInfo.fuel_internal < 1390.0 and 1 or 0), lHardware ) -- Tank warning 3
SendDataHW("307", (lEngineInfo.fuel_internal < 760.0 and 1 or 0), lHardware ) -- Tank warning 4
--SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
end
function MechanicalDevicesIndicator(hardware)
local lHardware = hardware or 1
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo == nil then
return
end
--[[
[hook] = {
[status] = number: "0"
[value] = number: "0"
}
[parachute] = {
[status] = number: "0"
[value] = number: "0"
}
[controlsurfaces] = {
[eleron] = {
[left] = number: "0"
[right] = number: "-0.21084336936474"
}
[elevator] = {
[left] = number: "-0"
[right] = number: "-0"
}
[rudder] = {
[left] = number: "0"
[right] = number: "0"
}
}
[airintake] = {
[status] = number: "0"
[value] = number: "0"
}
[canopy] = {
[status] = number: "0"
[value] = number: "0"
}
[refuelingboom] = {
[status] = number: "0"
[value] = number: "0"
}
[wing] = {
[status] = number: "0"
[value] = number: "0"
}
[noseflap] = {
[status] = number: "0"
[value] = number: "0"
}
[gear] = {
[value] = number: "0"
[nose] = {
[rod] = number: "0"
}
[main] = {
[left] = {
[rod] = number: "0"
}
[right] = {
[rod] = number: "0"
}
}
[status] = number: "0"
}
[speedbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[wheelbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[flaps] = {
[status] = number: "0"
[value] = number: "0"
}]]
--SendDataHW("500", lMechInfo.gear.status )
--SendDataHW("501", lMechInfo.gear.value )
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
--SendDataHW("520", lMechInfo.wheelbrakes.status ) -- not in use
--SendDataHW("521", lMechInfo.wheelbrakes.value ) -- not in use
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
SendDataHW("534", (lMechInfo.gear.status > 1.0 and 1 or 0), lHardware ) -- Intake FOD shields
--SendDataHW("540", lMechInfo.parachute.status )
SendDataHW("541", (lMechInfo.parachute.value < 0.5 and 1 or 0), lHardware )
--SendDataHW("550", lMechInfo.noseflap.status )
SendDataHW("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0), lHardware )
SendDataHW("560", lMechInfo.airintake.status, lHardware )
--SendDataHW("561", lMechInfo.airintake.value )
end

840
ExportsModules/MiG-29S.lua Normal file
View File

@ -0,0 +1,840 @@
-- MiG-29S Export
-- Version 0.9.9 BETA
gES_FoundFCModule = true
-- auxiliary function
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / MiG-29S --
-- FC aircraft don't support GetDevice --
-----------------------------------------
function ProcessGlassCockpitFCHighImportanceConfig()
local myData = LoGetSelfData()
if (myData) then
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
local lHeading = myData.Heading -- HEADING (Radian)
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
local lMachNumber = LoGetMachNumber() -- MACH
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
local lDistanceToWay = 999
local lRoute = LoGetRoute()
if (myData and lRoute) then -- if neither are nil
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
end
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- customizing for HELOS
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
lBank = math.deg(lBank) -- BANK (Radian to Grad)
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
lHSI_RMI = 360 - lHSI_RMI
lIAS = lIAS * 3.6 -- change from m/s to km/h
SendData("1", string.format("%.2f", lPitch) )
SendData("2", string.format("%.2f", lBank) )
SendData("3", string.format("%.2f", lYaw) )
SendData("4", string.format("%.2f", lAltBar) )
SendData("5", string.format("%.2f", lAltRad) )
SendData("6", string.format("%.2f", lHSI_ADF) )
SendData("7", string.format("%.2f", lHSI_RMI) )
SendData("8", string.format("%.2f", lHeading) )
SendData("9", string.format("%.2f", lEngineRPMleft) )
SendData("10", string.format("%.2f", lEngineRPMright) )
SendData("11", string.format("%.2f", lEngineTempLeft) )
SendData("12", string.format("%.2f", lEngineTempRight) )
SendData("13", string.format("%.2f", lVVI) )
SendData("14", string.format("%.2f", lIAS) )
SendData("15", string.format("%.2f", lDistanceToWay) )
SendData("16", string.format("%.2f", lAoA) )
SendData("17", string.format("%.2f", lGlide) )
SendData("18", string.format("%.2f", lSide) )
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
local lRadToDCSsignd = math.pi
local lRadToDCSunsignd = math.pi * 2
local lDefaultNull = 0.0
local lDefaultOne = 1.0
-- IAS Indicator (IAS, Thousend) {"%.4f;%.4f"}
FC_Russian_AirSpeed_1000hkm(1)
-- AOA Indicator and Accelerometer (AOA, GLoad)
FC_Russian_AOA_MiG29(3)
-- ADI
FC_Russian_ADI_Old(4)
-- HSI
FC_Russian_HSI(lDistanceToWay, 5)
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
FC_Russian_VVI_Old(6)
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
FC_Russian_RadarAltimeter_1000m(100, 7)
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
FC_Russian_BarometricAltimeter_30000(8)
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
FC_Russian_EngineRPM(9)
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempLeft + 80, 10) -- differenc fromtechnical temperature to showing temperature
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempRight + 80, 11)
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
FC_Russian_Clock_ACS1(12)
-- Mach {max, Mach}
local lMachTmp = 0
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 0.0 -- minimaler Eingangswert
x_max = 3.0 -- maximaler Eingangswert
x = 1.65 -- aktueller Eingangswert
d_y = 1.0 -- Delta Ausgabewerte (y_max - y_min)
d_x = 3.0 -- Delta Eingangswerte (x_max - x_min)
m = 0.33333333333333333333333333333333 -- Steigung der linearen Funktion (d_y / d_x)
n = 0.00000000000000000000000000000001 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.55 -- Ergebnis (m * x + n)
]]
lMachTmp = 0.33333333333333333333333333333333 * lMachNumber + 0.00000000000000000000000000000001
SendData("13", string.format("%0.4f;%0.4f", lMachTmp, 0.0))
end
else
WriteToLog("Unknown FC Error, no LoGetSelfData.")
end
end
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
end
function ProcessGlassCockpitFCLowImportanceConfig()
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
FC_RadarWarning_SPO15(14)
-- Fuel Quantity Indicator
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
local lTotalFuel = lEngineInfo.fuel_internal + lEngineInfo.fuel_external
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
local lTotalFuel_7_5 = 0
local lTotalFuel_5_0 = 0
if lTotalFuel < 7500 then
if lTotalFuel > 5000 then
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 5000 -- minimaler Eingangswert
x_max = 7500 -- maximaler Eingangswert
x = 6000 -- aktueller Eingangswert
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
d_x = 2500 -- Delta Eingangswerte (x_max - x_min)
m = 0.0004 -- Steigung der linearen Funktion (d_y / d_x)
n = -2.0 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.4 -- Ergebnis (m * x + n)
]]
lTotalFuel_7_5 = 0.0004 * lTotalFuel + -2.0
else
lTotalFuel_7_5 = 0.0
end
else
lTotalFuel_7_5 = 1.0
end
if lTotalFuel < 5000 then
--[[
y_min = 0.04 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 0 -- minimaler Eingangswert
x_max = 5000 -- maximaler Eingangswert
x = 3000 -- aktueller Eingangswert
d_y = 0.96 -- Delta Ausgabewerte (y_max - y_min)
d_x = 5000 -- Delta Eingangswerte (x_max - x_min)
m = 0.000192 -- Steigung der linearen Funktion (d_y / d_x)
n = 0.04 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.616 -- Ergebnis (m * x + n)
]]
lTotalFuel_5_0 = 0.000192 * lTotalFuel + 0.04
else
lTotalFuel_5_0 = 1.0
end
-- TotalFuel_5_0
-- TotalFuel_7_5
-- Light1
-- Light2
-- Light3
-- Light4
-- BingoLight
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
lTotalFuel_5_0,
lTotalFuel_7_5,
0,
(lEngineInfo.fuel_internal < 3200.0 and 1 or 0), -- Tank warning 1
(lEngineInfo.fuel_internal < 2800.0 and 1 or 0), -- Tank warning 2
(lEngineInfo.fuel_internal < 1400.0 and 1 or 0), -- Tank warning 3
(lEngineInfo.fuel_internal < 800.0 and 1 or 0))) -- Tank warning 4
-- Hydraulic Pressure Left
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
-- Hydraulic Pressure Right
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
end
-- EKRAN Message
FC_EKRAN(16)
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo ~= nil then
--WriteToLog('lMechInfo: '..dump(lMechInfo))
local lWarningLight = 0.0
local lTrueAirSpeed = LoGetTrueAirSpeed()
if lTrueAirSpeed ~= nil then
--WriteToLog('lTrueAirSpeed: '..dump(lTrueAirSpeed))
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
end
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
-- left gear {0, 1}
-- right gear {0, 1}
-- nose gear {0, 1}
-- WarningLight
-- Flap 1
-- Flap 2
-- Nose Flap
-- Speedbreakes on {0, 1}
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d",
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
lWarningLight,
-- (lMechInfo.flaps.value > 0.47 and 1 or 0), -- flap 1
-- (lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap 2
(lMechInfo.flaps.status == 1 and 1 or 0), -- flap 1
(lMechInfo.flaps.status == 2 and 1 or 0), -- flap 2
(lMechInfo.noseflap.value > 0.1 and 1 or 0), -- noseflap
(lMechInfo.speedbrakes.status == 1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
-- Wheelbrakes Hydraulic Pressure Left
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
-- Wheelbrakes Hydraulic Pressure Right
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
end
-- Airintake
FC_Russian_AirIntake(21)
end
--(x < 0 and 'negative' or 'non-negative')
--[[
local lPayloadInfo = LoGetPayloadInfo()
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
local lSnares = LoGetSnares() -- Flare and Chaff
WriteToLog('lSnares: '..dump(lSnares))
local lSightingSystemInfo = LoGetSightingSystemInfo()
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
local lLockedTargetInformation = LoGetLockedTargetInformation()
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
WriteToLog('lMechInfo: '..dump(lMechInfo))
local lMCPState = LoGetMCPState() -- Warnlichter
WriteToLog('lMCPState: '..dump(lMCPState))
local lControlPanel_HSI = LoGetControlPanel_HSI()
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
local lEngineInfo = LoGetEngineInfo()
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
]]
-- Weapon Control System
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
-- values from LoGetTargetInformation().type
--WriteToLog('lNameByType: '..dump(lNameByType))
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
WeaponStatusPanel()
MechanicalDevicesIndicator()
StatusLamp()
FuelQuantityIndicator()
SightingSystem()
SPO15RWR()
FlareChaff()
end
-----------------------------
-- Custom functions --
-----------------------------
function SightingSystem(hardware)
local lHardware = hardware or 1
local lSightingSystemInfo = LoGetSightingSystemInfo()
if lSightingSystemInfo == nil then
return
end
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
--[[
[PRF] = {
[selection] = string: "ILV"
[current] = string: "MED"
}
[laser_on] = boolean: "false"
[scale] = {
[azimuth] = number: "0.52359873056412"
[distance] = number: "10000"
}
[radar_on] = boolean: "false"
[optical_system_on] = boolean: "false"
[LaunchAuthorized] = boolean: "false"
[ECM_on] = boolean: "false"
[Manufacturer] = string: "RUS"
[TDC] = {
[y] = number: "0"
[x] = number: "0"
}
[ScanZone] = {
[coverage_H] = {
[min] = number: "0"
[max] = number: "20000"
}
[size] = {
[azimuth] = number: "1.0471974611282"
[elevation] = number: "0.17453290522099"
}
[position] = {
[exceeding_manual] = number: "0"
[distance_manual] = number: "0"
[azimuth] = number: "0"
[elevation] = number: "0"
}
}
]]
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
end
function FlareChaff(hardware)
local lHardware = hardware or 1
local lSnares = LoGetSnares() -- Flare and Chaff
--WriteToLog('lSnares: '..dump(lSnares))
--[chaff] = number: "30"
--[flare] = number: "30"
SendDataHW("800", lSnares.chaff + lSnares.flare, lHardware )
end
function StatusLamp(hardware)
local lHardware = hardware or 1
local lMCPState = LoGetMCPState() -- Warnlichter
if lMCPState == nil then
return
end
--WriteToLog('lMCPState: '..dump(lMCPState))
--[[
[RightTailPlaneFailure] = boolean: "false"
[EOSFailure] = boolean: "false"
[ECMFailure] = boolean: "false"
[RightAileronFailure] = boolean: "false"
[MasterWarning] = boolean: "false"
[RightEngineFailure] = boolean: "false"
[CannonFailure] = boolean: "false"
[MLWSFailure] = boolean: "false"
[ACSFailure] = boolean: "false"
[RadarFailure] = boolean: "false"
[HelmetFailure] = boolean: "false"
[HUDFailure] = boolean: "false"
[LeftMainPumpFailure] = boolean: "false"
[RightWingPumpFailure] = boolean: "false"
[LeftWingPumpFailure] = boolean: "false"
[MFDFailure] = boolean: "false"
[RWSFailure] = boolean: "false"
[GearFailure] = boolean: "false"
[HydraulicsFailure] = boolean: "false"
[AutopilotFailure] = boolean: "true"
[FuelTankDamage] = boolean: "false"
[LeftAileronFailure] = boolean: "false"
[CanopyOpen] = boolean: "false"
[RightMainPumpFailure] = boolean: "false"
[StallSignalization] = boolean: "false"
[LeftEngineFailure] = boolean: "false"
[AutopilotOn] = boolean: "false"
[LeftTailPlaneFailure] = boolean: "false"
]]
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
SendDataHW("730", (lEngineInfo.RPM.left > 100.0 and 1 or 0), lHardware ) -- lamp after burner left engine
SendDataHW("731", (lEngineInfo.RPM.right > 100.0 and 1 or 0), lHardware ) -- lam after burner right engine
end
local lAccelerationUnits = LoGetAccelerationUnits()
if lAccelerationUnits ~= nil then
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
end
end
function WeaponStatusPanel(hardware)
local lHardware = hardware or 1
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
gES_PayloadInfo = LoGetPayloadInfo()
if gES_PayloadInfo == nil then
return
end
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
--[[ exsample
[Stations] = {
[1] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[2] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[3] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[4] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[5] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[6] = {
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "19"
[level2] = number: "4"
}
}
[7] = {
[CLSID] = string: "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "43"
[level1] = number: "1"
[level4] = number: "17"
[level2] = number: "3"
}
}
}
[CurrentStation] = number: "3"
[Cannon] = {
[shells] = number: "150"
}
]]
--[[
Weapon Panel
|
-------------------------------
| | | | | | |
1 2 3 C 4 5 6
]]
-- Payload Info
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
SendDataHW("100", gES_PayloadInfo.Cannon.shells ) -- count cannon shells
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
SendDataHW("103", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
SendDataHW("104", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
SendDataHW("105", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
--SendDataHW("106", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation )
-- defination
gES_TmpStationToPanel = {}
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
gES_TmpStationToPanel[2] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware } -- right
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
gES_TmpStationToPanel[4] = {Panel = 5, StationID = 103, CurrentID = 203, HardwareID = lHardware }
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 104, CurrentID = 204, HardwareID = lHardware }
gES_TmpStationToPanel[6] = {Panel = 4, StationID = 105, CurrentID = 205, HardwareID = lHardware }
if gES_PayloadInfo.CurrentStation ~= 0 then -- gegebenenfalls prüfen ob sich CurrentStation geändert hat
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
end
end
function FuelQuantityIndicator(hardware)
local lHardware = hardware or 1
-- Fuel quantity shows the fuel remaining in all tanks
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo == nil then
return
end
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[7].CLSID == 2BEC576B-CDF5-4B7F-961F-B0FA4312B841 -- ext 1500l Fuel Tank
]]
SendDataHW("300", string.format("%d", math.round(((lEngineInfo.fuel_internal + lEngineInfo.fuel_external) / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- internal fuel in kg
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
--[[
local lPayloadInfo = LoGetPayloadInfo()
if lPayloadInfo ~= nil then
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
if lPayloadInfo.Stations[7].CLSID == "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}" then -- center tanks presend and full
SendDataHW("303", ((lEngineInfo.fuel_external < 1200.0 ) and 1 or 0), lHardware )
else
SendDataHW("303", 1, lHardware )
end
if lPayloadInfo.Stations[3].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" or
lPayloadInfo.Stations[4].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" then -- external tank presend and full (panel 2 and 5)
SendDataHW("304", ((lEngineInfo.fuel_internal < 2830.0 ) and 1 or 0), lHardware )
else
SendDataHW("304", 1, lHardware )
end
else
SendDataHW("303", 1, lHardware )
SendDataHW("304", 1, lHardware )
end]]
SendDataHW("304", (lEngineInfo.fuel_internal < 3200.0 and 1 or 0), lHardware ) -- Tank warning 1
SendDataHW("305", (lEngineInfo.fuel_internal < 2800.0 and 1 or 0), lHardware ) -- Tank warning 2
SendDataHW("306", (lEngineInfo.fuel_internal < 1390.0 and 1 or 0), lHardware ) -- Tank warning 3
SendDataHW("307", (lEngineInfo.fuel_internal < 760.0 and 1 or 0), lHardware ) -- Tank warning 4
--SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
end
function MechanicalDevicesIndicator(hardware)
local lHardware = hardware or 1
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo == nil then
return
end
--[[
[hook] = {
[status] = number: "0"
[value] = number: "0"
}
[parachute] = {
[status] = number: "0"
[value] = number: "0"
}
[controlsurfaces] = {
[eleron] = {
[left] = number: "0"
[right] = number: "-0.21084336936474"
}
[elevator] = {
[left] = number: "-0"
[right] = number: "-0"
}
[rudder] = {
[left] = number: "0"
[right] = number: "0"
}
}
[airintake] = {
[status] = number: "0"
[value] = number: "0"
}
[canopy] = {
[status] = number: "0"
[value] = number: "0"
}
[refuelingboom] = {
[status] = number: "0"
[value] = number: "0"
}
[wing] = {
[status] = number: "0"
[value] = number: "0"
}
[noseflap] = {
[status] = number: "0"
[value] = number: "0"
}
[gear] = {
[value] = number: "0"
[nose] = {
[rod] = number: "0"
}
[main] = {
[left] = {
[rod] = number: "0"
}
[right] = {
[rod] = number: "0"
}
}
[status] = number: "0"
}
[speedbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[wheelbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[flaps] = {
[status] = number: "0"
[value] = number: "0"
}]]
--SendDataHW("500", lMechInfo.gear.status )
--SendDataHW("501", lMechInfo.gear.value )
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
--SendDataHW("520", lMechInfo.wheelbrakes.status ) -- not in use
--SendDataHW("521", lMechInfo.wheelbrakes.value ) -- not in use
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
--SendDataHW("540", lMechInfo.parachute.status )
SendDataHW("541", (lMechInfo.parachute.value < 0.5 and 1 or 0), lHardware )
--SendDataHW("550", lMechInfo.noseflap.status )
SendDataHW("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0), lHardware )
SendDataHW("560", lMechInfo.airintake.status, lHardware )
--SendDataHW("561", lMechInfo.airintake.value )
end

559
ExportsModules/P-51D.lua Normal file
View File

@ -0,0 +1,559 @@
-- P-51D Export
-- Version 0.9.9 BETA
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
--[[
every frames arguments
based of "mainpanel_init.lua"
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
[DeviceID] = "Format"
[4] = "%.4f", <- floating-point number with 4 digits after point
[19] = "%0.1f", <- floating-point number with 1 digit after point
[129] = "%1d", <- decimal number
]]
-- Flight Instruments
[11] = "%.4f", -- AirspeedNeedle
[29] = "%.4f", -- Variometer
-- Altimeter
[97] = "%.4f", -- Altimeter_Pressure
[96] = "%.41f", -- Altimeter_10000_footPtr
[24] = "%.4f", -- Altimeter_1000_footPtr
[25] = "%.4f", -- Altimeter_100_footPtr
-- Artificial horizon
[15] = "%.4f", -- AHorizon_Pitch
[14] = "%.4f", -- AHorizon_Bank
[16] = "%.1f", -- AHorizon_PitchShift
[20] = "%.1f", -- AHorizon_Caged
-- directional gyro
[12] = "%.4f", -- GyroHeading
-- turn indicator
[27] = "%.4f", -- TurnNeedle
[28] = "%.4f", -- Slipball
-- oxygen pressure indicator
[34] = "%.4f", -- Oxygen_Pressure
[33] = "%.4f", -- Oxygen_Flow_Blinker
-- fuel system
[155] = "%.4f", -- Fuel_Tank_Left
[156] = "%.4f", -- Fuel_Tank_Right
[160] = "%.4f", -- Fuel_Tank_Fuselage
[32] = "%.4f", -- Fuel_Pressure
-- A-11 clock
[4] = "%.4f", -- CLOCK_currtime_hours
[5] = "%.4f", -- CLOCK_currtime_minutes
[6] = "%.4f", -- CLOCK_currtime_seconds
-- AN5730 remote compass
[1] = "%.4f", -- CompassHeading
[2] = "%.4f", -- CommandedCourse
[3] = "%.4f", -- CommandedCourseKnob
-- TailRadarWarning
[161] = "%.1f", -- Lamp TailRadarWarning
-- SCR-522A Control panel
[122] = "%.1f", -- A_channel_light
[123] = "%.1f", -- B_channel_light
[124] = "%.1f", -- C_channel_light
[125] = "%.1f", -- D_channel_light
[126] = "%.1f", -- Transmit_light
-- hydraulic pressure
[78] = "%.4f", -- Hydraulic_Pressure
-- Landing gears handle
[150] = "%.4f", -- Landing_Gear_Handle
[151] = "%.4f", -- Landing_Gear_Handle_Indoor
[80] = "%.1f", -- LandingGearGreenLight
[82] = "%.1f", -- LandingGearRedLight
-- gauges
[10] = "%.4f", -- Manifold_Pressure
[23] = "%.4f", -- Engine_RPM
[9] = "%.4f", -- Vacuum_Suction
[21] = "%.4f", -- Carb_Temperature
[22] = "%.4f", -- Coolant_Temperature
[30] = "%.4f", -- Oil_Temperature
[31] = "%.4f", -- Oil_Pressure
[164] = "%.1f", -- Left_Fluor_Light
[165] = "%.1f", -- Right_Fluor_Light
[59] = "%.1f", -- Hight_Blower_Lamp
-- Trimmer
[170] = "%.4f", -- Aileron_Trimmer
[172] = "%.4f", -- Rudder_Trimmer
[171] = "%.4f", -- Elevator_Trimmer
[174] = "%.4f", -- Control_Lock_Bracket
[175] = "%.4f", -- Accelerometer_main
[177] = "%.4f", -- Accelerometer_min
[178] = "%.4f", -- Accelerometer_max
[101] = "%.4f", -- Ammeter
-- light
[185] = "%.1f", -- Left_cockpit_light
[186] = "%.1f", -- Right_cockpit_light
[190] = "%.4f", -- warEmergencyPowerLimWire
-------------
[181] = "%.4f", -- Panel_Shake_Z
[180] = "%.4f", -- Panel_Shake_Y
[189] = "%.4f", -- Panel_Rot_X
[162] = "%.1f", -- Canopy_Trucks
[163] = "%.1f", -- Canopy_Visibility
-- Stick
[50] = "%.4f", -- StickPitch
[51] = "%.4f", -- StickBank
-- RudderPedals
[54] = "%.4f", -- RudderPedals
[55] = "%.4f", -- Left_Wheel_Brake
[56] = "%.4f", -- Right_Wheel_Brake
-- K-14 gunsight
[36] = "%.4f", -- sightRange
[188] = "%.4f", -- K_14_Shake_Z
[187] = "%.4f", -- K_14_Shake_Y
-------------
[45] = "%.4f", -- ThrottleTwistGrip
-------------
[77] = "%.4f" -- Rocket_Counter
}
gES_GlassCockpitConfigArguments =
{
--[[
arguments for export in low tick interval
based on "clickabledata.lua"
]]
-- Right Swich Panel
[102] = "%d", -- Generator Connect/Disconnect
[103] = "%d", -- Battery Connect/Disconnect
[104] = "%d", -- Gun Heating ON/OFF
[105] = "%d", -- Pitot Heating ON/OFF
[106] = "%d", -- Wing Position Lights Bright/Off/Dim
[107] = "%d", -- Tail Position Lights Bright/Off/Dim
[108] = "%d", -- Red Recognition Light Key/Off/Steady
[109] = "%d", -- Green Recognition Light Key/Off/Steady
[110] = "%d", -- Amber Recognition Light Key/Off/Steady
[111] = "%d", -- Recognition Lights Key
[112] = "%d", -- Circuit Protectors Reset
[100] = "%d", -- Right Fluorescent Light
[90] = "%d", -- Left Fluorescent Light
-- Flight Instrument panel
[3] = "%.4f", -- Course Set
[179] = "%.4f", -- Heading Set/Cage
[13] = "%d", -- Heading Set/Cage Button
[17] = "%.4f", -- Pitch Adjustment
[19] = "%.4f", -- Cage
[18] = "%d", -- Cage Button
[8] = "%d", -- Winding/Adjustment Clock ??
[7] = "%d", -- Winding/Adjustment Clock ??
[26] = "%.4f", -- Set Pressure
-- SCR-522A Control panel
[117] = "%d", -- Radio ON/OFF
[118] = "%d", -- A Channel Activate
[119] = "%d", -- B Channel Activate
[120] = "%d", -- C Channel Activate
[121] = "%d", -- D Channel Activate
[127] = "%.4f", -- Radio Lights Dimmer
[116] = "%.4f", -- Radio Audio Volume
[44] = "%d", -- Microphone On
[129] = "%d", -- Switch Locking Lever
[128] = "%.4f", -- Radio Mode Transmit/Receive/Remote
-------------
[71] = "%.4f", -- Cockpit Lights
[66] = "%0.1f", -- Ignition Off/Right/Left/Both
[67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On
[72] = "%d", -- Silence Landing Gear Warning Horn Cut Off
-- Bomb Arm/Chemical
[69] = "%d", -- Left Bomb Arm/Chemical
[70] = "%d", -- Right Bomb Arm/Chemical
-- Release Mode
[68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm
[73] = "%0.1f", -- Rockets Release Mode Off/Single/Auto
[74] = "%d", -- Rockets Delay Switch Delay/Int
[75] = "%0.1f", -- Rockets Counter Control
-- Engine Control Panel
[58] = "%d", -- Supercharger Switch Cover
[57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH
[60] = "%d", -- High Blower Lamp Test
[61] = "%d", -- Fuel Booster On/Off
[62] = "%d", -- Oil Dilute Activate
[63] = "%d", -- Starter Activate
[64] = "%d", -- Starter Switch Cover
[65] = "%d", -- Primer Activate
-- Oxygen Regulator
[131] = "%d", -- Auto-Mix On-Off
[130] = "%0.4f", -- Oxygen Emergency By-pass
-- Fuel system
[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
[86] = "%d", -- Fuel Shut-Off Valve ON/OFF
-- AN/APS-13
[114] = "%d", -- ail Warning Radar Power ON/OFF
[115] = "%d", -- Tail Warning Radar Test
[113] = "%.4f", -- Tail Warning Radar Light Control
-------------
[79] = "%.4f", -- Hydraulic Release Knob
[94] = "%.4f", -- Flaps Control Handle
[84] = "%d", -- Parking Brake Handle
[81] = "%d", -- Safe Landing Gear Light Test
[83] = "%d", -- Unsafe Landing Gear Light Test
-- Detrola receiver
[137] = "%0.4f", -- Detrola Frequency Selector
[138] = "%0.4f", -- Detrola Volume
-- canopy
[147] = "%.4f", -- Canopy Hand Crank
[149] = "%d", -- Canopy Emergency Release Handle
-- AN/ARA-8
[152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING
[153] = "%d", -- Homing Adapter Power On/Off
[154] = "%d", -- Homing Adapter's Circuit Breaker
-- SCR-695
[139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6
[140] = "%d", -- IFF Power On/Off
[141] = "%d", -- IFF TIME/OFF/ON
[142] = "%d", -- IFF Detonator Circuit On/Off
[143] = "%d", -- IFF Distress Signal On/Off
[145] = "%d", -- IFF Detonator Left
[146] = "%d", -- IFF Detonator Right
-- Trimmers
[91] = "%.4f", -- Aileron Trim
[92] = "%.4f", -- Elevator Trim
[93] = "%.4f", -- Rudder Trim
-------------
[157] = "%.4f", -- Defroster
[158] = "%.4f", -- Cold Air
[159] = "%.4f", -- Hot Air
-------------
[89] = "%d", -- Landing Light On/Off
[168] = "%d", -- Coolant Control Cover
[87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control
[169] = "%d", -- Oil Control Cover
[88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control
[134] = "%0.1f", -- Carburetor Cold Air Control
[135] = "%0.1f", -- Carburetor Warm Air Control
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
[43] = "%.4f", -- Throttle
[46] = "%.4f", -- Propeller RPM
[173] = "%.4f", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
[48] = "%.4f", -- Lock Throttle
[49] = "%.4f", -- Lock Propeller & Mixture
[176] = "%.4f", -- G-meter reset
[183] = "%.4f", -- Mirror
--Gunsight Selector
[41] = "%d", -- Sight On/Off
[39] = "%d", -- Fixed Reticle Mask Lever
[40] = "%0.1f", -- Sight Mode, Fixed Sight/Fixed-Gyro Sight/Gyro Sight
[42] = "%.4f", -- Gun Sight Brightness
[35] = "%.4f", -- Wing Span Selector
-------------
[132] = "%.4f", -- Left Payload Salvo
[133] = "%.4f" -- Right Payload Salvo
}
-----------------------------
-- HIGH IMPORTANCE EXPORTS --
-- done every export event --
-----------------------------
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
--[[
every frame export to GlassCockpit
Example from A-10C
Get Radio Frequencies
get data from device
local lUHFRadio = GetDevice(54)
SendData("ExportID", "Format")
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HELIOS: '..t)
local MainPanel = GetDevice(0)
local AirspeedNeedle = MainPanel:get_argument_value(11)*1000
local Altimeter_10000_footPtr = MainPanel:get_argument_value(96)*100000
local Variometer = MainPanel:get_argument_value(29)
local TurnNeedle = MainPanel:get_argument_value(27)
local Slipball = MainPanel:get_argument_value(28)
local CompassHeading = MainPanel:get_argument_value(1)
local CommandedCourse = MainPanel:get_argument_value(2)
local Manifold_Pressure = MainPanel:get_argument_value(10)
local Engine_RPM = MainPanel:get_argument_value(23)
local AHorizon_Pitch = MainPanel:get_argument_value(15)
local AHorizon_Bank = MainPanel:get_argument_value(14)
local AHorizon_PitchShift = MainPanel:get_argument_value(16) * 10.0 * math.pi/180.0
local AHorizon_Caged = MainPanel:get_argument_value(20)
local GyroHeading = MainPanel:get_argument_value(12)
local vaccum_suction = MainPanel:get_argument_value(9)
local carburator_temp = MainPanel:get_argument_value(21)
local coolant_temp = MainPanel:get_argument_value(22)
local Acelerometer = MainPanel:get_argument_value(175)
local OilTemperature = MainPanel:get_argument_value(30)
local OilPressure = MainPanel:get_argument_value(31)
local FuelPressure = MainPanel:get_argument_value(32)
local Clock_hours = MainPanel:get_argument_value(4)
local Clock_minutes = MainPanel:get_argument_value(5)
local Clock_seconds = MainPanel:get_argument_value(6)
local LandingGearGreenLight = MainPanel:get_argument_value(80)
local LandingGearRedLight = MainPanel:get_argument_value(82)
local Hight_Blower_Lamp = MainPanel:get_argument_value(59)
local Acelerometer_Min = MainPanel:get_argument_value(177)
local Acelerometer_Max = MainPanel:get_argument_value(178)
local Ammeter = MainPanel:get_argument_value(101)
local hydraulic_Pressure = MainPanel:get_argument_value(78)
local Oxygen_Flow_Blinker = MainPanel:get_argument_value(33)
local Oxygen_Pressure = MainPanel:get_argument_value(34)
local Fuel_Tank_Left = MainPanel:get_argument_value(155)
local Fuel_Tank_Right = MainPanel:get_argument_value(156)
local Fuel_Tank_Fuselage = MainPanel:get_argument_value(160)
local Tail_radar_warning = MainPanel:get_argument_value(161)
local Channel_A = MainPanel:get_argument_value(122)
local Channel_B = MainPanel:get_argument_value(123)
local Channel_C = MainPanel:get_argument_value(124)
local Channel_D = MainPanel:get_argument_value(125)
local transmit_light = MainPanel:get_argument_value(126)
local RocketCounter = MainPanel:get_argument_value(77)
--- preparing landing gear and High Blower lights, all together, in only one value
local gear_lights = 0
if LandingGearGreenLight > 0 then gear_lights = gear_lights +100 end
if LandingGearRedLight > 0 then gear_lights = gear_lights +10 end
if Hight_Blower_Lamp > 0 then gear_lights = gear_lights +1 end
------------------------------------------------------------
--- preparing radio lights, all together, in only one value
local radio_active = 0
if Channel_A > 0 then radio_active = 1 end
if Channel_B >0 then radio_active= 2 end
if Channel_C >0 then radio_active= 3 end
if Channel_D >0 then radio_active= 4 end
if transmit_light >0 then radio_active = radio_active + 10 end
------------------------------------------------------------
---- sending P51 and tf51 data across fc2 interface
----Please comment out the appropriate entries in the table 'gES_GlassCockpitConfigEveryFrameArguments'.
SendData("1", string.format("%.5f", math.floor((AHorizon_Pitch+1)*1000) + ((AHorizon_Bank+1)/100) ) ) -- pitch
SendData("2", string.format("%.3f", math.floor(Oxygen_Flow_Blinker*100) + (Oxygen_Pressure/100) ) ) -- bank
SendData("3", string.format("%.4f", math.floor(OilTemperature*100) + (vaccum_suction/100) ) ) -- yaw
SendData("4", string.format("%.3f", math.floor(Altimeter_10000_footPtr) + (AHorizon_Caged/100) ) ) -- barometric altitude
SendData("5", string.format("%.5f", math.floor(Clock_hours*1000000) + (Tail_radar_warning/100) ) ) -- radar altitude
SendData("6", string.format("%.5f", math.floor(CompassHeading*1000) + (CommandedCourse/100) ) ) -- adf
SendData("7", string.format("%.4f", math.floor(Clock_seconds*100) + (hydraulic_Pressure/100) ) ) -- rmi
SendData("8", string.format("%.2f", math.floor(GyroHeading*1000) + (radio_active/100) ) ) -- heading
SendData("9", string.format("%.4f", math.floor(Engine_RPM*100) + (Manifold_Pressure/100) ) ) -- left rpm
SendData("10", string.format("%.4f", math.floor(Fuel_Tank_Left*100) + (Fuel_Tank_Right/100) ) ) -- right rpm
SendData("11", string.format("%.4f", math.floor(carburator_temp*100) + (coolant_temp/100) ) ) -- left temp
SendData("12", string.format("%.4f", math.floor(gear_lights) + (Acelerometer_Min/100 ) ) ) -- right temp
SendData("13", string.format("%.2f", Variometer) ) -- vvi
SendData("14", string.format("%.5f", math.floor(AirspeedNeedle)+ (RocketCounter/100) ) ) -- ias
SendData("15", string.format("%.4f", math.floor(OilPressure*100) + (FuelPressure/100) ) ) -- distance to way
SendData("16", string.format("%.3f", math.floor(Acelerometer*1000) + (Acelerometer_Max/100 ) ) ) -- aoa
SendData("17", string.format("%.4f", math.floor((TurnNeedle+1)*100) + ((Slipball+1)/100) ) ) -- glide
SendData("18", string.format("%.4f", math.floor(Fuel_Tank_Fuselage*100) + (Ammeter/100) ) ) -- side
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
-- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HawgTouch: '..t)
-- ADI AN5736
-- Artificial horizon
--[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0}
--[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
--[16] = "%.1f", -- AHorizon_PitchShift
--[20] = "%.1f", -- AHorizon_Caged
SendData(2000, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(15),
mainPanelDevice:get_argument_value(14)))
-- turn indicator AN5820
--[27] = "%.4f", -- TurnNeedle {-1.0, 1.0}
--[28] = "%.4f", -- Slipball {-1.0, 1.0}
SendData(2001, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(27),
mainPanelDevice:get_argument_value(28)))
-- directional gyro AN5735
--[12] = "%.1f", -- GyroHeading {0.0, 1.0}
-- Vacuum_Suction AN5771-5
--[9] = "%.4f", -- Vacuum_Suction {0.0, 1.0}
-- F-2 Airspeed Indicator
-- [11] = "%.2f", -- 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}
-- Altimeter AN5760-2
--[96] = "%.1f", -- Altimeter_10000_footPtr {0.0, 1.0}
--[24] = "%.1f", -- Altimeter_1000_footPtr {0.0, 1.0}
--[25] = "%.1f", -- Altimeter_100_footPtr {0.0, 1.0}
--[97] = "%.1f", -- Altimeter_Pressure {28.1, 31.0} {0.0, 1.0}
SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(96),
mainPanelDevice:get_argument_value(24),
mainPanelDevice:get_argument_value(25),
mainPanelDevice:get_argument_value(97)))
-- Rate of Climb Indicator AN5825
--[29] = "%.1f", -- Variometer {0.0, 1.0}
-- D-10 Manifold Pressure Indicator
--[10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0}
-- Tachometer
--[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0}
-- AN5790-6 Carburetor Air Temperature Indicator
--[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
-- Coolant Temperature Indicator
--[22] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
-- Engine Gauge
--[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0.0, 1.0}
--[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0.0, 1.0}
--[32] = "%.1f", -- Fuel_Pressure {0.0, 25.0} -- PSI {0.0, 1.0}
SendData(2003, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(30),
mainPanelDevice:get_argument_value(31),
mainPanelDevice:get_argument_value(32)))
-- Remote Indicator Compass
-- AN5730 remote compass
--[1] = "%.4f", -- CompassHeading {0.0, 1.0}
--[2] = "%.4f", -- CommandedCourse {0.0, 1.0}
SendData(2004, string.format("%0.4f;%0.4f",
mainPanelDevice:get_argument_value(1),
mainPanelDevice:get_argument_value(2)))
-- A-11 clock
--[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 1.0}
--[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 1.0}
--[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 1.0}
SendData(2005, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(4),
mainPanelDevice:get_argument_value(5),
mainPanelDevice:get_argument_value(6)))
-- Oxygen Flow Indicator
--[33] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
-- Oxygen Pressure Gauge
--[34] = "%.1f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0}
-- Hydraulic Pressure Gauge
--[78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} -- PSI {0.0, 1.0}
-- Fuel Gauges
-- Left Wing Main Tank
--[155] = "%.2f", -- Fuel_Tank_Left {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0}
-- Fuselage Tank
--[160] = "%.2f", -- Fuel_Tank_Fuselage {0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 85.0} -- US GAL {0.0, 0.12, 0.28, 0.40, 0.51, 0.62, 0.72, 0.83, 0.96, 1.0}
-- Right Wing Main Tank
--[156] = "%.2f", -- Fuel_Tank_Right {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0}
-- AN-5745 accelerometer indicator
--[175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0}
--[177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0}
--[178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0}
SendData(2006, string.format("%0.4f;%0.4f;%0.4f",
mainPanelDevice:get_argument_value(175),
mainPanelDevice:get_argument_value(177),
mainPanelDevice:get_argument_value(178)))
-- Landing Gear Warning Lights
--[80] = "%.1f", -- LandingGearGreenLight
--[82] = "%.1f", -- LandingGearRedLight
SendData(2007, string.format("%.1f;%.1f",
mainPanelDevice:get_argument_value(80),
mainPanelDevice:get_argument_value(82)))
-- AMMETER
--[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0}
end
end
function ProcessHARDWAREConfigHighImportance(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
]]
-- no dimming lights
-- TailRadarWarning
SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.3 and 1 or 0) -- Lamp TailRadarWarning
-- SCR-522A Control panel
SendDataHW("122", mainPanelDevice:get_argument_value(122) > 0.3 and 1 or 0) -- A_channel_light
SendDataHW("123", mainPanelDevice:get_argument_value(123) > 0.3 and 1 or 0) -- B_channel_light
SendDataHW("124", mainPanelDevice:get_argument_value(124) > 0.3 and 1 or 0) -- C_channel_light
SendDataHW("125", mainPanelDevice:get_argument_value(125) > 0.3 and 1 or 0) -- D_channel_light
SendDataHW("126", mainPanelDevice:get_argument_value(126) > 0.3 and 1 or 0) -- Transmit_light
-- Landing gears
SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- LandingGearGreenLight
SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- LandingGearRedLight
-- Engine
SendDataHW("59", mainPanelDevice:get_argument_value(59) > 0.3 and 1 or 0) -- Hight_Blower_Lamp
-- Cockpit Lights
SendDataHW("164", mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Left_Fluor_Light
SendDataHW("165", mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Right_Fluor_Light
SendDataHW("185", mainPanelDevice:get_argument_value(185) > 0.3 and 1 or 0) -- Left_cockpit_light
SendDataHW("186", mainPanelDevice:get_argument_value(186) > 0.3 and 1 or 0) -- Right_cockpit_light
--[[
-- dimming lights
-- TailRadarWarning
SendDataHW("161", string.format("%.1f", mainPanelDevice:get_argument_value(161))) -- Lamp TailRadarWarning
-- SCR-522A Control panel
SendDataHW("122", string.format("%.1f", mainPanelDevice:get_argument_value(122))) -- A_channel_light
SendDataHW("123", string.format("%.1f", mainPanelDevice:get_argument_value(123))) -- B_channel_light
SendDataHW("124", string.format("%.1f", mainPanelDevice:get_argument_value(124))) -- C_channel_light
SendDataHW("125", string.format("%.1f", mainPanelDevice:get_argument_value(125))) -- D_channel_light
SendDataHW("126", string.format("%.1f", mainPanelDevice:get_argument_value(126))) -- Transmit_light
-- Landing gears
SendDataHW("80", string.format("%.1f", mainPanelDevice:get_argument_value(80))) -- LandingGearGreenLight
SendDataHW("82", string.format("%.1f", mainPanelDevice:get_argument_value(82))) -- LandingGearRedLight
-- Engine
SendDataHW("59", string.format("%.1f", mainPanelDevice:get_argument_value(59))) -- Hight_Blower_Lamp
-- Cockpit Lights
SendDataHW("164", string.format("%.1f", mainPanelDevice:get_argument_value(164))) -- Left_Fluor_Light
SendDataHW("165", string.format("%.1f", mainPanelDevice:get_argument_value(165))) -- Right_Fluor_Light
SendDataHW("185", string.format("%.1f", mainPanelDevice:get_argument_value(185))) -- Left_cockpit_light
SendDataHW("186", string.format("%.1f", mainPanelDevice:get_argument_value(186))) -- Right_cockpit_light
]]
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
--[[
export in low tick interval to GlassCockpit
Example from A-10C
Get Radio Frequencies
get data from device
local lUHFRadio = GetDevice(54)
SendData("ExportID", "Format")
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
--[[
local lDETROLA = GetDevice(24)
WriteToLog('lDETROLA: '..dump(lDETROLA:is_on()))
WriteToLog('lDETROLA: '..dump(lDETROLA:get_frequency()))
--SendData(2000, string.format("%7.3f", lDETROLA:get_frequency()/1000000))
local lINTERCOM = GetDevice(31)
WriteToLog('lINTERCOM: '..dump(lINTERCOM:is_communicator_available()))
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_noise_level()))
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_signal_level()))
]]
--[[
local ltmp1 = 0
for ltmp2 = 1, 35, 1 do
ltmp1 = GetDevice(ltmp2)
WriteToLog(ltmp2..': '..dump(ltmp1))
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
end
]]
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
--[[
export in low tick interval to hardware
Example from A-10C
Landing Gear
mainPanelDevice, basis panel
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
]]
--[[
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
local ltmp1 = 0
for ltmp2 = 1, 10, 1 do
ltmp1 = list_indication(ltmp2)
WriteToLog(ltmp2..': '..dump(ltmp1))
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
end
]]
end

948
ExportsModules/Su-25.lua Normal file
View File

@ -0,0 +1,948 @@
-- Su-25A Export
-- Version 0.9.9 BETA
gES_FoundFCModule = true
-- auxiliary function
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / Su-25A --
-- FC aircraft don't support GetDevice --
-----------------------------------------
function ProcessGlassCockpitFCHighImportanceConfig()
local myData = LoGetSelfData()
if (myData) then
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
local lHeading = myData.Heading -- HEADING (Radian)
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
local lMachNumber = LoGetMachNumber() -- MACH
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
local lDistanceToWay = 999
local lRoute = LoGetRoute()
if (myData and lRoute) then -- if neither are nil
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
end
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- customizing for HELOS
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
lBank = math.deg(lBank) -- BANK (Radian to Grad)
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
lHSI_RMI = 360 - lHSI_RMI
lIAS = lIAS * 3.6 -- change from m/s to km/h
SendData("1", string.format("%.2f", lPitch) )
SendData("2", string.format("%.2f", lBank) )
SendData("3", string.format("%.2f", lYaw) )
SendData("4", string.format("%.2f", lAltBar) )
SendData("5", string.format("%.2f", lAltRad) )
SendData("6", string.format("%.2f", lHSI_ADF) )
SendData("7", string.format("%.2f", lHSI_RMI) )
SendData("8", string.format("%.2f", lHeading) )
SendData("9", string.format("%.2f", lEngineRPMleft) )
SendData("10", string.format("%.2f", lEngineRPMright) )
SendData("11", string.format("%.2f", lEngineTempLeft) )
SendData("12", string.format("%.2f", lEngineTempRight) )
SendData("13", string.format("%.2f", lVVI) )
SendData("14", string.format("%.2f", lIAS) )
SendData("15", string.format("%.2f", lDistanceToWay) )
SendData("16", string.format("%.2f", lAoA) )
SendData("17", string.format("%.2f", lGlide) )
SendData("18", string.format("%.2f", lSide) )
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
local lRadToDCSsignd = math.pi
local lRadToDCSunsignd = math.pi * 2
local lDefaultNull = 0.0
local lDefaultOne = 1.0
-- IAS-TAS Indicator (IAS, TAS) {"%.4f;%.4f"}
FC_Russian_AirSpeed_1100hkm(1)
-- AOA Indicator and Accelerometer (AOA, GLoad)
FC_Russian_AOA_Su25(3)
-- ADI
FC_Russian_ADI_Old(4)
-- HSI
FC_Russian_HSI_old(5)
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
FC_Russian_VVI_Old(6)
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
FC_Russian_RadarAltimeter_1500m(100, 7)
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
FC_Russian_BarometricAltimeter_late(8)
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
FC_Russian_EngineRPM(9)
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempLeft, 10)
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempRight, 11)
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
FC_Russian_Clock_late(12)
-- HSI Distance
FC_Russian_HSI_Distance_old(lDistanceToWay, 21)
-- Mach {max, Mach}
local lMachTmp = 0
if lMachNumber > 0.475 then
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 0.475 -- minimaler Eingangswert
x_max = 1.0 -- maximaler Eingangswert
x = 0.65 -- aktueller Eingangswert
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
d_x = 0.525 -- Delta Eingangswerte (x_max - x_min)
m = 1.9047619047619047619047619047619 -- Steigung der linearen Funktion (d_y / d_x)
n = -0.9047619047619047619047619047619 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0,333333333333333333333333333334 -- Ergebnis (m * x + n)
]]
lMachTmp = 1.9047619047619047619047619047619 * lMachNumber + -0.9047619047619047619047619047619
else
lMachTmp = 0
end
SendData("22", string.format("%0.4f;%0.4f", 0.665, lMachTmp))
end
else
WriteToLog("Unknown FC Error, no LoGetSelfData.")
end
end
function ProcessHARDWAREConfigHighImportance()
end
function ProcessGlassCockpitFCLowImportanceConfig()
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
FC_WeaponPanel_SU25(13)
FC_RadarWarning_SPO15(14)
-- Fuel Quantity Indicator
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
local lTotalFuel = lEngineInfo.fuel_internal
local lFuel_leftbar = 1.0
local lFuel_rightbar = 1.0
local lExtTank1 = 1.0 -- external tanks
local lExtTank2 = 1.0 -- inner tanks
if lTotalFuel < 5000 then
if lTotalFuel > 1500 then
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 1500 -- minimaler Eingangswert
x_max = 5000 -- maximaler Eingangswert
x = 3500 -- aktueller Eingangswert
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
d_x = 3500 -- Delta Eingangswerte (x_max - x_min)
m = 2.8571428571428571428571428571429e-4 -- Steigung der linearen Funktion (d_y / d_x)
n = -0.42857142857142857142857142857143 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0,57142857142857142857142857142857 -- Ergebnis (m * x + n)
]]
lFuel_leftbar = 2.8571428571428571428571428571429e-4 * lTotalFuel + -0.42857142857142857142857142857143
else
lFuel_leftbar = 0.0
end
else
lFuel_leftbar = 1.0
end
if lTotalFuel < 1200 then
lFuel_rightbar = lTotalFuel / 1200
else
lFuel_rightbar = 1.0
end
local lPayloadInfo = LoGetPayloadInfo()
if lPayloadInfo ~= nil then
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0)
end
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8)
lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0)
end
end
-- Fuel_leftbar
-- Fuel_rightbar
-- Light1
-- Light2
-- Light3
-- Light4
-- Light5
-- BingoLight
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
lFuel_leftbar,
lFuel_rightbar,
lExtTank1, -- external tanks
lExtTank2, -- inner tanks
(lEngineInfo.fuel_internal < 2790.0 and 1 or 0), -- Interne Flügeltanks
(lEngineInfo.fuel_internal < 1840.0 and 1 or 0), -- Interne Rumpftanks
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
-- Hydraulic Pressure Left
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
-- Hydraulic Pressure Right
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
end
-- EKRAN Message
FC_EKRAN(16)
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
FC_Russian_MDI_SU25(2)
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo ~= nil then
-- Wheelbrakes Hydraulic Pressure Left
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
-- Wheelbrakes Hydraulic Pressure Right
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
end
end
--(x < 0 and 'negative' or 'non-negative')
--[[
local lPayloadInfo = LoGetPayloadInfo()
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
local lSnares = LoGetSnares() -- Flare and Chaff
WriteToLog('lSnares: '..dump(lSnares))
local lSightingSystemInfo = LoGetSightingSystemInfo()
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
local lLockedTargetInformation = LoGetLockedTargetInformation()
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
WriteToLog('lMechInfo: '..dump(lMechInfo))
local lMCPState = LoGetMCPState() -- Warnlichter
WriteToLog('lMCPState: '..dump(lMCPState))
local lControlPanel_HSI = LoGetControlPanel_HSI()
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
local lEngineInfo = LoGetEngineInfo()
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
]]
-- Weapon Control System
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
-- values from LoGetTargetInformation().type
--WriteToLog('lNameByType: '..dump(lNameByType))
end
function ProcessHARDWAREConfigLowImportance()
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
WeaponStatusPanel()
MechanicalDevicesIndicator()
StatusLamp()
FuelQuantityIndicator()
SightingSystem()
SPO15RWR()
end
-----------------------------
-- Custom functions --
-----------------------------
function SightingSystem(hardware)
local lHardware = hardware or 1
local lSightingSystemInfo = LoGetSightingSystemInfo()
if lSightingSystemInfo == nil then
return
end
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
--[[
[PRF] = {
[selection] = string: "ILV"
[current] = string: "MED"
}
[laser_on] = boolean: "false"
[scale] = {
[azimuth] = number: "0.52359873056412"
[distance] = number: "10000"
}
[radar_on] = boolean: "false"
[optical_system_on] = boolean: "false"
[LaunchAuthorized] = boolean: "false"
[ECM_on] = boolean: "false"
[Manufacturer] = string: "RUS"
[TDC] = {
[y] = number: "0"
[x] = number: "0"
}
[ScanZone] = {
[coverage_H] = {
[min] = number: "0"
[max] = number: "20000"
}
[size] = {
[azimuth] = number: "1.0471974611282"
[elevation] = number: "0.17453290522099"
}
[position] = {
[exceeding_manual] = number: "0"
[distance_manual] = number: "0"
[azimuth] = number: "0"
[elevation] = number: "0"
}
}
]]
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
--SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
--SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
end
function FlareChaff(hardware)
local lHardware = hardware or 1
local lSnares = LoGetSnares() -- Flare and Chaff
if lSnares == nil then
return
end
--WriteToLog('lSnares: '..dump(lSnares))
--[chaff] = number: "128"
--[flare] = number: "128"
end
function StatusLamp(hardware)
local lHardware = hardware or 1
local lMCPState = LoGetMCPState() -- Warning Lights
if lMCPState == nil then
return
end
--WriteToLog('lMCPState: '..dump(lMCPState))
--[[
[RightTailPlaneFailure] = boolean: "false"
[EOSFailure] = boolean: "false"
[ECMFailure] = boolean: "false"
[RightAileronFailure] = boolean: "false"
[MasterWarning] = boolean: "false"
[RightEngineFailure] = boolean: "false"
[CannonFailure] = boolean: "false"
[MLWSFailure] = boolean: "false"
[ACSFailure] = boolean: "false"
[RadarFailure] = boolean: "false"
[HelmetFailure] = boolean: "false"
[HUDFailure] = boolean: "false"
[LeftMainPumpFailure] = boolean: "false"
[RightWingPumpFailure] = boolean: "false"
[LeftWingPumpFailure] = boolean: "false"
[MFDFailure] = boolean: "false"
[RWSFailure] = boolean: "false"
[GearFailure] = boolean: "false"
[HydraulicsFailure] = boolean: "false"
[AutopilotFailure] = boolean: "true"
[FuelTankDamage] = boolean: "false"
[LeftAileronFailure] = boolean: "false"
[CanopyOpen] = boolean: "false"
[RightMainPumpFailure] = boolean: "false"
[StallSignalization] = boolean: "false"
[LeftEngineFailure] = boolean: "false"
[AutopilotOn] = boolean: "false"
[LeftTailPlaneFailure] = boolean: "false"
]]
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
end
local lAoA = LoGetAngleOfAttack()
if lAoA ~= nil then
lAoA = lAoA * 57.3
SendDataHW("730", (lAoA > 20.0 and 1 or 0), lHardware ) -- lamp start AOA warning (0|1)
end
end
function WeaponStatusPanel(hardware)
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
local lHardware = hardware or 1
gES_PayloadInfo = LoGetPayloadInfo()
if gES_PayloadInfo == nil then
return
end
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
--[[ exsample
[Stations] = {
[1] = {
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "10"
[level2] = number: "4"
}
}
[2] = {
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "10"
[level2] = number: "4"
}
}
[3] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "7"
}
[count] = number: "20"
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "33"
[level1] = number: "4"
[level4] = number: "32"
[level2] = number: "7"
}
}
[4] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "7"
}
[count] = number: "20"
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "33"
[level1] = number: "4"
[level4] = number: "32"
[level2] = number: "7"
}
}
[5] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "99"
[level2] = number: "4"
}
[count] = number: "1"
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "45"
[level2] = number: "4"
}
}
[6] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "99"
[level2] = number: "4"
}
[count] = number: "1"
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "45"
[level2] = number: "4"
}
}
[7] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "47"
[level2] = number: "4"
}
[count] = number: "8"
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "58"
[level2] = number: "4"
}
}
[8] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "47"
[level2] = number: "4"
}
[count] = number: "8"
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "58"
[level2] = number: "4"
}
}
[9] = {
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "20"
[level2] = number: "5"
}
}
[10] = {
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "20"
[level2] = number: "5"
}
}
[11] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
}
[CurrentStation] = number: "0"
[Cannon] = {
[shells] = number: "250"
}
]]
--[[
Weapon Panel
|
---------------------------------------------------
| | | | | | | | | | |
1 2 3 4 5 C 6 7 8 9 10
]]
-- Payload Info
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
SendDataHW("110", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
SendDataHW("109", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
SendDataHW("108", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
SendDataHW("107", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
SendDataHW("105", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
SendDataHW("106", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
--SendDataHW("110", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
-- CurrentStation 5, panel 3
-- CurrentStation 3, panel 2
-- CurrentStation 7, panel 4
-- CurrentStation 4, panel 9
-- CurrentStation 9, panel 5
-- CurrentStation 10, panel 6
-- CurrentStation 8, panel 7
-- CurrentStation 6, panel 8
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
-- defination
if gES_CurrentStationTmp == nil then
gES_CurrentStationTmp = -1
end
if gES_PayloadInfo.CurrentStation > 0 and
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
gES_TmpStationToPanel = {}
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
gES_TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware } -- right
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
gES_TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
gES_TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
gES_TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
WeaponStatusPanel_Reset(201, 210, lHardware)
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
end
end
end
function FuelQuantityIndicator(hardware)
-- Fuel quantity shows the fuel remaining in all tanks
local lHardware = hardware or 1
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo == nil then
return
end
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
local lPayloadInfo = LoGetPayloadInfo()
if lPayloadInfo ~= nil then
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
SendDataHW("303", ((lEngineInfo.fuel_external < 1240.0 ) and 1 or 0), lHardware )
else
SendDataHW("303", 1, lHardware )
end
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tank presend and full (panel 3 and 8)
SendDataHW("304", ((lEngineInfo.fuel_external < 1.0 ) and 1 or 0), lHardware )
else
SendDataHW("304", 1, lHardware )
end
else
SendDataHW("303", 1, lHardware )
SendDataHW("304", 1, lHardware )
end
SendDataHW("305", (lEngineInfo.fuel_internal < 2790.0 and 1 or 0), lHardware ) -- Interne Flügeltanks
SendDataHW("306", (lEngineInfo.fuel_internal < 1840.0 and 1 or 0), lHardware ) -- Interne Rumpftanks
--SendDataHW("307", (lEngineInfo.fuel_internal < 1.0 and 1 or 0), lHardware ) -- Zentraler Rumpftanks
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
end
function MechanicalDevicesIndicator(hardware)
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
local lHardware = hardware or 1
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo == nil then
return
end
--[[
[hook] = {
[status] = number: "0"
[value] = number: "0"
}
[parachute] = {
[status] = number: "0"
[value] = number: "0"
}
[controlsurfaces] = {
[eleron] = {
[left] = number: "0"
[right] = number: "-0.21084336936474"
}
[elevator] = {
[left] = number: "-0"
[right] = number: "-0"
}
[rudder] = {
[left] = number: "0"
[right] = number: "0"
}
}
[airintake] = {
[status] = number: "0"
[value] = number: "0"
}
[canopy] = {
[status] = number: "0"
[value] = number: "0"
}
[refuelingboom] = {
[status] = number: "0"
[value] = number: "0"
}
[wing] = {
[status] = number: "0"
[value] = number: "0"
}
[noseflap] = {
[status] = number: "0"
[value] = number: "0"
}
[gear] = {
[value] = number: "0"
[nose] = {
[rod] = number: "0"
}
[main] = {
[left] = {
[rod] = number: "0"
}
[right] = {
[rod] = number: "0"
}
}
[status] = number: "0"
}
[speedbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[wheelbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[flaps] = {
[status] = number: "0"
[value] = number: "0"
}]]
--SendDataHW("500", lMechInfo.gear.status )
--SendDataHW("501", lMechInfo.gear.value )
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
local lTrueAirSpeed = LoGetTrueAirSpeed()
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
end

899
ExportsModules/Su-25T.lua Normal file
View File

@ -0,0 +1,899 @@
-- Su-25T Export
-- Version 0.9.9 BETA
gES_FoundFCModule = true
-- auxiliary function
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
-- FC aircraft don't support GetDevice --
-----------------------------------------
function ProcessGlassCockpitFCHighImportanceConfig()
local myData = LoGetSelfData()
if (myData) then
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
local lHeading = myData.Heading -- HEADING (Radian)
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
--local lMachNumber = LoGetMachNumber -- MACH
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
local lDistanceToWay = 999
local lRoute = LoGetRoute()
if (myData and lRoute) then -- if neither are nil
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
end
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- customizing for HELOS
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
lBank = math.deg(lBank) -- BANK (Radian to Grad)
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
lHSI_RMI = 360 - lHSI_RMI
lIAS = lIAS * 3.6 -- change from m/s to km/h
SendData("1", string.format("%.2f", lPitch) )
SendData("2", string.format("%.2f", lBank) )
SendData("3", string.format("%.2f", lYaw) )
SendData("4", string.format("%.2f", lAltBar) )
SendData("5", string.format("%.2f", lAltRad) )
SendData("6", string.format("%.2f", lHSI_ADF) )
SendData("7", string.format("%.2f", lHSI_RMI) )
SendData("8", string.format("%.2f", lHeading) )
SendData("9", string.format("%.2f", lEngineRPMleft) )
SendData("10", string.format("%.2f", lEngineRPMright) )
SendData("11", string.format("%.2f", lEngineTempLeft) )
SendData("12", string.format("%.2f", lEngineTempRight) )
SendData("13", string.format("%.2f", lVVI) )
SendData("14", string.format("%.2f", lIAS) )
SendData("15", string.format("%.2f", lDistanceToWay) )
SendData("16", string.format("%.2f", lAoA) )
SendData("17", string.format("%.2f", lGlide) )
SendData("18", string.format("%.2f", lSide) )
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
local lRadToDCSsignd = math.pi
local lRadToDCSunsignd = math.pi * 2
local lDefaultNull = 0.0
local lDefaultOne = 1.0
-- IAS-TAS Indicator (IAS, TAS) {"%.4f;%.4f"}
FC_Russian_AirSpeed_1100hkm(1)
-- AOA Indicator and Accelerometer (AOA, GLoad)
FC_Russian_AOA_Su25(3)
-- ADI
FC_Russian_ADI_Old(4)
-- HSI
FC_Russian_HSI(lDistanceToWay, 5)
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
FC_Russian_VVI_Old(6)
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
FC_Russian_RadarAltimeter_1500m(100, 7)
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
FC_Russian_BarometricAltimeter_late(8)
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
FC_Russian_EngineRPM(9)
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempLeft, 10)
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_Russian_EGT_1000gc(lEngineTempRight, 11)
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
FC_Russian_Clock_late(12)
end
else
WriteToLog("Unknown FC Error, no LoGetSelfData.")
end
end
function ProcessHARDWAREConfigHighImportance()
end
function ProcessGlassCockpitFCLowImportanceConfig()
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
FC_WeaponPanel_SU25(13)
FC_RadarWarning_SPO15(14)
-- Fuel Quantity Indicator
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
local lTotalFuel = lEngineInfo.fuel_internal
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
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}
lTotalFuel = string.format("%03d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil")) -- auf drei stellen bringen
local lExtTank1 = 1.0 -- external tanks
local lExtTank2 = 1.0 -- inner tanks
local lPayloadInfo = LoGetPayloadInfo()
if lPayloadInfo ~= nil then
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0)
end
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8)
lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0)
end
end
-- TotalFuel_100
-- TotalFuel_10
-- TotalFuel_1
-- Light1
-- Light2
-- Light3
-- Light4
-- Light5
-- BingoLight
SendData("15", string.format("%0.2f;%0.2f;%0.2f;%d;%d;%d;%d;%d;%d",
lFuelCounter[tonumber(string.sub(lTotalFuel, 1, 1))],
lFuelCounter[tonumber(string.sub(lTotalFuel, 2, 2))],
lFuelCounter[tonumber(string.sub(lTotalFuel, 3, 3))],
lExtTank1, -- external tanks
lExtTank2, -- inner tanks
(lEngineInfo.fuel_internal < 2800.0 and 1 or 0), -- Interne Flügeltanks
(lEngineInfo.fuel_internal < 1840.0 and 1 or 0), -- Interne Rumpftanks
(lEngineInfo.fuel_internal < 1.0 and 1 or 0), -- Zentraler Rumpftanks
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
-- Hydraulic Pressure Left
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
-- Hydraulic Pressure Right
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
end
-- EKRAN Message
FC_EKRAN(16)
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
FC_Russian_MDI_SU25(2)
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo ~= nil then
-- Wheelbrakes Hydraulic Pressure Left
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
-- Wheelbrakes Hydraulic Pressure Right
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
end
end
--(x < 0 and 'negative' or 'non-negative')
--[[
local lPayloadInfo = LoGetPayloadInfo()
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
local lSnares = LoGetSnares() -- Flare and Chaff
WriteToLog('lSnares: '..dump(lSnares))
local lSightingSystemInfo = LoGetSightingSystemInfo()
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
local lLockedTargetInformation = LoGetLockedTargetInformation()
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
WriteToLog('lMechInfo: '..dump(lMechInfo))
local lMCPState = LoGetMCPState() -- Warnlichter
WriteToLog('lMCPState: '..dump(lMCPState))
local lControlPanel_HSI = LoGetControlPanel_HSI()
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
local lEngineInfo = LoGetEngineInfo()
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
]]
-- Weapon Control System
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
-- values from LoGetTargetInformation().type
--WriteToLog('lNameByType: '..dump(lNameByType))
end
function ProcessHARDWAREConfigLowImportance()
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
WeaponStatusPanel()
MechanicalDevicesIndicator()
StatusLamp()
FuelQuantityIndicator()
SightingSystem()
SPO15RWR()
end
-----------------------------
-- Custom functions --
-----------------------------
function SightingSystem(hardware)
local lHardware = hardware or 1
local lSightingSystemInfo = LoGetSightingSystemInfo()
if lSightingSystemInfo == nil then
return
end
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
--[[
[PRF] = {
[selection] = string: "ILV"
[current] = string: "MED"
}
[laser_on] = boolean: "false"
[scale] = {
[azimuth] = number: "0.52359873056412"
[distance] = number: "10000"
}
[radar_on] = boolean: "false"
[optical_system_on] = boolean: "false"
[LaunchAuthorized] = boolean: "false"
[ECM_on] = boolean: "false"
[Manufacturer] = string: "RUS"
[TDC] = {
[y] = number: "0"
[x] = number: "0"
}
[ScanZone] = {
[coverage_H] = {
[min] = number: "0"
[max] = number: "20000"
}
[size] = {
[azimuth] = number: "1.0471974611282"
[elevation] = number: "0.17453290522099"
}
[position] = {
[exceeding_manual] = number: "0"
[distance_manual] = number: "0"
[azimuth] = number: "0"
[elevation] = number: "0"
}
}
]]
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
--SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
end
function FlareChaff(hardware)
local lHardware = hardware or 1
local lSnares = LoGetSnares() -- Flare and Chaff
if lSnares == nil then
return
end
--WriteToLog('lSnares: '..dump(lSnares))
--[chaff] = number: "128"
--[flare] = number: "128"
end
function StatusLamp(hardware)
local lHardware = hardware or 1
local lMCPState = LoGetMCPState() -- Warning Lights
if lMCPState == nil then
return
end
--WriteToLog('lMCPState: '..dump(lMCPState))
--[[
[RightTailPlaneFailure] = boolean: "false"
[EOSFailure] = boolean: "false"
[ECMFailure] = boolean: "false"
[RightAileronFailure] = boolean: "false"
[MasterWarning] = boolean: "false"
[RightEngineFailure] = boolean: "false"
[CannonFailure] = boolean: "false"
[MLWSFailure] = boolean: "false"
[ACSFailure] = boolean: "false"
[RadarFailure] = boolean: "false"
[HelmetFailure] = boolean: "false"
[HUDFailure] = boolean: "false"
[LeftMainPumpFailure] = boolean: "false"
[RightWingPumpFailure] = boolean: "false"
[LeftWingPumpFailure] = boolean: "false"
[MFDFailure] = boolean: "false"
[RWSFailure] = boolean: "false"
[GearFailure] = boolean: "false"
[HydraulicsFailure] = boolean: "false"
[AutopilotFailure] = boolean: "true"
[FuelTankDamage] = boolean: "false"
[LeftAileronFailure] = boolean: "false"
[CanopyOpen] = boolean: "false"
[RightMainPumpFailure] = boolean: "false"
[StallSignalization] = boolean: "false"
[LeftEngineFailure] = boolean: "false"
[AutopilotOn] = boolean: "false"
[LeftTailPlaneFailure] = boolean: "false"
]]
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
end
local lAoA = LoGetAngleOfAttack()
if lAoA ~= nil then
lAoA = lAoA * 57.3
SendDataHW("730", (lAoA > 20.0 and 1 or 0), lHardware ) -- lamp start AOA warning (0|1)
end
end
function WeaponStatusPanel(hardware)
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
local lHardware = hardware or 1
gES_PayloadInfo = LoGetPayloadInfo()
if gES_PayloadInfo == nil then
return
end
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
--[[ exsample
[Stations] = {
[1] = {
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "10"
[level2] = number: "4"
}
}
[2] = {
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "10"
[level2] = number: "4"
}
}
[3] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "7"
}
[count] = number: "20"
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "33"
[level1] = number: "4"
[level4] = number: "32"
[level2] = number: "7"
}
}
[4] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "7"
}
[count] = number: "20"
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "33"
[level1] = number: "4"
[level4] = number: "32"
[level2] = number: "7"
}
}
[5] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "99"
[level2] = number: "4"
}
[count] = number: "1"
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "45"
[level2] = number: "4"
}
}
[6] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "99"
[level2] = number: "4"
}
[count] = number: "1"
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "45"
[level2] = number: "4"
}
}
[7] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "47"
[level2] = number: "4"
}
[count] = number: "8"
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "58"
[level2] = number: "4"
}
}
[8] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "47"
[level2] = number: "4"
}
[count] = number: "8"
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "8"
[level1] = number: "4"
[level4] = number: "58"
[level2] = number: "4"
}
}
[9] = {
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "20"
[level2] = number: "5"
}
}
[10] = {
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "20"
[level2] = number: "5"
}
}
[11] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
}
[CurrentStation] = number: "0"
[Cannon] = {
[shells] = number: "250"
}
]]
--[[
Weapon Panel
|
---------------------------------------------------
| | | | | | | | | | |
1 2 3 4 5 C 6 7 8 9 10
]]
-- Payload Info
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
SendDataHW("110", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
SendDataHW("109", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
SendDataHW("108", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
SendDataHW("107", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
SendDataHW("105", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
SendDataHW("106", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
--SendDataHW("110", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
-- CurrentStation 5, panel 3
-- CurrentStation 3, panel 2
-- CurrentStation 7, panel 4
-- CurrentStation 4, panel 9
-- CurrentStation 9, panel 5
-- CurrentStation 10, panel 6
-- CurrentStation 8, panel 7
-- CurrentStation 6, panel 8
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
-- defination
if gES_CurrentStationTmp == nil then
gES_CurrentStationTmp = -1
end
if gES_PayloadInfo.CurrentStation > 0 and
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
gES_TmpStationToPanel = {}
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
gES_TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware } -- right
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
gES_TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
gES_TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
gES_TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
WeaponStatusPanel_Reset(201, 210, lHardware)
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
end
end
end
function FuelQuantityIndicator(hardware)
-- Fuel quantity shows the fuel remaining in all tanks
local lHardware = hardware or 1
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo == nil then
return
end
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
local lPayloadInfo = LoGetPayloadInfo()
if lPayloadInfo ~= nil then
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
SendDataHW("303", ((lEngineInfo.fuel_external < 1240.0 ) and 1 or 0), lHardware )
else
SendDataHW("303", 1, lHardware )
end
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tank presend and full (panel 3 and 8)
SendDataHW("304", ((lEngineInfo.fuel_external < 1.0 ) and 1 or 0), lHardware )
else
SendDataHW("304", 1, lHardware )
end
else
SendDataHW("303", 1, lHardware )
SendDataHW("304", 1, lHardware )
end
SendDataHW("305", (lEngineInfo.fuel_internal < 2800.0 and 1 or 0), lHardware ) -- Interne Flügeltanks
SendDataHW("306", (lEngineInfo.fuel_internal < 1840.0 and 1 or 0), lHardware ) -- Interne Rumpftanks
SendDataHW("307", (lEngineInfo.fuel_internal < 1.0 and 1 or 0), lHardware ) -- Zentraler Rumpftanks
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
end
function MechanicalDevicesIndicator(hardware)
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
local lHardware = hardware or 1
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo == nil then
return
end
--[[
[hook] = {
[status] = number: "0"
[value] = number: "0"
}
[parachute] = {
[status] = number: "0"
[value] = number: "0"
}
[controlsurfaces] = {
[eleron] = {
[left] = number: "0"
[right] = number: "-0.21084336936474"
}
[elevator] = {
[left] = number: "-0"
[right] = number: "-0"
}
[rudder] = {
[left] = number: "0"
[right] = number: "0"
}
}
[airintake] = {
[status] = number: "0"
[value] = number: "0"
}
[canopy] = {
[status] = number: "0"
[value] = number: "0"
}
[refuelingboom] = {
[status] = number: "0"
[value] = number: "0"
}
[wing] = {
[status] = number: "0"
[value] = number: "0"
}
[noseflap] = {
[status] = number: "0"
[value] = number: "0"
}
[gear] = {
[value] = number: "0"
[nose] = {
[rod] = number: "0"
}
[main] = {
[left] = {
[rod] = number: "0"
}
[right] = {
[rod] = number: "0"
}
}
[status] = number: "0"
}
[speedbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[wheelbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[flaps] = {
[status] = number: "0"
[value] = number: "0"
}]]
--SendDataHW("500", lMechInfo.gear.status )
--SendDataHW("501", lMechInfo.gear.value )
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
local lTrueAirSpeed = LoGetTrueAirSpeed()
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
end

884
ExportsModules/Su-27.lua Normal file
View File

@ -0,0 +1,884 @@
-- Su-27 Export
-- Version 0.9.9 BETA
gES_FoundFCModule = true
-- auxiliary function
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / Su-27 --
-- FC aircraft don't support GetDevice --
-----------------------------------------
function ProcessGlassCockpitFCHighImportanceConfig()
local myData = LoGetSelfData()
if (myData) then
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
local lHeading = myData.Heading -- HEADING (Radian)
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
--local lMachNumber = LoGetMachNumber() -- MACH
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
local lDistanceToWay = 999
local lRoute = LoGetRoute()
if (myData and lRoute) then -- if neither are nil
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
end
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- customizing for HELOS
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
lBank = math.deg(lBank) -- BANK (Radian to Grad)
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
lHSI_RMI = 360 - lHSI_RMI
lIAS = lIAS * 3.6 -- change from m/s to km/h
SendData("1", string.format("%.2f", lPitch) )
SendData("2", string.format("%.2f", lBank) )
SendData("3", string.format("%.2f", lYaw) )
SendData("4", string.format("%.2f", lAltBar) )
SendData("5", string.format("%.2f", lAltRad) )
SendData("6", string.format("%.2f", lHSI_ADF) )
SendData("7", string.format("%.2f", lHSI_RMI) )
SendData("8", string.format("%.2f", lHeading) )
SendData("9", string.format("%.2f", lEngineRPMleft) )
SendData("10", string.format("%.2f", lEngineRPMright) )
SendData("11", string.format("%.2f", lEngineTempLeft) )
SendData("12", string.format("%.2f", lEngineTempRight) )
SendData("13", string.format("%.2f", lVVI) )
SendData("14", string.format("%.2f", lIAS) )
SendData("15", string.format("%.2f", lDistanceToWay) )
SendData("16", string.format("%.2f", lAoA) )
SendData("17", string.format("%.2f", lGlide) )
SendData("18", string.format("%.2f", lSide) )
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
local lRadToDCSsignd = math.pi
local lRadToDCSunsignd = math.pi * 2
local lDefaultNull = 0.0
local lDefaultOne = 1.0
-- IAS-MACH Indicator (IAS, MACH) {"%.4f;%.4f"}
FC_Russian_AirSpeed_1600hkm(1)
-- AOA Indicator and Accelerometer (AOA, GLoad)
FC_Russian_AOA_Su2733(3)
-- ADI
FC_Russian_ADI_Old(4)
-- HSI
FC_Russian_HSI(lDistanceToWay, 5)
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
FC_Russian_VVI_Old(6)
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
FC_Russian_RadarAltimeter_1500m(100, 7)
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
FC_Russian_BarometricAltimeter_20000(8)
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
FC_Russian_EngineRPM(9)
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 10)
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 11)
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
FC_Russian_Clock_late(12)
end
else
WriteToLog("Unknown FC Error, no LoGetSelfData.")
end
end
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
end
function ProcessGlassCockpitFCLowImportanceConfig()
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
FC_WeaponPanel_SU2733(13)
FC_RadarWarning_SPO15(14)
-- Fuel Quantity Indicator
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
local lTotalFuel = lEngineInfo.fuel_internal
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
local lTotalFuel_9_3 = 0
local lTotalFuel_5_0 = 0
if lTotalFuel < 9000 then
if lTotalFuel > 3000 then
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 3000 -- minimaler Eingangswert
x_max = 9000 -- maximaler Eingangswert
x = 8000 -- aktueller Eingangswert
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
d_x = 6000 -- Delta Eingangswerte (x_max - x_min)
m = 1.66666666666666666666666666667e-4 -- Steigung der linearen Funktion (d_y / d_x)
n = -0,5 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.83333 -- Ergebnis (m * x + n)
]]
lTotalFuel_9_3 = 1.6666666666666666666666666666667e-4 * lTotalFuel + -0.5
else
lTotalFuel_9_3 = 0.0
end
else
lTotalFuel_9_3 = 1.0
end
if lTotalFuel < 5000 then
lTotalFuel_5_0 = lTotalFuel / 5000
else
lTotalFuel_5_0 = 1.0
end
-- TotalFuel_5_0
-- TotalFuel_9_3
-- Light1
-- Light2
-- Light3
-- Light4
-- BingoLight
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
lTotalFuel_5_0,
lTotalFuel_9_3,
(lEngineInfo.fuel_internal < 5000.0 and 1 or 0), -- Tank warning 1
(lEngineInfo.fuel_internal < 4000.0 and 1 or 0), -- Tank warning 2
(lEngineInfo.fuel_internal < 1500.0 and 1 or 0), -- Tank warning 3
(lEngineInfo.fuel_internal < 1000.0 and 1 or 0), -- Tank warning 4
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
-- Hydraulic Pressure Left
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
-- Hydraulic Pressure Right
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
end
-- EKRAN Message
FC_EKRAN(16)
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo ~= nil then
local lWarningLight = 0.0
local lTrueAirSpeed = LoGetTrueAirSpeed()
if lTrueAirSpeed ~= nil then
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
end
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
-- left gear {0, 1}
-- right gear {0, 1}
-- nose gear {0, 1}
-- WarningLight
-- Flap
-- Intake FOD shields
-- Speedbreakes on {0, 1}
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d",
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
lWarningLight,
(lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap
(lMechInfo.gear.value > 0.5 and 1 or 0), -- Intake FOD shields
(lMechInfo.speedbrakes.value > 0.1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
-- Wheelbrakes Hydraulic Pressure Left
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
-- Wheelbrakes Hydraulic Pressure Right
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
--WriteToLog('lMechInfo.noseflap.value: '..dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
end
-- Airintake
FC_Russian_AirIntake(21)
end
--(x < 0 and 'negative' or 'non-negative')
--[[
local lPayloadInfo = LoGetPayloadInfo()
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
local lSnares = LoGetSnares() -- Flare and Chaff
WriteToLog('lSnares: '..dump(lSnares))
local lSightingSystemInfo = LoGetSightingSystemInfo()
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
local lLockedTargetInformation = LoGetLockedTargetInformation()
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
WriteToLog('lMechInfo: '..dump(lMechInfo))
local lMCPState = LoGetMCPState() -- Warnlichter
WriteToLog('lMCPState: '..dump(lMCPState))
local lControlPanel_HSI = LoGetControlPanel_HSI()
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
local lEngineInfo = LoGetEngineInfo()
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
]]
-- Weapon Control System
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
-- values from LoGetTargetInformation().type
--WriteToLog('lNameByType: '..dump(lNameByType))
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
WeaponStatusPanel()
MechanicalDevicesIndicator()
StatusLamp()
FuelQuantityIndicator()
SightingSystem()
SPO15RWR()
PPDSPPanel()
end
-----------------------------
-- Custom functions --
-----------------------------
function SightingSystem(hardware)
local lHardware = hardware or 1
local lSightingSystemInfo = LoGetSightingSystemInfo()
if lSightingSystemInfo == nil then
return
end
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
--[[
[PRF] = {
[selection] = string: "ILV"
[current] = string: "MED"
}
[laser_on] = boolean: "false"
[scale] = {
[azimuth] = number: "0.52359873056412"
[distance] = number: "10000"
}
[radar_on] = boolean: "false"
[optical_system_on] = boolean: "false"
[LaunchAuthorized] = boolean: "false"
[ECM_on] = boolean: "false"
[Manufacturer] = string: "RUS"
[TDC] = {
[y] = number: "0"
[x] = number: "0"
}
[ScanZone] = {
[coverage_H] = {
[min] = number: "0"
[max] = number: "20000"
}
[size] = {
[azimuth] = number: "1.0471974611282"
[elevation] = number: "0.17453290522099"
}
[position] = {
[exceeding_manual] = number: "0"
[distance_manual] = number: "0"
[azimuth] = number: "0"
[elevation] = number: "0"
}
}
]]
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
--SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
end
function PPDSPPanel(hardware)
local lHardware = hardware or 1
local lSnares = LoGetSnares() -- Flare and Chaff
if lSnares == nil then
return
end
--WriteToLog('lSnares: '..dump(lSnares))
--[chaff] = number: "96"
--[flare] = number: "96"
local lChaffLED = math.round(lSnares.chaff / 12, 0, "ceil") + 1
local lFlareLED = math.round(lSnares.flare / 12, 0, "ceil") + 1
SendDataHW("800", (lChaffLED <= 1 and 0 or 1), lHardware )
SendDataHW("801", (lChaffLED <= 2 and 0 or 1), lHardware )
SendDataHW("802", (lChaffLED <= 3 and 0 or 1), lHardware )
SendDataHW("803", (lChaffLED <= 4 and 0 or 1), lHardware )
SendDataHW("804", (lChaffLED <= 5 and 0 or 1), lHardware )
SendDataHW("805", (lChaffLED <= 6 and 0 or 1), lHardware )
SendDataHW("806", (lChaffLED <= 7 and 0 or 1), lHardware )
SendDataHW("807", (lChaffLED <= 8 and 0 or 1), lHardware )
SendDataHW("810", (lFlareLED <= 1 and 0 or 1), lHardware )
SendDataHW("811", (lFlareLED <= 2 and 0 or 1), lHardware )
SendDataHW("812", (lFlareLED <= 3 and 0 or 1), lHardware )
SendDataHW("813", (lFlareLED <= 4 and 0 or 1), lHardware )
SendDataHW("814", (lFlareLED <= 5 and 0 or 1), lHardware )
SendDataHW("815", (lFlareLED <= 6 and 0 or 1), lHardware )
SendDataHW("816", (lFlareLED <= 7 and 0 or 1), lHardware )
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
end
function StatusLamp(hardware)
local lHardware = hardware or 1
local lMCPState = LoGetMCPState() -- Warning Lights
if lMCPState == nil then
return
end
--WriteToLog('lMCPState: '..dump(lMCPState))
--[[
[RightTailPlaneFailure] = boolean: "false"
[EOSFailure] = boolean: "false"
[ECMFailure] = boolean: "false"
[RightAileronFailure] = boolean: "false"
[MasterWarning] = boolean: "false"
[RightEngineFailure] = boolean: "false"
[CannonFailure] = boolean: "false"
[MLWSFailure] = boolean: "false"
[ACSFailure] = boolean: "false"
[RadarFailure] = boolean: "false"
[HelmetFailure] = boolean: "false"
[HUDFailure] = boolean: "false"
[LeftMainPumpFailure] = boolean: "false"
[RightWingPumpFailure] = boolean: "false"
[LeftWingPumpFailure] = boolean: "false"
[MFDFailure] = boolean: "false"
[RWSFailure] = boolean: "false"
[GearFailure] = boolean: "false"
[HydraulicsFailure] = boolean: "false"
[AutopilotFailure] = boolean: "true"
[FuelTankDamage] = boolean: "false"
[LeftAileronFailure] = boolean: "false"
[CanopyOpen] = boolean: "false"
[RightMainPumpFailure] = boolean: "false"
[StallSignalization] = boolean: "false"
[LeftEngineFailure] = boolean: "false"
[AutopilotOn] = boolean: "false"
[LeftTailPlaneFailure] = boolean: "false"
]]
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
SendDataHW("730", (lEngineInfo.RPM.left > 99.95 and 1 or 0), lHardware ) -- lamp after burner left engine
SendDataHW("731", (lEngineInfo.RPM.right > 99.95 and 1 or 0), lHardware ) -- lam after burner right engine
end
local lAccelerationUnits = LoGetAccelerationUnits()
if lAccelerationUnits ~= nil then
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
end
end
function WeaponStatusPanel(hardware)
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
local lHardware = hardware or 1
gES_PayloadInfo = LoGetPayloadInfo()
if gES_PayloadInfo == nil then
return
end
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
--[[ exsample
[Stations] = {
[1] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[2] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[3] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[4] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[5] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "7"
}
[count] = number: "20"
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "33"
[level1] = number: "4"
[level4] = number: "32"
[level2] = number: "7"
}
}
[6] = {
[wstype] = {
[level3] = number: "32"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "7"
}
[count] = number: "20"
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
[adapter] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
[container] = boolean: "true"
[weapon] = {
[level3] = number: "33"
[level1] = number: "4"
[level4] = number: "32"
[level2] = number: "7"
}
}
[7] = {
[CLSID] = string: "{4203753F-8198-4E85-9924-6F8FF679F9FF}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "5"
}
}
[8] = {
[CLSID] = string: "{4203753F-8198-4E85-9924-6F8FF679F9FF}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "5"
}
}
[9] = {
[CLSID] = string: "{7AEC222D-C523-425e-B714-719C0D1EB14D}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "91"
[level2] = number: "5"
}
}
[10] = {
[CLSID] = string: "{7AEC222D-C523-425e-B714-719C0D1EB14D}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "38"
[level1] = number: "4"
[level4] = number: "91"
[level2] = number: "5"
}
}
}
[CurrentStation] = number: "0"
[Cannon] = {
[shells] = number: "250"
}
]]
--[[
Weapon Panel
|
-------------------------------------------
| | | | | | | | | |
1 2 3 4 5 6 7 8 9 10 -- Panel ID
2 4 5 7 10 9 8 6 3 1 -- gES_PayloadInfo.Station.ID
]]
-- Payload Info
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
SendDataHW("110", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
SendDataHW("101", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
SendDataHW("109", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
SendDataHW("102", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
SendDataHW("108", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
SendDataHW("107", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
SendDataHW("106", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
SendDataHW("105", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
-- defination
if gES_CurrentStationTmp == nil then
gES_CurrentStationTmp = -1
end
if gES_PayloadInfo.CurrentStation > 0 and
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
gES_TmpStationToPanel = {}
gES_TmpStationToPanel[1] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware }
gES_TmpStationToPanel[2] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware }
gES_TmpStationToPanel[3] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
gES_TmpStationToPanel[4] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
gES_TmpStationToPanel[9] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
gES_TmpStationToPanel[10] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
WeaponStatusPanel_Reset(201, 210, lHardware)
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
end
end
end
function FuelQuantityIndicator(hardware)
-- Fuel quantity shows the fuel remaining in all tanks
local lHardware = hardware or 1
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo == nil then
return
end
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
SendDataHW("304", (lEngineInfo.fuel_internal < 5000.0 and 1 or 0), lHardware ) -- Tank warning 1
SendDataHW("305", (lEngineInfo.fuel_internal < 4000.0 and 1 or 0), lHardware ) -- Tank warning 2
SendDataHW("306", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0), lHardware ) -- Tank warning 3
SendDataHW("307", (lEngineInfo.fuel_internal < 1000.0 and 1 or 0), lHardware ) -- Tank warning 4
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
end
function MechanicalDevicesIndicator(hardware)
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
local lHardware = hardware or 1
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo == nil then
return
end
--[[
[hook] = {
[status] = number: "0"
[value] = number: "0"
}
[parachute] = {
[status] = number: "0"
[value] = number: "0"
}
[controlsurfaces] = {
[eleron] = {
[left] = number: "0"
[right] = number: "-0.21084336936474"
}
[elevator] = {
[left] = number: "-0"
[right] = number: "-0"
}
[rudder] = {
[left] = number: "0"
[right] = number: "0"
}
}
[airintake] = {
[status] = number: "0"
[value] = number: "0"
}
[canopy] = {
[status] = number: "0"
[value] = number: "0"
}
[refuelingboom] = {
[status] = number: "0"
[value] = number: "0"
}
[wing] = {
[status] = number: "0"
[value] = number: "0"
}
[noseflap] = {
[status] = number: "0"
[value] = number: "0"
}
[gear] = {
[value] = number: "0"
[nose] = {
[rod] = number: "0"
}
[main] = {
[left] = {
[rod] = number: "0"
}
[right] = {
[rod] = number: "0"
}
}
[status] = number: "0"
}
[speedbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[wheelbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[flaps] = {
[status] = number: "0"
[value] = number: "0"
}]]
--SendDataHW("500", lMechInfo.gear.status )
--SendDataHW("501", lMechInfo.gear.value )
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
SendDataHW("503", (lMechInfo.gear.value > 0.97 and 1 or 0), lHardware ) -- right gear
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
SendDataHW("534", (lMechInfo.gear.value > 0.5 and 1 or 0), lHardware ) -- Intake FOD shields
--SendDataHW("540", lMechInfo.parachute.status )
SendDataHW("541", (lMechInfo.parachute.value < 0.5 and 1 or 0), lHardware )
end

880
ExportsModules/Su-33.lua Normal file
View File

@ -0,0 +1,880 @@
-- Su-33 Export
-- Version 0.9.9 BETA
gES_FoundFCModule = true
-- auxiliary function
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / Su-33 --
-- FC aircraft don't support GetDevice --
-----------------------------------------
function ProcessGlassCockpitFCHighImportanceConfig()
local myData = LoGetSelfData()
if (myData) then
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
local lHeading = myData.Heading -- HEADING (Radian)
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
--local lMachNumber = LoGetMachNumber() -- MACH
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
local lDistanceToWay = 999
local lRoute = LoGetRoute()
if (myData and lRoute) then -- if neither are nil
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
end
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
-- customizing for HELOS
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
lBank = math.deg(lBank) -- BANK (Radian to Grad)
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
lHSI_RMI = 360 - lHSI_RMI
lIAS = lIAS * 3.6 -- change from m/s to km/h
SendData("1", string.format("%.2f", lPitch) )
SendData("2", string.format("%.2f", lBank) )
SendData("3", string.format("%.2f", lYaw) )
SendData("4", string.format("%.2f", lAltBar) )
SendData("5", string.format("%.2f", lAltRad) )
SendData("6", string.format("%.2f", lHSI_ADF) )
SendData("7", string.format("%.2f", lHSI_RMI) )
SendData("8", string.format("%.2f", lHeading) )
SendData("9", string.format("%.2f", lEngineRPMleft) )
SendData("10", string.format("%.2f", lEngineRPMright) )
SendData("11", string.format("%.2f", lEngineTempLeft) )
SendData("12", string.format("%.2f", lEngineTempRight) )
SendData("13", string.format("%.2f", lVVI) )
SendData("14", string.format("%.2f", lIAS) )
SendData("15", string.format("%.2f", lDistanceToWay) )
SendData("16", string.format("%.2f", lAoA) )
SendData("17", string.format("%.2f", lGlide) )
SendData("18", string.format("%.2f", lSide) )
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
-- IAS-MACH Indicator (IAS, MACH) {"%.4f;%.4f"}
FC_Russian_AirSpeed_1600hkm(1)
-- AOA Indicator and Accelerometer (AOA, GLoad)
FC_Russian_AOA_Su2733(3)
-- ADI
FC_Russian_ADI_New(4)
-- HSI
FC_Russian_HSI(lDistanceToWay, 5)
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
FC_Russian_VVI_New(6)
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
FC_Russian_RadarAltimeter_1500m(100, 7)
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
FC_Russian_BarometricAltimeter_late(8)
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
FC_Russian_EngineRPM(9)
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 10)
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 11)
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
FC_Russian_Clock_late(12)
end
else
WriteToLog("Unknown FC Error, no LoGetSelfData.")
end
end
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
end
function ProcessGlassCockpitFCLowImportanceConfig()
if gES_GlassCockpitType == 1 then
-- HELIOS Version 1.3
elseif gES_GlassCockpitType == 2 then
-- HawgTouch version 1.6
FC_WeaponPanel_SU2733(13)
FC_RadarWarning_SPO15(14)
-- Fuel Quantity Indicator
local lEngineInfo = LoGetEngineInfo()
local lTotalFuel = 0
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
lTotalFuel = lEngineInfo.fuel_internal
--lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
--lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
--lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
local lTotalFuel_12_0 = 1.0
if lTotalFuel < 12000 then
--[[
y_min = 0.0 -- minimaler Ausgabewert
y_max = 1.0 -- maximaler Ausgabewert
x_min = 0 -- minimaler Eingangswert
x_max = 12000 -- maximaler Eingangswert
x = 8000 -- aktueller Eingangswert
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
d_x = 12000 -- Delta Eingangswerte (x_max - x_min)
m = 8.3333333333333333333333333333333e-5 -- Steigung der linearen Funktion (d_y / d_x)
n = 4.e-33 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
y = 0.66666666666666666666666666666667 -- Ergebnis (m * x + n)
]]
lTotalFuel_12_0 = 8.3333333333333333333333333333333e-5 * lTotalFuel + 4.e-33
end
-- TotalFuel_12_0
-- Light1
-- Light2
-- Light3
-- Light4
-- BingoLight
SendData("15", string.format("%0.4f;%d;%d;%d;%d;%d",
lTotalFuel_12_0,
(lEngineInfo.fuel_internal < 5000.0 and 1 or 0), -- Tank warning 1
(lEngineInfo.fuel_internal < 1000.0 and 1 or 0), -- Tank warning 2 4000
(lEngineInfo.fuel_internal < 4000.0 and 1 or 0), -- Tank warning 3 1500
(lEngineInfo.fuel_internal < 1500.0 and 1 or 0), -- Tank warning 4 1000
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
-- Hydraulic Pressure Left
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 300, 17)
end
-- EKRAN Message
FC_EKRAN(16)
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo ~= nil then
local lWarningLight = 0.0
local lTrueAirSpeed = LoGetTrueAirSpeed()
if lTrueAirSpeed ~= nil then
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
end
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
-- left gear {0, 1}
-- right gear {0, 1}
-- nose gear {0, 1}
-- Hook Light
-- WarningLight
-- Flap
-- Intake FOD shields
-- Speedbreakes on {0, 1}
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d;%d",
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
(lMechInfo.hook.value > 0.85 and 1 or 0), -- hook light
lWarningLight,
(lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap
(lMechInfo.gear.value > 0.5 and 1 or 0), -- Intake FOD shields
(lMechInfo.speedbrakes.value > 0.1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
-- Wheelbrakes Hydraulic Pressure Left
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 300, 18)
-- Wheelbrakes Hydraulic Pressure Right
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 300, 19)
--WriteToLog('lMechInfo.noseflap.value: '..dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
end
-- Airintake
FC_Russian_AirIntake(20)
-- Fuel Quantity Standby Indicator
FC_OneNeedleGauge(lTotalFuel, 10000, 21)
end
--(x < 0 and 'negative' or 'non-negative')
--[[
local lPayloadInfo = LoGetPayloadInfo()
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
local lSnares = LoGetSnares() -- Flare and Chaff
WriteToLog('lSnares: '..dump(lSnares))
local lSightingSystemInfo = LoGetSightingSystemInfo()
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
local lLockedTargetInformation = LoGetLockedTargetInformation()
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
WriteToLog('lMechInfo: '..dump(lMechInfo))
local lMCPState = LoGetMCPState() -- Warnlichter
WriteToLog('lMCPState: '..dump(lMCPState))
local lControlPanel_HSI = LoGetControlPanel_HSI()
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
local lEngineInfo = LoGetEngineInfo()
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
]]
-- Weapon Control System
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
-- values from LoGetTargetInformation().type
--WriteToLog('lNameByType: '..dump(lNameByType))
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
WeaponStatusPanel()
MechanicalDevicesIndicator()
StatusLamp()
FuelQuantityIndicator()
SightingSystem()
SPO15RWR()
PPDSPPanel()
end
-----------------------------
-- Custom functions --
-----------------------------
function SightingSystem(hardware)
local lHardware = hardware or 1
local lSightingSystemInfo = LoGetSightingSystemInfo()
if lSightingSystemInfo == nil then
return
end
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
--[[
[PRF] = {
[selection] = string: "ILV"
[current] = string: "MED"
}
[laser_on] = boolean: "false"
[scale] = {
[azimuth] = number: "0.52359873056412"
[distance] = number: "10000"
}
[radar_on] = boolean: "false"
[optical_system_on] = boolean: "false"
[LaunchAuthorized] = boolean: "false"
[ECM_on] = boolean: "false"
[Manufacturer] = string: "RUS"
[TDC] = {
[y] = number: "0"
[x] = number: "0"
}
[ScanZone] = {
[coverage_H] = {
[min] = number: "0"
[max] = number: "20000"
}
[size] = {
[azimuth] = number: "1.0471974611282"
[elevation] = number: "0.17453290522099"
}
[position] = {
[exceeding_manual] = number: "0"
[distance_manual] = number: "0"
[azimuth] = number: "0"
[elevation] = number: "0"
}
}
]]
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
--SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
end
function PPDSPPanel(hardware)
local lHardware = hardware or 1
local lSnares = LoGetSnares() -- Flare and Chaff
if lSnares == nil then
return
end
--WriteToLog('lSnares: '..dump(lSnares))
--[chaff] = number: "48"
--[flare] = number: "48"
local lChaffLED = math.round(lSnares.chaff / 6, 0, "ceil") + 1
local lFlareLED = math.round(lSnares.flare / 6, 0, "ceil") + 1
SendDataHW("800", (lChaffLED <= 1 and 0 or 1), lHardware )
SendDataHW("801", (lChaffLED <= 2 and 0 or 1), lHardware )
SendDataHW("802", (lChaffLED <= 3 and 0 or 1), lHardware )
SendDataHW("803", (lChaffLED <= 4 and 0 or 1), lHardware )
SendDataHW("804", (lChaffLED <= 5 and 0 or 1), lHardware )
SendDataHW("805", (lChaffLED <= 6 and 0 or 1), lHardware )
SendDataHW("806", (lChaffLED <= 7 and 0 or 1), lHardware )
SendDataHW("807", (lChaffLED <= 8 and 0 or 1), lHardware )
SendDataHW("810", (lFlareLED <= 1 and 0 or 1), lHardware )
SendDataHW("811", (lFlareLED <= 2 and 0 or 1), lHardware )
SendDataHW("812", (lFlareLED <= 3 and 0 or 1), lHardware )
SendDataHW("813", (lFlareLED <= 4 and 0 or 1), lHardware )
SendDataHW("814", (lFlareLED <= 5 and 0 or 1), lHardware )
SendDataHW("815", (lFlareLED <= 6 and 0 or 1), lHardware )
SendDataHW("816", (lFlareLED <= 7 and 0 or 1), lHardware )
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
end
function StatusLamp(hardware)
local lHardware = hardware or 1
local lMCPState = LoGetMCPState() -- Warning Lights
if lMCPState == nil then
return
end
--WriteToLog('lMCPState: '..dump(lMCPState))
--[[
[RightTailPlaneFailure] = boolean: "false"
[EOSFailure] = boolean: "false"
[ECMFailure] = boolean: "false"
[RightAileronFailure] = boolean: "false"
[MasterWarning] = boolean: "false"
[RightEngineFailure] = boolean: "false"
[CannonFailure] = boolean: "false"
[MLWSFailure] = boolean: "false"
[ACSFailure] = boolean: "false"
[RadarFailure] = boolean: "false"
[HelmetFailure] = boolean: "false"
[HUDFailure] = boolean: "false"
[LeftMainPumpFailure] = boolean: "false"
[RightWingPumpFailure] = boolean: "false"
[LeftWingPumpFailure] = boolean: "false"
[MFDFailure] = boolean: "false"
[RWSFailure] = boolean: "false"
[GearFailure] = boolean: "false"
[HydraulicsFailure] = boolean: "false"
[AutopilotFailure] = boolean: "true"
[FuelTankDamage] = boolean: "false"
[LeftAileronFailure] = boolean: "false"
[CanopyOpen] = boolean: "false"
[RightMainPumpFailure] = boolean: "false"
[StallSignalization] = boolean: "false"
[LeftEngineFailure] = boolean: "false"
[AutopilotOn] = boolean: "false"
[LeftTailPlaneFailure] = boolean: "false"
]]
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo ~= nil then
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
SendDataHW("730", (lEngineInfo.RPM.left > 100.0 and 1 or 0), lHardware ) -- lamp after burner left engine
SendDataHW("731", (lEngineInfo.RPM.right > 100.0 and 1 or 0), lHardware ) -- lam after burner right engine
end
local lAccelerationUnits = LoGetAccelerationUnits()
if lAccelerationUnits ~= nil then
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
end
end
function WeaponStatusPanel(hardware)
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
local lHardware = hardware or 1
gES_PayloadInfo = LoGetPayloadInfo()
if gES_PayloadInfo == nil then
return
end
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
--[[ exsample
[Stations] = {
[1] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[2] = {
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "18"
[level2] = number: "4"
}
}
[3] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
[4] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
[5] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
[6] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
[7] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
[8] = {
[CLSID] = string: ""
[container] = boolean: "false"
[count] = number: "0"
[weapon] = {
[level3] = number: "0"
[level1] = number: "0"
[level4] = number: "0"
[level2] = number: "0"
}
}
[9] = {
[CLSID] = string: "{37DCC01E-9E02-432F-B61D-10C166CA2798}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "9"
[level1] = number: "4"
[level4] = number: "7"
[level2] = number: "5"
}
}
[10] = {
[CLSID] = string: "{37DCC01E-9E02-432F-B61D-10C166CA2798}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "9"
[level1] = number: "4"
[level4] = number: "7"
[level2] = number: "5"
}
}
[11] = {
[CLSID] = string: "{9B25D316-0434-4954-868F-D51DB1A38DF0}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "7"
[level1] = number: "4"
[level4] = number: "13"
[level2] = number: "4"
}
}
[12] = {
[CLSID] = string: "{3C612111-C7AD-476E-8A8E-2485812F4E5C}"
[container] = boolean: "false"
[count] = number: "1"
[weapon] = {
[level3] = number: "9"
[level1] = number: "4"
[level4] = number: "6"
[level2] = number: "5"
}
}
}
[CurrentStation] = number: "0"
[Cannon] = {
[shells] = number: "150"
}
]]
--[[
Weapon Panel (Numper = Station number)
|
-------------------------------------------------------
| | | | | | | | | | | |
L 1 2 3 4 5 6 7 8 9 10 R -- Panel ID
1 4 5 7 9 12 11 10 8 6 3 2 -- gES_PayloadInfo.Station.ID
]]
-- Payload Info
-- weapon stations L and R not on Panel
-- weapon station 1 (left) to 10 (right), 5 and 6 center station
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
--SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- L
--SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- R
SendDataHW("110", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
SendDataHW("101", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
SendDataHW("102", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
SendDataHW("109", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
SendDataHW("103", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
SendDataHW("108", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
SendDataHW("104", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
SendDataHW("107", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
SendDataHW("106", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
SendDataHW("105", (gES_PayloadInfo.Stations[12].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
-- air-to-air missils panel 1 and 2, air combat modus, CurrentStation = 1, panel 1 and 2 on
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
-- defination
if gES_CurrentStationTmp == nil then
gES_CurrentStationTmp = -1
end
if gES_PayloadInfo.CurrentStation > 0 and
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
gES_TmpStationToPanel = {}
--gES_TmpStationToPanel[1] = {Panel = 'L', StationID = 'L', CurrentID = 'L', HardwareID = lHardware } -- L
--gES_TmpStationToPanel[2] = {Panel = 'R', StationID = 'R', CurrentID = 'R', HardwareID = lHardware } -- R
gES_TmpStationToPanel[3] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware }
gES_TmpStationToPanel[4] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware }
gES_TmpStationToPanel[5] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
gES_TmpStationToPanel[6] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
gES_TmpStationToPanel[7] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
gES_TmpStationToPanel[8] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
gES_TmpStationToPanel[9] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
gES_TmpStationToPanel[10] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
gES_TmpStationToPanel[11] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
gES_TmpStationToPanel[12] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
WeaponStatusPanel_Reset(201, 210, lHardware)
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
end
elseif gES_PayloadInfo.CurrentStation == 0 and gES_CurrentStationTmp > 0 then
WeaponStatusPanel_Reset(201, 210, lHardware)
gES_CurrentStationTmp = -1
end
end
function FuelQuantityIndicator(hardware)
-- Fuel quantity shows the fuel remaining in all tanks
local lHardware = hardware or 1
local lEngineInfo = LoGetEngineInfo()
if lEngineInfo == nil then
return
end
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
--[[
[fuel_external] = number: "0"
[Temperature] = {
[left] = number: "626.99444580078"
[right] = number: "626.99444580078"
}
[RPM] = {
[left] = number: "87.453765869141"
[right] = number: "87.453758239746"
}
[FuelConsumption] = {
[left] = number: "0.1500396137767"
[right] = number: "0.1500396137767"
}
[fuel_internal] = number: "3773.2749023438"
[EngineStart] = {
[left] = number: "0"
[right] = number: "0"
}
[HydraulicPressure] = {
[left] = number: "210"
[right] = number: "210"
}
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
]]
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal), lHardware ) -- total fuel in kg
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external), lHardware ) -- external fuel in kg
SendDataHW("304", (lEngineInfo.fuel_internal < 5000.0 and 1 or 0), lHardware ) -- Tank warning 1
SendDataHW("305", (lEngineInfo.fuel_internal < 1000.0 and 1 or 0), lHardware ) -- Tank warning 2 4000
SendDataHW("306", (lEngineInfo.fuel_internal < 4000.0 and 1 or 0), lHardware ) -- Tank warning 3 1500
SendDataHW("307", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0), lHardware ) -- Tank warning 4 1000
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
end
function MechanicalDevicesIndicator(hardware)
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
local lHardware = hardware or 1
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
if lMechInfo == nil then
return
end
--WriteToLog('lMechInfo: '..dump(lMechInfo))
--[[
[hook] = {
[status] = number: "0"
[value] = number: "0"
}
[parachute] = {
[status] = number: "0"
[value] = number: "0"
}
[controlsurfaces] = {
[eleron] = {
[left] = number: "0"
[right] = number: "-0.21084336936474"
}
[elevator] = {
[left] = number: "-0"
[right] = number: "-0"
}
[rudder] = {
[left] = number: "0"
[right] = number: "0"
}
}
[airintake] = {
[status] = number: "0"
[value] = number: "0"
}
[canopy] = {
[status] = number: "0"
[value] = number: "0"
}
[refuelingboom] = {
[status] = number: "0"
[value] = number: "0"
}
[wing] = {
[status] = number: "0"
[value] = number: "0"
}
[noseflap] = {
[status] = number: "0"
[value] = number: "0"
}
[gear] = {
[value] = number: "0"
[nose] = {
[rod] = number: "0"
}
[main] = {
[left] = {
[rod] = number: "0"
}
[right] = {
[rod] = number: "0"
}
}
[status] = number: "0"
}
[speedbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[wheelbrakes] = {
[status] = number: "0"
[value] = number: "0"
}
[flaps] = {
[status] = number: "0"
[value] = number: "0"
}]]
--SendDataHW("500", lMechInfo.gear.status )
--SendDataHW("501", lMechInfo.gear.value )
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
if lGetTrueAirSpeed == nil then
lGetTrueAirSpeed = 0
end
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
SendDataHW("534", (lMechInfo.gear.value > 0.5 and 1 or 0), lHardware ) -- Intake FOD shields
--SendDataHW("540", lMechInfo.parachute.status )
SendDataHW("541", (lMechInfo.hook.value > 0.8 and 1 or 0), lHardware )
--SendDataHW("550", lMechInfo.noseflap.status )
SendDataHW("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0), lHardware )
end

343
ExportsModules/TF-51D.lua Normal file
View File

@ -0,0 +1,343 @@
-- TF-51D Export
-- Version 0.9.9 BETA
gES_FoundDCSModule = true
gES_GlassCockpitConfigEveryFrameArguments =
{
--[[
every frames arguments
based of "mainpanel_init.lua"
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
[DeviceID] = "Format"
[4] = "%.4f", <- floating-point number with 4 digits after point
[19] = "%0.1f", <- floating-point number with 1 digit after point
[129] = "%1d", <- decimal number
]]
-- Flight Instruments
[11] = "%.2f", -- AirspeedNeedle
[29] = "%.1f", -- Variometer
-- Altimeter
[97] = "%.1f", -- Altimeter_Pressure
[96] = "%.1f", -- Altimeter_10000_footPtr
[24] = "%.1f", -- Altimeter_1000_footPtr
[25] = "%.1f", -- Altimeter_100_footPtr
-- Artificial horizon
[15] = "%.1f", -- AHorizon_Pitch
[14] = "%.1f", -- AHorizon_Bank
[16] = "%.1f", -- AHorizon_PitchShift
[20] = "%.1f", -- AHorizon_Caged
-- directional gyro
[12] = "%.1f", -- GyroHeading
-- turn indicator
[27] = "%.1f", -- TurnNeedle
[28] = "%.1f", -- Slipball
-- oxygen pressure indicator
[34] = "%.1f", -- Oxygen_Pressure
[33] = "%.1f", -- Oxygen_Flow_Blinker
-- fuel system
[155] = "%.2f", -- Fuel_Tank_Left
[156] = "%.2f", -- Fuel_Tank_Right
[32] = "%.1f", -- Fuel_Pressure
-- A-11 clock
[4] = "%.4f", -- CLOCK_currtime_hours
[5] = "%.4f", -- CLOCK_currtime_minutes
[6] = "%.4f", -- CLOCK_currtime_seconds
-- AN5730 remote compass
[1] = "%.4f", -- CompassHeading
[2] = "%.4f", -- CommandedCourse
[3] = "%.4f", -- CommandedCourseKnob
-- TailRadarWarning
[161] = "%.1f", -- TailRadarWarning
-- SCR-522A Control panel
[122] = "%.1f", -- A_channel_light
[123] = "%.1f", -- B_channel_light
[124] = "%.1f", -- C_channel_light
[125] = "%.1f", -- D_channel_light
[126] = "%.1f", -- Transmit_light
-- hydraulic pressure
[78] = "%.4f", -- Hydraulic_Pressure
-- Landing gears handle
[150] = "%.4f", -- Landing_Gear_Handle
[151] = "%.4f", -- Landing_Gear_Handle_Indoor
[80] = "%.1f", -- LandingGearGreenLight
[82] = "%.1f", -- LandingGearRedLight
-- gauges
[10] = "%.4f", -- Manifold_Pressure
[23] = "%.4f", -- Engine_RPM
[9] = "%.4f", -- Vacuum_Suction
[21] = "%.4f", -- Carb_Temperature
[22] = "%.4f", -- Coolant_Temperature
[30] = "%.4f", -- Oil_Temperature
[31] = "%.4f", -- Oil_Pressure
[164] = "%.1f", -- Left_Fluor_Light
[165] = "%.1f", -- Right_Fluor_Light
[59] = "%.1f", -- Hight_Blower_Lamp
-- Trimmer
[170] = "%.4f", -- Aileron_Trimmer
[172] = "%.4f", -- Rudder_Trimmer
[171] = "%.4f", -- Elevator_Trimmer
[174] = "%.4f", -- Control_Lock_Bracket
[175] = "%.4f", -- Accelerometer_main
[177] = "%.4f", -- Accelerometer_min
[178] = "%.4f", -- Accelerometer_max
[101] = "%.4f", -- Ammeter
-- light
[185] = "%.1f", -- Left_cockpit_light
[186] = "%.1f", -- Right_cockpit_light
[190] = "%.4f" -- warEmergencyPowerLimWire
}
gES_GlassCockpitConfigArguments =
{
--[[
arguments for export in low tick interval
based on "clickabledata.lua"
]]
-- Right Swich Panel
[102] = "%d", -- Generator Connect/Disconnect
[103] = "%d", -- Battery Connect/Disconnect
[104] = "%d", -- Gun Heating ON/OFF
[105] = "%d", -- Pitot Heating ON/OFF
[106] = "%d", -- Wing Position Lights Bright/Off/Dim
[107] = "%d", -- Tail Position Lights Bright/Off/Dim
[108] = "%d", -- Red Recognition Light Key/Off/Steady
[109] = "%d", -- Green Recognition Light Key/Off/Steady
[110] = "%d", -- Amber Recognition Light Key/Off/Steady
[111] = "%d", -- Recognition Lights Key
[112] = "%d", -- Circuit Protectors Reset
[100] = "%d", -- Right Fluorescent Light
[90] = "%d", -- Left Fluorescent Light
-- Flight Instrument panel
[3] = "%.4f", -- Course Set
[179] = "%.4f", -- Heading Set/Cage
[13] = "%d", -- Heading Set/Cage Button
[17] = "%.4f", -- Pitch Adjustment
[19] = "%.4f", -- Cage
[18] = "%d", -- Cage Button
[8] = "%d", -- Winding/Adjustment Clock ??
[7] = "%d", -- Winding/Adjustment Clock ??
[26] = "%.4f", -- Set Pressure
-- SCR-522A Control panel
[117] = "%d", -- Radio ON/OFF
[118] = "%d", -- A Channel Activate
[119] = "%d", -- B Channel Activate
[120] = "%d", -- C Channel Activate
[121] = "%d", -- D Channel Activate
[127] = "%.4f", -- Radio Lights Dimmer
[116] = "%.4f", -- Radio Audio Volume
[44] = "%d", -- Microphone On
[129] = "%d", -- Switch Locking Lever
[128] = "%.4f", -- Radio Mode Transmit/Receive/Remote
-------------
[71] = "%.4f", -- Cockpit Lights
[66] = "%0.1f", -- Ignition Off/Right/Left/Both
[67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On
[72] = "%d", -- Silence Landing Gear Warning Horn Cut Off
-- Bomb Arm/Chemical
[69] = "%d", -- Left Bomb Arm/Chemical
[70] = "%d", -- Right Bomb Arm/Chemical
-- Release Mode
[68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm
-- Engine Control Panel
[58] = "%d", -- Supercharger Switch Cover
[57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH
[60] = "%d", -- High Blower Lamp Test
[61] = "%d", -- Fuel Booster On/Off
[62] = "%d", -- Oil Dilute Activate
[63] = "%d", -- Starter Activate
[64] = "%d", -- Starter Switch Cover
[65] = "%d", -- Primer Activate
-- Oxygen Regulator
[131] = "%d", -- Auto-Mix On-Off
[130] = "%0.4f", -- Oxygen Emergency By-pass
-- Fuel system
[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
[86] = "%d", -- Fuel Shut-Off Valve ON/OFF
-- AN/APS-13
[114] = "%d", -- ail Warning Radar Power ON/OFF
[115] = "%d", -- Tail Warning Radar Test
[113] = "%.4f", -- Tail Warning Radar Light Control
-------------
[79] = "%.4f", -- Hydraulic Release Knob
[94] = "%.4f", -- Flaps Control Handle
[84] = "%d", -- Parking Brake Handle
[81] = "%d", -- Safe Landing Gear Light Test
[83] = "%d", -- Unsafe Landing Gear Light Test
-- Detrola receiver
[137] = "%0.4f", -- Detrola Frequency Selector
[138] = "%0.4f", -- Detrola Volume
-- canopy
[147] = "%.4f", -- Canopy Hand Crank
[149] = "%d", -- Canopy Emergency Release Handle
-- AN/ARA-8
[152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING
[153] = "%d", -- Homing Adapter Power On/Off
[154] = "%d", -- Homing Adapter's Circuit Breaker
-- SCR-695
[139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6
[140] = "%d", -- IFF Power On/Off
[141] = "%d", -- IFF TIME/OFF/ON
[142] = "%d", -- IFF Detonator Circuit On/Off
[143] = "%d", -- IFF Distress Signal On/Off
[145] = "%d", -- IFF Detonator Left
[146] = "%d", -- IFF Detonator Right
-- Trimmers
[91] = "%.4f", -- Aileron Trim
[92] = "%.4f", -- Elevator Trim
[93] = "%.4f", -- Rudder Trim
-------------
[157] = "%.4f", -- Defroster
[158] = "%.4f", -- Cold Air
[159] = "%.4f", -- Hot Air
-------------
[89] = "%d", -- Landing Light On/Off
[168] = "%d", -- Coolant Control Cover
[87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control
[169] = "%d", -- Oil Control Cover
[88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control
[134] = "%0.1f", -- Carburetor Cold Air Control
[135] = "%0.1f", -- Carburetor Warm Air Control
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
[43] = "%.4f", -- Throttle
[46] = "%.4f", -- Propeller RPM
[173] = "%.4f", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
[48] = "%.4f", -- Lock Throttle
[49] = "%.4f", -- Lock Propeller & Mixture
[176] = "%.4f", -- G-meter reset
[183] = "%.4f" -- Mirror
}
-----------------------------
-- HIGH IMPORTANCE EXPORTS --
-- done every export event --
-----------------------------
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
--[[
every frame export to GlassCockpit
Example from A-10C
Get Radio Frequencies
get data from device
local lUHFRadio = GetDevice(54)
SendData("ExportID", "Format")
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
end
function ProcessHARDWAREConfigHighImportance(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
]]
-- no dimming lights
-- TailRadarWarning
SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.3 and 1 or 0) -- Lamp TailRadarWarning
-- SCR-522A Control panel
SendDataHW("122", mainPanelDevice:get_argument_value(122) > 0.3 and 1 or 0) -- A_channel_light
SendDataHW("123", mainPanelDevice:get_argument_value(123) > 0.3 and 1 or 0) -- B_channel_light
SendDataHW("124", mainPanelDevice:get_argument_value(124) > 0.3 and 1 or 0) -- C_channel_light
SendDataHW("125", mainPanelDevice:get_argument_value(125) > 0.3 and 1 or 0) -- D_channel_light
SendDataHW("126", mainPanelDevice:get_argument_value(126) > 0.3 and 1 or 0) -- Transmit_light
-- Landing gears
SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- LandingGearGreenLight
SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- LandingGearRedLight
-- Engine
SendDataHW("59", mainPanelDevice:get_argument_value(59) > 0.3 and 1 or 0) -- Hight_Blower_Lamp
-- Cockpit Lights
SendDataHW("164", mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Left_Fluor_Light
SendDataHW("165", mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Right_Fluor_Light
SendDataHW("185", mainPanelDevice:get_argument_value(185) > 0.3 and 1 or 0) -- Left_cockpit_light
SendDataHW("186", mainPanelDevice:get_argument_value(186) > 0.3 and 1 or 0) -- Right_cockpit_light
--[[
-- dimming lights
-- TailRadarWarning
SendDataHW("161", string.format("%.1f", mainPanelDevice:get_argument_value(161))) -- Lamp TailRadarWarning
-- SCR-522A Control panel
SendDataHW("122", string.format("%.1f", mainPanelDevice:get_argument_value(122))) -- A_channel_light
SendDataHW("123", string.format("%.1f", mainPanelDevice:get_argument_value(123))) -- B_channel_light
SendDataHW("124", string.format("%.1f", mainPanelDevice:get_argument_value(124))) -- C_channel_light
SendDataHW("125", string.format("%.1f", mainPanelDevice:get_argument_value(125))) -- D_channel_light
SendDataHW("126", string.format("%.1f", mainPanelDevice:get_argument_value(126))) -- Transmit_light
-- Landing gears
SendDataHW("80", string.format("%.1f", mainPanelDevice:get_argument_value(80))) -- LandingGearGreenLight
SendDataHW("82", string.format("%.1f", mainPanelDevice:get_argument_value(82))) -- LandingGearRedLight
-- Engine
SendDataHW("59", string.format("%.1f", mainPanelDevice:get_argument_value(59))) -- Hight_Blower_Lamp
-- Cockpit Lights
SendDataHW("164", string.format("%.1f", mainPanelDevice:get_argument_value(164))) -- Left_Fluor_Light
SendDataHW("165", string.format("%.1f", mainPanelDevice:get_argument_value(165))) -- Right_Fluor_Light
SendDataHW("185", string.format("%.1f", mainPanelDevice:get_argument_value(185))) -- Left_cockpit_light
SendDataHW("186", string.format("%.1f", mainPanelDevice:get_argument_value(186))) -- Right_cockpit_light
]]
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
--[[
export in low tick interval to GlassCockpit
Example from A-10C
Get Radio Frequencies
get data from device
local lUHFRadio = GetDevice(54)
SendData("ExportID", "Format")
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
]]
--[[
local lDETROLA = GetDevice(24)
WriteToLog('lDETROLA: '..dump(lDETROLA:is_on()))
WriteToLog('lDETROLA: '..dump(lDETROLA:get_frequency()))
--SendData(2000, string.format("%7.3f", lDETROLA:get_frequency()/1000000))
local lINTERCOM = GetDevice(31)
WriteToLog('lINTERCOM: '..dump(lINTERCOM:is_communicator_available()))
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_noise_level()))
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_signal_level()))
]]
--[[
local ltmp1 = 0
for ltmp2 = 1, 32, 1 do
ltmp1 = GetDevice(ltmp2)
WriteToLog(ltmp2..': '..dump(ltmp1))
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
end
]]
end
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
--[[
export in low tick interval to hardware
Example from A-10C
Landing Gear
mainPanelDevice, basis panel
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
]]
--[[
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
local ltmp1 = 0
for ltmp2 = 1, 10, 1 do
ltmp1 = list_indication(ltmp2)
WriteToLog(ltmp2..': '..dump(ltmp1))
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
end
]]
end

1647
ExportsModules/UH-1H.lua Normal file

File diff suppressed because it is too large Load Diff

20
README.md Normal file
View File

@ -0,0 +1,20 @@
Deutsch
--------------------------------
Dies ist ein universell einsetzbares Export Script für DCS.
Es wird der gleichzeitige Export von Daten an verschiedene Software(Hardware)-Tools ermöglicht.
Zur Zeit werden folgende Export-Formate unterstützt.
- D.A.C. (DCS Arcaze Connector) um die Arcaze USB Controller anzusprechen (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB)
- HawkTouch in der Version 1.5/1.6 (http://forums.eagle.ru/showthread.php?t=71729) mit der GaugePack.dll in der Version von hjpullmann.
- HELIOS in der Version 1.3.19 (http://www.gadrocsworkshop.com/helios/) (Unterstützt nur die DCS Module A-10C, Ka-50 und im Eingeschränkten Umfang die SU-25T und die Flaming Cliffs Flugzeuge)
und andere Software/Hardware die ihre Daten über eine UDP Netzwerkverbindung bekommen und die Daten in einem Key=Value Format verarbeiten.
English
--------------------------------
This is an universally insertable export script for DCS. It allows for the simultaneous export of data of different programs and hardware
At present the following export formats are supported:
- D.A.C. (DCS Arcaze Connector) to address the Arcaze USB Controller (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB)
- HawkTouch in version 1.5/1.6 (http://forums.eagle.ru/showthread.php?t=71729) with GaugePack.dll in the version from hjpullmann.
- HELIOS in the version 1.3.19 (http://www.gadrocsworkshop.com/helios/) (Only supports the DCS Module A-10C, Ka-50 and in a limited capacity the SU-25T and the Flaming Cliffs Aircraft)
and other Software/Hardware that obtain your data via a UDP network connection and then process it into a Key=Value Format.

722
Scripts/Export.lua Normal file
View File

@ -0,0 +1,722 @@
-- HELIOS and Arcaze Export Script
-- Version 0.9.9 BETA
--
-- Copyright by Michael aka McMicha 2014
-- Contact dcs2arcaze.micha@farbpigmente.org
-- List of all DCS Module Scripts
----------
-- DATA --
----------
-- Glass Cockpit Software
-- for example
-- HELIOS (http://www.gadrocsworkshop.com/helios/), Type 1
-- HawgTouch (http://forums.eagle.ru/showthread.php?t=71729), Type 2
gES_GlassCockpitExport = true -- false for not use
gES_GlassCockpitHost = "127.0.0.1" -- IP for HELIOS or HawgToch
gES_GlassCockpitPort = 1625 -- Port for HELIOS (9089) or HawgTouch (1625)
gES_GlassCockpitSeparator = ":"
gES_GlassCockpitType = 2 -- 1 = HELIOS, 2 = HawgTouch
-- for example D.A.C. or SIOC
gES_HARDWAREExport = true -- false for not use
gES_HARDWARE = {}
-- first hardware
gES_HARDWARE[1] = {}
gES_HARDWARE[1].Host = "127.0.0.1" -- IP for hardware 1
gES_HARDWARE[1].SendPort = 26026 -- Port for hardware 1
gES_HARDWARE[1].Separator = ":"
-- secound to n hardware
--gES_HARDWARE[2] = {}
--gES_HARDWARE[2].Host = "127.0.0.1" -- IP for hardware 2
--gES_HARDWARE[2].SendPort = 9092 -- Port for hardware 2
--gES_HARDWARE[2].Separator = ";"
-- D.A.C. can data send
gES_HARDWAREListner = true -- false for not use
gES_HARDWAREListnerPort = 26027 -- Listener Port for D.A.C.
gES_ExportInterval = 0.1
gES_ExportLowTickInterval = 1
gES_ExportModulePath = lfs.writedir().."ExportsModules\\"
gES_LogPath = lfs.writedir().."Logs\\Export.log"
gES_Debug = false
gES_FirstNewDataSend = true
gES_FirstNewDataSendCount = 5
gES_genericRadioHardwareID = 1
------------
-- SCRIPT --
------------
os.setlocale("ISO-8559-1", "numeric")
-- Simulation id
gES_SimID = string.format("%08x*",os.time())
-- State data for export
gES_PacketSize = 0
gES_SendStrings = {}
gES_LastData = {}
gES_PacketSizeHW = {}
gES_SendStringsHW = {}
gES_LastDataHW = {}
for i = 1, #gES_HARDWARE, 1 do
gES_PacketSizeHW[i] = 0
gES_SendStringsHW[i] = {}
gES_LastDataHW[i] = {}
end
-- Frame counter for non important data
gES_TickCount = 0
gES_TickCountHW = 0
-- Found DCS or FC Module
gES_FoundDCSModule = false
gES_FoundFCModule = false
gES_FoundNoModul = true
---------------------------------------------
-- DCS Export API Function Implementations --
---------------------------------------------
function LuaExportStart()
-- Works once just before mission start.
-- (and before player selects their aircraft, if there is a choice!)
-- 2) Setup udp sockets to talk to GlassCockpit
package.path = package.path..";.\\LuaSocket\\?.lua"
package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
gES_socket = require("socket")
gES_c = gES_socket.udp()
gES_c:setsockname("*", 0)
gES_c:setoption('broadcast', true)
gES_c:settimeout(.001) -- set the timeout for reading the socket
if gES_HARDWAREListner then
gES_c2 = gES_socket.udp()
gES_c2:setsockname("*", gES_HARDWAREListnerPort)
gES_c2:setoption('broadcast', true)
gES_c2:settimeout(.001) -- set the timeout for reading the socket
end
-- local lrename1, lrename2 = os.rename(gES_LogPath, gES_LogPath..".old")
gES_logFile = io.open(gES_LogPath, "w+")
WriteToLog("Export Modules Script Path: "..gES_ExportModulePath)
-- if lrenmae1 == nil then
-- WriteToLog("Rename Error: "..lrename2)
-- end
SelectModule() -- point globals to Module functions and data.
end
function WriteToLog(message)
if gES_logFile then
gES_logFile:write(os.date("%X :")..message.."\r\n")
end
end
function LuaExportBeforeNextFrame()
ProcessInput()
end
function LuaExportAfterNextFrame()
end
function LuaExportStop()
-- Works once just after mission stop.
for i=1, #gES_HARDWARE, 1 do
SendDataHW("DAC", "stop", i)
FlushDataHW(i)
end
gES_c:close()
if gES_HARDWAREListner then
gES_c2:close()
end
if gES_logFile then
gES_logFile:flush()
gES_logFile:close()
gES_logFile = nil
end
end
function ProcessInput()
local lCommand, lCommandArgs, lDevice
-- C1,3001,4
-- lComand = C
-- lCommandArgs[1] = 1 => lDevice
-- lCommandArgs[2] = 3001
-- lCommandArgs[3] = 4
if gES_GlassCockpitExport then
local lInput,from,port = gES_c:receivefrom()
if lInput then
if gES_Debug then
WriteToLog("lInput: "..lInput..", from: "..from..", port: "..port)
end
lCommand = string.sub(lInput,1,1)
if lCommand == "R" then
ResetChangeValues()
end
if (lCommand == "C") then
lCommandArgs = StrSplit(string.sub(lInput,2),",")
lDevice = GetDevice(lCommandArgs[1])
if type(lDevice) == "table" then
lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3])
end
end
end
end
if gES_HARDWAREListner then
local lInput2,from2,port2 = gES_c2:receivefrom() -- Hardware
if lInput2 then
if gES_Debug then
WriteToLog("lInput2: "..lInput2..", from2: "..from2..", port2: "..port2)
end
lCommand = string.sub(lInput2,1,1)
if lCommand == "C" then
ResetChangeValuesHW()
end
if (lCommand == "C") then
lCommandArgs = StrSplit(string.sub(lInput2,2),",")
lDevice = GetDevice(lCommandArgs[1])
if lDevice ~= "1000" then
if type(lDevice) == "table" then
lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3])
end
elseif lDevice == "1000" then
--genericRadio(key, value, hardware)
genericRadio(lCommandArgs[2],lCommandArgs[3], gES_genericRadioHardwareID)
end
end
end
end
end
function LuaExportActivityNextEvent(t)
t = t + gES_ExportInterval
gES_TickCount = gES_TickCount + 1
local lMyInfo = LoGetSelfData()
if lMyInfo ~= nil then
if gES_ModuleName ~= lMyInfo.Name then
SelectModule() -- point globals to Module functions and data.
end
lMyInfo = nil
end
local lDevice = GetDevice(0)
if type(lDevice) == "table" and gES_FoundDCSModule then
lDevice:update_arguments()
if gES_GlassCockpitExport then
--ProcessArguments(lDevice, gES_EveryFrameArguments) -- Module arguments as appropriate
coProcessArguments_EveryFrame = coroutine.create(ProcessArguments)
status = coroutine.resume( coProcessArguments_EveryFrame, lDevice, gES_EveryFrameArguments)
if gES_Debug then
WriteToLog("coProcessArguments_EveryFrame Status: "..dump(status))
end
--ProcessGlassCockpitDCSHighImportance(lDevice) -- Module, as appropriate; determined in SelectModule()
coProcessGlassCockpitDCSHighImportance = coroutine.create(ProcessGlassCockpitDCSHighImportance)
status = coroutine.resume( coProcessGlassCockpitDCSHighImportance, lDevice)
if gES_Debug then
WriteToLog("coProcessGlassCockpitDCSHighImportance Status: "..dump(status))
end
end
if gES_HARDWAREExport then
--ProcessHARDWAREHighImportance(lDevice) -- Module, as appropriate; determined in SelectModule()
coProcessHARDWAREHighImportance = coroutine.create(ProcessHARDWAREHighImportance)
status = coroutine.resume( coProcessHARDWAREHighImportance, lDevice)
if gES_Debug then
WriteToLog("coProcessHARDWAREHighImportance Status: "..dump(status))
end
end
if gES_FirstNewDataSend and gES_FirstNewDataSendCount == 0 then
if gES_HARDWAREExport then
ResetChangeValuesHW()
end
if gES_GlassCockpitExport then
ResetChangeValues()
end
gES_FirstNewDataSend = false
else
gES_FirstNewDataSendCount = gES_FirstNewDataSendCount - 1
end
if gES_TickCount >= gES_ExportLowTickInterval then
if gES_GlassCockpitExport then
--ProcessArguments(lDevice, gES_Arguments) -- Module arguments as appropriate
coProcessArguments_Arguments = coroutine.create(ProcessArguments)
status = coroutine.resume( coProcessArguments_Arguments, lDevice, gES_Arguments)
if gES_Debug then
WriteToLog("coProcessArguments_Arguments Status: "..dump(status))
end
--ProcessGlassCockpitDCSLowImportance(lDevice) -- Module as appropriate; determined in SelectModule()
coProcessGlassCockpitDCSLowImportance = coroutine.create(ProcessGlassCockpitDCSLowImportance)
status = coroutine.resume( coProcessGlassCockpitDCSLowImportance, lDevice)
if gES_Debug then
WriteToLog("coProcessGlassCockpitDCSLowImportance Status: "..dump(status))
end
end
if gES_HARDWAREExport then
--ProcessHARDWARELowImportance(lDevice) -- Module, as appropriate; determined in SelectModule()
coProcessHARDWARELowImportance = coroutine.create(ProcessHARDWARELowImportance)
status = coroutine.resume( coProcessHARDWARELowImportance, lDevice)
if gES_Debug then
WriteToLog("coProcessHARDWARELowImportance Status: "..dump(status))
end
gES_TickCountHW = gES_TickCountHW + 1
end
gES_TickCount = 0
end
if gES_GlassCockpitExport then
FlushData()
end
if gES_HARDWAREExport then
for i=1, #gES_HARDWARE, 1 do
FlushDataHW(i)
end
end
elseif gES_FoundFCModule then -- Assume FC Aircraft
if gES_GlassCockpitExport then
--ProcessGlassCockpitFCHighImportance()
coProcessGlassCockpitFCHighImportance = coroutine.create(ProcessGlassCockpitFCHighImportance)
status = coroutine.resume( coProcessGlassCockpitFCHighImportance)
if gES_Debug then
WriteToLog("coProcessGlassCockpitFCHighImportance Status: "..dump(status))
end
end
if gES_HARDWAREExport then
--ProcessHARDWAREHighImportance(lDevice)
coProcessHARDWAREHighImportance = coroutine.create(ProcessHARDWAREHighImportance)
status = coroutine.resume( coProcessHARDWAREHighImportance, lDevice)
if gES_Debug then
WriteToLog("coProcessHARDWAREHighImportance Status: "..dump(status))
end
end
if gES_FirstNewDataSend and gES_FirstNewDataSendCount == 0 then
if gES_HARDWAREExport then
ResetChangeValuesHW()
end
if gES_GlassCockpitExport then
ResetChangeValues()
end
gES_FirstNewDataSend = false
else
gES_FirstNewDataSendCount = gES_FirstNewDataSendCount - 1
end
if gES_TickCount >= gES_ExportLowTickInterval then
if gES_GlassCockpitExport then
--ProcessGlassCockpitFCLowImportance()
coProcessGlassCockpitFCLowImportance = coroutine.create(ProcessGlassCockpitFCLowImportance)
status = coroutine.resume( coProcessGlassCockpitFCLowImportance)
if gES_Debug then
WriteToLog("coProcessGlassCockpitFCLowImportance Status: "..dump(status))
end
end
if gES_HARDWAREExport then
--ProcessHARDWARELowImportance(lDevice)
coProcessHARDWARELowImportance = coroutine.create(ProcessHARDWARELowImportance)
status = coroutine.resume( coProcessHARDWARELowImportance, lDevice)
if gES_Debug then
WriteToLog("coProcessHARDWARELowImportance Status: "..dump(status))
end
gES_TickCountHW = gES_TickCountHW + 1
end
gES_TickCount = 0
end
if gES_GlassCockpitExport then
FlushData()
end
if gES_HARDWAREExport then
for i=1, #gES_HARDWARE, 1 do
FlushDataHW(i)
end
end
else -- No Module found
if gES_FoundNoModul then
WriteToLog("No Module Found.")
SelectModule() -- point globals to Module functions and data.
end
end
return t
end
-- Helper Functions
function StrSplit(str, delim, maxNb)
-- Eliminate bad cases...
if string.find(str, delim) == nil then
return { str }
end
if maxNb == nil or maxNb < 1 then
maxNb = 0 -- No limit
end
local lResult = {}
local lPat = "(.-)" .. delim .. "()"
local lNb = 0
local lLastPos
for part, pos in string.gfind(str, lPat) do
lNb = lNb + 1
lResult[lNb] = part
lLastPos = pos
if lNb == maxNb then break end
end
-- Handle the last field
if lNb ~= maxNb then
lResult[lNb + 1] = string.sub(str, lLastPos)
end
return lResult
end
function round(num, idp)
local lMult = 10^(idp or 0)
return math.floor(num * lMult + 0.5) / lMult
end
-- Status Gathering Functions
function ProcessArguments(device, arguments)
local lArgument , lFormat , lArgumentValue
local lCounter = 0
if gES_Debug then
WriteToLog("======Begin========")
end
for lArgument, lFormat in pairs(arguments) do
lArgumentValue = string.format(lFormat,device:get_argument_value(lArgument))
if gES_Debug then
lCounter = lCounter + 1
WriteToLog(lCounter..". ID: "..lArgument..", Fromat: "..lFormat..", Value: "..lArgumentValue)
end
SendData(lArgument, lArgumentValue)
end
if gES_Debug then
WriteToLog("======End========")
end
end
-- Network Functions for GlassCockpit
function SendData(id, value)
if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then
value = value:sub(2)
end
if gES_LastData[id] == nil or gES_LastData[id] ~= value then
local ldata = id .. "=" .. value
local ldataLen = string.len(ldata)
if ldataLen + gES_PacketSize > 576 then
FlushData()
end
table.insert(gES_SendStrings, ldata)
gES_LastData[id] = value
gES_PacketSize = gES_PacketSize + ldataLen + 1
end
end
-- Network Functions for Hardware
function SendDataHW(id, value, hardware)
hardware = hardware or 1
if gES_HARDWARE[hardware] == nil then
WriteToLog("unknown hardware ID '"..hardware.."' for value: '"..id.."="..value.."'")
return
end
if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then
value = value:sub(2)
end
if gES_LastDataHW[hardware][id] == nil or gES_LastDataHW[hardware][id] ~= value then
local ldata = id .. "=" .. value
local ldataLen = string.len(ldata)
if ldataLen + gES_PacketSizeHW[hardware] > 576 then
FlushDataHW(hardware)
end
table.insert(gES_SendStringsHW[hardware], ldata)
gES_LastDataHW[hardware][id] = value
gES_PacketSizeHW[hardware] = gES_PacketSizeHW[hardware] + ldataLen + 1
--WriteToLog("id=ldata: "..ldata)
--WriteToLog("gES_LastDataHW["..hardware.."]: "..dump(gES_LastDataHW[hardware]))
end
end
function FlushData()
if #gES_SendStrings > 0 then
local lES_SimID = ""
if gES_GlassCockpitType == 1 then
lES_SimID = gES_SimID
elseif gES_GlassCockpitType == 2 then
lES_SimID = ""
end
local lPacket = lES_SimID .. table.concat(gES_SendStrings, gES_GlassCockpitSeparator) .. "\n"
gES_socket.try(gES_c:sendto(lPacket, gES_GlassCockpitHost, gES_GlassCockpitPort))
gES_SendStrings = {}
gES_PacketSize = 0
end
end
function FlushDataHW(hardware)
hardware = hardware or 1
if gES_HARDWARE[hardware] == nil then
WriteToLog("unknown hardware ID '"..hardware.."'")
return
end
if #gES_SendStringsHW[hardware] > 0 then
local lPacket = gES_SimID .. table.concat(gES_SendStringsHW[hardware], gES_HARDWARE[hardware].Separator) .. "\n"
gES_socket.try(gES_c:sendto(lPacket, gES_HARDWARE[hardware].Host, gES_HARDWARE[hardware].SendPort))
gES_SendStringsHW[hardware] = {}
gES_PacketSizeHW[hardware] = 0
end
end
function ResetChangeValues()
gES_LastData = {}
gES_TickCount = 10
end
function ResetChangeValuesHW()
for i = 1, #gES_HARDWARE, 1 do
gES_LastDataHW[i] = {}
end
gES_TickCount = 10
gES_TickCountHW = 0
end
function SelectModule()
-- Select Module...
gES_FoundDCSModule = false
gES_FoundFCModule = false
gES_FoundNoModul = true
local lMyInfo = LoGetSelfData()
if lMyInfo == nil then -- End SelectModule, if don't selected a aircraft
return
end
gES_ModuleName = lMyInfo.Name
local lModuleName = gES_ModuleName..".lua"
local lModuleFile = ""
gES_FoundNoModul = false
for file in lfs.dir(gES_ExportModulePath) do
if lfs.attributes(gES_ExportModulePath..file,"mode") == "file" then
if file == lModuleName then
lModuleFile = gES_ExportModulePath..file
end
end
end
WriteToLog("File Path: "..lModuleFile)
if string.len(lModuleFile) > 1 then
ResetChangeValuesHW()
-- load Aircraft File
dofile(lModuleFile)
for i=1, #gES_HARDWARE, 1 do
SendDataHW("File", lMyInfo.Name, i)
FlushDataHW(i)
end
WriteToLog("File '"..lModuleFile.."' loaded")
gES_FirstNewDataSend = true
gES_FirstNewDataSendCount = 5
if gES_FoundDCSModule then
local lCounter = 0
for k, v in pairs(gES_GlassCockpitConfigEveryFrameArguments) do
lCounter = lCounter + 1
end
if gES_Debug then
WriteToLog("gES_GlassCockpitConfigEveryFrameArguments Count: "..lCounter)
end
if lCounter > 0 then
gES_EveryFrameArguments = gES_GlassCockpitConfigEveryFrameArguments
else
-- no Arguments
gES_EveryFrameArguments = {}
end
lCounter = 0
for k, v in pairs(gES_GlassCockpitConfigArguments) do
lCounter = lCounter + 1
end
if gES_Debug then
WriteToLog("gES_GlassCockpitConfigArguments Count: "..lCounter)
end
if lCounter > 0 then
gES_Arguments = gES_GlassCockpitConfigArguments
else
-- no Arguments
gES_Arguments = {}
end
ProcessGlassCockpitDCSHighImportance = ProcessGlassCockpitDCSConfigHighImportance
ProcessGlassCockpitDCSLowImportance = ProcessGlassCockpitDCSConfigLowImportance
ProcessHARDWAREHighImportance = ProcessHARDWAREConfigHighImportance
ProcessHARDWARELowImportance = ProcessHARDWAREConfigLowImportance
elseif gES_FoundFCModule then
ProcessGlassCockpitFCHighImportance = ProcessGlassCockpitFCHighImportanceConfig
ProcessGlassCockpitFCLowImportance = ProcessGlassCockpitFCLowImportanceConfig
ProcessHARDWAREHighImportance = ProcessHARDWAREConfigHighImportance
ProcessHARDWARELowImportance = ProcessHARDWAREConfigLowImportance
else
WriteToLog("Unknown Module Type: "..lMyInfo.Name)
end
else -- Unknown Module
ProcessGlassCockpitDCSHighImportance = ProcessGlassCockpitDCSHighImportanceNoConfig
ProcessGlassCockpitDCSLowImportance = ProcessGlassCockpitDCSLowImportanceNoConfig
ProcessGlassCockpitFCHighImportance = ProcessGlassCockpitFCHighImportanceNoConfig
ProcessGlassCockpitFCLowImportance = ProcessGlassCockpitFCLowImportanceNoConfig
ProcessHARDWAREHighImportance = ProcessHARDWARENoConfigHighImportance
ProcessHARDWARELowImportance = ProcessHARDWARENoConfigLowImportance
gES_EveryFrameArguments = {}
gES_Arguments = {}
WriteToLog("Unknown Module Name: "..lMyInfo.Name)
end
end
-- The dump function show the content of the specified variable.
-- dump is similar to PHP function var_dump and show variables from type
-- "nil, "number", "string", "boolean, "table", "function", "thread" and "userdata"
function dump(var, depth)
depth = depth or 0
if type(var) == "string" then
return 'string: "' .. var .. '"\n'
elseif type(var) == "nil" then
return 'nil\n'
elseif type(var) == "number" then
return 'number: "' .. var .. '"\n'
elseif type(var) == "boolean" then
return 'boolean: "' .. tostring(var) .. '"\n'
elseif type(var) == "function" then
if debug and debug.getinfo then
fcnname = tostring(var)
local info = debug.getinfo(var, "S")
if info.what == "C" then
return string.format('%q', fcnname .. ', C function') .. '\n'
else
if (string.sub(info.source, 1, 2) == [[./]]) then
return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')' .. info.source) ..'\n'
else
return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')') ..'\n'
end
end
else
return 'a function\n'
end
elseif type(var) == "thread" then
return 'thread\n'
elseif type(var) == "userdata" then
return tostring(var)..'\n'
elseif type(var) == "table" then
depth = depth + 1
out = "{\n"
for k,v in pairs(var) do
out = out .. (" "):rep(depth*4).. "["..k.."] = " .. dump(v, depth)
end
return out .. (" "):rep((depth-1)*4) .. "}\n"
else
return tostring(var) .. "\n"
end
end
-- round function for math libraray
-- number : value
-- decimals: number of decimal
-- method : ceil: Returns the smallest integer larger than or equal to number
-- floor: Returns the smallest integer smaller than or equal to number
function math.round(number, decimals, method)
if string.find(number, "%p" ) ~= nil then
decimals = decimals or 0
local lFactor = 10 ^ decimals
if (method == "ceil" or method == "floor") then
-- ceil: Returns the smallest integer larger than or equal to number
-- floor: Returns the smallest integer smaller than or equal to number
return math[method](number * lFactor) / lFactor
else
return tonumber(("%."..decimals.."f"):format(number))
end
else
return number
end
end
-- split function for string libraray
-- stringvalue: value
-- delimiter : delimiter for split
-- for example, see http://www.lua.org/manual/5.1/manual.html#5.4.1
function string.split(stringvalue, delimiter)
result = {};
for match in (stringvalue..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match);
end
return result;
end
-- Pointed to by ProcessGlassCockpitDCSHighImportance, if the player aircraft is something else
function ProcessGlassCockpitDCSHighImportanceNoConfig(mainPanelDevice)
end
-- Pointed to by ProcessGlassCockpitDCSLowImportance, if the player aircraft is something else
function ProcessGlassCockpitDCSLowImportanceNoConfig(mainPanelDevice)
end
-----------------------------------------
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
-- FC aircraft don't support GetDevice --
-----------------------------------------
-- the player aircraft is a Flaming Cliffs or similar aircraft
function ProcessGlassCockpitFCHighImportanceNoConfig()
end
function ProcessGlassCockpitFCLowImportanceNoConfig()
end
-- Hardware exports
function ProcessHARDWARENoConfigHighImportance(mainPanelDevice)
end
function ProcessHARDWARENoConfigLowImportance(mainPanelDevice)
end
--dofile("./AriesWings/AriesRadio.luac")