mirror of
https://github.com/weyne85/DCS-ExportScripts.git
synced 2025-10-29 16:58:18 +00:00
New Version for DCS World Version 1.5.2 and Iakrus and DAC.
This Version ist without support for HT or HELIOS.
This commit is contained in:
parent
3e545e6c53
commit
d6302f1e70
@ -1,106 +0,0 @@
|
|||||||
-- 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
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,554 +0,0 @@
|
|||||||
-- 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 {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}
|
|
||||||
[29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6}
|
|
||||||
-- Altimeter
|
|
||||||
[97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0}
|
|
||||||
[96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0}
|
|
||||||
[24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0}
|
|
||||||
[25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0}
|
|
||||||
-- Artificial horizon
|
|
||||||
[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0}
|
|
||||||
[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
|
|
||||||
[16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0}
|
|
||||||
[20] = "%.1f", -- AHorizon_Caged {0.0, 1.0}
|
|
||||||
-- directional gyro
|
|
||||||
[12] = "%.4f", -- GyroHeading
|
|
||||||
-- turn indicator
|
|
||||||
[27] = "%.4f", -- TurnNeedle {-1.0, 1.0}
|
|
||||||
[28] = "%.4f", -- Slipball {-1.0, 1.0}
|
|
||||||
-- oxygen pressure indicator
|
|
||||||
[34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0}
|
|
||||||
[33] = "%.4f", -- Oxygen_Flow_Blinker
|
|
||||||
-- fuel system
|
|
||||||
[155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
|
||||||
[156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
|
||||||
[160] = "%.4f", -- Fuel_Tank_Fuselage {0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0} {0.0,0.12,0.28,0.40,0.51,0.62,0.72,0.83,0.96,1.0}
|
|
||||||
[32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0}
|
|
||||||
-- A-11 clock
|
|
||||||
[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0}
|
|
||||||
[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0}
|
|
||||||
[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0}
|
|
||||||
-- 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 {0.0, 2000.0} {0.0, 1.0}
|
|
||||||
-- 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 {10.0, 75.0} {0.0, 1.0}
|
|
||||||
[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0}
|
|
||||||
[9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0}
|
|
||||||
[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
|
|
||||||
[22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1}
|
|
||||||
[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0}
|
|
||||||
[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0}
|
|
||||||
[164] = "%.1f", -- Left_Fluor_Light
|
|
||||||
[165] = "%.1f", -- Right_Fluor_Light
|
|
||||||
[59] = "%.1f", -- Hight_Blower_Lamp
|
|
||||||
-- Trimmer
|
|
||||||
[170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0}
|
|
||||||
[172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0}
|
|
||||||
[171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0}
|
|
||||||
[174] = "%.4f", -- Control_Lock_Bracket
|
|
||||||
[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}
|
|
||||||
[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0}
|
|
||||||
-- 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
|
|
||||||
-------------
|
|
||||||
--[413] = "%.1f", -- WindShieldDamages
|
|
||||||
--[412] = "%.1f", -- WindShieldOil
|
|
||||||
}
|
|
||||||
|
|
||||||
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] = "%.4f", -- Right Fluorescent Light (rotary)
|
|
||||||
[90] = "%.4f", -- Left Fluorescent Light (rotary)
|
|
||||||
-- Flight Instrument panel
|
|
||||||
[3] = "%.4f", -- Course Set (rotary)
|
|
||||||
[13] = "%.4f", -- Heading Set/Cage (rotary)
|
|
||||||
[179] = "%d", -- Heading Set/Cage Button
|
|
||||||
[17] = "%.4f", -- Pitch Adjustment (rotary)
|
|
||||||
[18] = "%.4f", -- Cage (rotary)
|
|
||||||
[19] = "%d", -- Cage Button
|
|
||||||
[8] = "%d", -- Winding/Adjustment Clock Button
|
|
||||||
[7] = "%.4f", -- Winding/Adjustment Clock (rotary)
|
|
||||||
[26] = "%.4f", -- Set Pressure (rotary)
|
|
||||||
-- 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 (rotary)
|
|
||||||
[116] = "%.4f", -- Radio Audio Volume (rotary)
|
|
||||||
[44] = "%d", -- Microphone On
|
|
||||||
[200] = "%d", -- Arm rest
|
|
||||||
[129] = "%d", -- Switch Locking Lever
|
|
||||||
[128] = "%d", -- Radio Mode Transmit/Receive/Remote
|
|
||||||
-------------
|
|
||||||
[71] = "%.4f", -- Cockpit Lights (rotary)
|
|
||||||
[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.4f", -- 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 (rotary)
|
|
||||||
-------------
|
|
||||||
[79] = "%d", -- Hydraulic Release Knob
|
|
||||||
[94] = "%.4f", -- Flaps Control Handle (rotary)
|
|
||||||
[84] = "%d", -- Parking Brake Handle
|
|
||||||
[81] = "%d", -- Safe Landing Gear Light Test
|
|
||||||
[83] = "%d", -- Unsafe Landing Gear Light Test
|
|
||||||
-- Detrola receiver
|
|
||||||
[137] = "%.4f", -- Detrola Frequency Selector (rotary)
|
|
||||||
[138] = "%.4f", -- Detrola Volume (rotary)
|
|
||||||
-- canopy
|
|
||||||
[147] = "%.4f", -- Canopy Hand Crank (rotary)
|
|
||||||
[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 (rotary)
|
|
||||||
[92] = "%.4f", -- Elevator Trim (rotary)
|
|
||||||
[93] = "%.4f", -- Rudder Trim (rotary)
|
|
||||||
-------------
|
|
||||||
[157] = "%.4f", -- Defroster (rotary)
|
|
||||||
[158] = "%.4f", -- Cold Air (rotary)
|
|
||||||
[159] = "%.4f", -- Hot Air (rotary)
|
|
||||||
-------------
|
|
||||||
[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 (rotary)
|
|
||||||
[135] = "%0.1f", -- Carburetor Warm Air Control (rotary)
|
|
||||||
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
|
|
||||||
[43] = "%.4f", -- Throttle (rotary)
|
|
||||||
[46] = "%.4f", -- Propeller RPM (rotary)
|
|
||||||
[173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
|
|
||||||
[48] = "%.4f", -- Lock Throttle (rotary)
|
|
||||||
[49] = "%.4f", -- Lock Propeller & Mixture (rotary)
|
|
||||||
[176] = "%d", -- G-meter reset
|
|
||||||
[183] = "%d", -- 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
|
|
||||||
]]
|
|
||||||
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
|
|
||||||
@ -1,534 +0,0 @@
|
|||||||
-- 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] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7}
|
|
||||||
[29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6}
|
|
||||||
-- Altimeter
|
|
||||||
[97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0}
|
|
||||||
[96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0}
|
|
||||||
[24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0}
|
|
||||||
[25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0}
|
|
||||||
-- Artificial horizon
|
|
||||||
[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0}
|
|
||||||
[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
|
|
||||||
[16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0}
|
|
||||||
[20] = "%.1f", -- AHorizon_Caged {0.0, 1.0}
|
|
||||||
-- directional gyro
|
|
||||||
[12] = "%.4f", -- GyroHeading
|
|
||||||
-- turn indicator
|
|
||||||
[27] = "%.4f", -- TurnNeedle {-1.0, 1.0}
|
|
||||||
[28] = "%.4f", -- Slipball {-1.0, 1.0}
|
|
||||||
-- oxygen pressure indicator
|
|
||||||
[34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0}
|
|
||||||
[33] = "%.4f", -- Oxygen_Flow_Blinker
|
|
||||||
-- fuel system
|
|
||||||
[155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
|
||||||
[156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
|
||||||
[32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0}
|
|
||||||
-- A-11 clock
|
|
||||||
[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0}
|
|
||||||
[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0}
|
|
||||||
[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0}
|
|
||||||
-- 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 {0.0, 2000.0} {0.0, 1.0}
|
|
||||||
-- 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 {10.0, 75.0} {0.0, 1.0}
|
|
||||||
[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0}
|
|
||||||
[9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0}
|
|
||||||
[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
|
|
||||||
[22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1}
|
|
||||||
[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0}
|
|
||||||
[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0}
|
|
||||||
[164] = "%.1f", -- Left_Fluor_Light
|
|
||||||
[165] = "%.1f", -- Right_Fluor_Light
|
|
||||||
[59] = "%.1f", -- Hight_Blower_Lamp
|
|
||||||
-- Trimmer
|
|
||||||
[170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0}
|
|
||||||
[172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0}
|
|
||||||
[171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0}
|
|
||||||
[174] = "%.4f", -- Control_Lock_Bracket
|
|
||||||
[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}
|
|
||||||
[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0}
|
|
||||||
-- 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] = "%.4f", -- Right Fluorescent Light (rotary)
|
|
||||||
[90] = "%.4f", -- Left Fluorescent Light (rotary)
|
|
||||||
-- Flight Instrument panel
|
|
||||||
[3] = "%.4f", -- Course Set (rotary)
|
|
||||||
[13] = "%.4f", -- Heading Set/Cage (rotary)
|
|
||||||
[179] = "%d", -- Heading Set/Cage Button
|
|
||||||
[17] = "%.4f", -- Pitch Adjustment (rotary)
|
|
||||||
[18] = "%.4f", -- Cage (rotary)
|
|
||||||
[19] = "%d", -- Cage Button
|
|
||||||
[8] = "%d", -- Winding/Adjustment Clock Button
|
|
||||||
[7] = "%.4f", -- Winding/Adjustment Clock (rotary)
|
|
||||||
[26] = "%.4f", -- Set Pressure (rotary)
|
|
||||||
-- 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 (rotary)
|
|
||||||
[116] = "%.4f", -- Radio Audio Volume (rotary)
|
|
||||||
[44] = "%d", -- Microphone On
|
|
||||||
[129] = "%d", -- Switch Locking Lever
|
|
||||||
[128] = "%d", -- Radio Mode Transmit/Receive/Remote
|
|
||||||
-------------
|
|
||||||
[71] = "%.4f", -- Cockpit Lights (rotary)
|
|
||||||
[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 (rotary)
|
|
||||||
-------------
|
|
||||||
[79] = "%d", -- Hydraulic Release Knob
|
|
||||||
[94] = "%.4f", -- Flaps Control Handle (rotary)
|
|
||||||
[84] = "%d", -- Parking Brake Handle
|
|
||||||
[81] = "%d", -- Safe Landing Gear Light Test
|
|
||||||
[83] = "%d", -- Unsafe Landing Gear Light Test
|
|
||||||
-- Detrola receiver
|
|
||||||
[137] = "%.4f", -- Detrola Frequency Selector (rotary)
|
|
||||||
[138] = "%.4f", -- Detrola Volume (rotary)
|
|
||||||
-- canopy
|
|
||||||
[147] = "%.4f", -- Canopy Hand Crank (rotary)
|
|
||||||
[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 (rotary)
|
|
||||||
[92] = "%.4f", -- Elevator Trim (rotary)
|
|
||||||
[93] = "%.4f", -- Rudder Trim (rotary)
|
|
||||||
-------------
|
|
||||||
[157] = "%.4f", -- Defroster (rotary)
|
|
||||||
[158] = "%.4f", -- Cold Air (rotary)
|
|
||||||
[159] = "%.4f", -- Hot Air (rotary)
|
|
||||||
-------------
|
|
||||||
[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 (rotary)
|
|
||||||
[135] = "%0.1f", -- Carburetor Warm Air Control (rotary)
|
|
||||||
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
|
|
||||||
[43] = "%.4f", -- Throttle (rotary)
|
|
||||||
[46] = "%.4f", -- Propeller RPM (rotary)
|
|
||||||
[173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
|
|
||||||
[48] = "%.4f", -- Lock Throttle (rotary)
|
|
||||||
[49] = "%.4f", -- Lock Propeller & Mixture (rotary)
|
|
||||||
[176] = "%d", -- G-meter reset
|
|
||||||
[183] = "%d", -- 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] = "%.1f", -- Gun Sight Brightness
|
|
||||||
[35] = "%.1f", -- 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
|
|
||||||
43
Scripts/DCS-ExportScript/Config.lua
Normal file
43
Scripts/DCS-ExportScript/Config.lua
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
-- Ikarus and D.A.C. Export Script
|
||||||
|
-- Version 1.0.0 BETA
|
||||||
|
--
|
||||||
|
-- Config File
|
||||||
|
--
|
||||||
|
-- Copyright by Michael aka McMicha 2014
|
||||||
|
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||||
|
|
||||||
|
ExportScript.Config = {}
|
||||||
|
|
||||||
|
-- Ikarus a Glass Cockpit Software
|
||||||
|
ExportScript.Config.IkarusExport = true -- false for not use
|
||||||
|
ExportScript.Config.IkarusHost = "127.0.0.1" -- IP for Ikarus
|
||||||
|
ExportScript.Config.IkarusPort = 1625 -- Port Ikarus (1625)
|
||||||
|
ExportScript.Config.IkarusSeparator = ":"
|
||||||
|
|
||||||
|
-- D.A.C. (DCS Arcaze Connector)
|
||||||
|
ExportScript.Config.DACExport = true -- false for not use
|
||||||
|
ExportScript.Config.DAC = {}
|
||||||
|
-- first hardware
|
||||||
|
ExportScript.Config.DAC[1] = {}
|
||||||
|
ExportScript.Config.DAC[1].Host = "127.0.0.1" -- IP for hardware 1
|
||||||
|
ExportScript.Config.DAC[1].SendPort = 26026 -- Port for hardware 1
|
||||||
|
ExportScript.Config.DAC[1].Separator = ":"
|
||||||
|
-- secound to n hardware
|
||||||
|
--ExportScript.Config.DAC[2] = {}
|
||||||
|
--ExportScript.Config.DAC[2].Host = "127.0.0.1" -- IP for hardware 2
|
||||||
|
--ExportScript.Config.DAC[2].SendPort = 9092 -- Port for hardware 2
|
||||||
|
--ExportScript.Config.DAC[2].Separator = ":"
|
||||||
|
|
||||||
|
-- D.A.C. can data send
|
||||||
|
ExportScript.Config.DACListener = true -- false for not use
|
||||||
|
ExportScript.Config.DACListenerPort = 26027 -- Listener Port for D.A.C.
|
||||||
|
|
||||||
|
-- Other
|
||||||
|
ExportScript.Config.ExportInterval = 0.1
|
||||||
|
ExportScript.Config.ExportLowTickInterval = 1
|
||||||
|
ExportScript.Config.LogPath = lfs.writedir()..[[Logs\Export.log]]
|
||||||
|
ExportScript.Config.ExportModulePath = lfs.writedir()..[[Scripts\DCS-ExportScript\ExportsModules\]]
|
||||||
|
ExportScript.Config.Debug = false
|
||||||
|
ExportScript.Config.FirstNewDataSend = true
|
||||||
|
ExportScript.Config.FirstNewDataSendCount = 5
|
||||||
|
ExportScript.Config.genericRadioHardwareID = 1
|
||||||
277
Scripts/DCS-ExportScript/ExportScript.lua
Normal file
277
Scripts/DCS-ExportScript/ExportScript.lua
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
-- Ikarus and D.A.C. Export Script
|
||||||
|
-- Version 1.0.0 BETA
|
||||||
|
--
|
||||||
|
-- Copyright by Michael aka McMicha 2014
|
||||||
|
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||||
|
|
||||||
|
|
||||||
|
-- Main Table
|
||||||
|
ExportScript = {}
|
||||||
|
-- Simulation id
|
||||||
|
ExportScript.SimID = string.format("%08x*",os.time())
|
||||||
|
|
||||||
|
-- State data for export
|
||||||
|
ExportScript.PacketSize = 0
|
||||||
|
ExportScript.SendStrings = {}
|
||||||
|
ExportScript.LastData = {}
|
||||||
|
|
||||||
|
ExportScript.PacketSizeDAC = {}
|
||||||
|
ExportScript.SendStringsDAC = {}
|
||||||
|
ExportScript.LastDataDAC = {}
|
||||||
|
|
||||||
|
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]])
|
||||||
|
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]])
|
||||||
|
|
||||||
|
for i = 1, #ExportScript.Config.DAC, 1 do
|
||||||
|
ExportScript.PacketSizeDAC[i] = 0
|
||||||
|
ExportScript.SendStringsDAC[i] = {}
|
||||||
|
ExportScript.LastDataDAC[i] = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Frame counter for non important data
|
||||||
|
ExportScript.TickCount = 0
|
||||||
|
ExportScript.TickCountDAC = 0
|
||||||
|
|
||||||
|
-- Found DCS or FC Module
|
||||||
|
ExportScript.FoundDCSModule = false
|
||||||
|
ExportScript.FoundFCModule = false
|
||||||
|
ExportScript.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"
|
||||||
|
|
||||||
|
ExportScript.socket = require("socket")
|
||||||
|
|
||||||
|
ExportScript.UDPsender = ExportScript.socket.udp()
|
||||||
|
ExportScript.UDPsender:setsockname("*", 0)
|
||||||
|
ExportScript.UDPsender:setoption('broadcast', true)
|
||||||
|
ExportScript.UDPsender:settimeout(.001) -- set the timeout for reading the socket
|
||||||
|
|
||||||
|
if ExportScript.Config.DACListener then
|
||||||
|
ExportScript.UDPListener = ExportScript.socket.udp()
|
||||||
|
ExportScript.UDPListener:setsockname("*", ExportScript.Config.DACListenerPort)
|
||||||
|
ExportScript.UDPListener:setoption('broadcast', true)
|
||||||
|
ExportScript.UDPListener:settimeout(.001) -- set the timeout for reading the socket
|
||||||
|
end
|
||||||
|
|
||||||
|
-- local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old")
|
||||||
|
ExportScript.logFile = io.open(ExportScript.Config.LogPath, "w+")
|
||||||
|
-- if lrenmae1 == nil then
|
||||||
|
-- ExportScript.Tools.WriteToLog("Rename Error: "..lrename2)
|
||||||
|
-- end
|
||||||
|
|
||||||
|
ExportScript.AF = {} -- Table for Auxiliary functions
|
||||||
|
ExportScript.AF.EventNumberOLD = 0 -- event number from previous event
|
||||||
|
|
||||||
|
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||||
|
end
|
||||||
|
|
||||||
|
function LuaExportBeforeNextFrame()
|
||||||
|
ExportScript.Tools.ProcessInput()
|
||||||
|
end
|
||||||
|
|
||||||
|
function LuaExportAfterNextFrame()
|
||||||
|
end
|
||||||
|
|
||||||
|
function LuaExportStop()
|
||||||
|
-- Works once just after mission stop.
|
||||||
|
ExportScript.Tools.SendDataDAC("DAC", "stop")
|
||||||
|
for i=1, #ExportScript.Config.DAC, 1 do
|
||||||
|
ExportScript.Tools.FlushDataDAC(i)
|
||||||
|
end
|
||||||
|
|
||||||
|
ExportScript.Tools.SendData("Ikarus", "stop")
|
||||||
|
ExportScript.Tools.FlushData()
|
||||||
|
|
||||||
|
ExportScript.UDPsender:close()
|
||||||
|
if ExportScript.Config.DACListener then
|
||||||
|
ExportScript.UDPListener:close()
|
||||||
|
end
|
||||||
|
|
||||||
|
ExportScript.ModuleName = nil
|
||||||
|
ExportScript.FoundNoModul = false
|
||||||
|
|
||||||
|
if ExportScript.logFile then
|
||||||
|
ExportScript.Tools.WriteToLog("====== Logfile close ======")
|
||||||
|
ExportScript.logFile:flush()
|
||||||
|
ExportScript.logFile:close()
|
||||||
|
ExportScript.logFile = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function LuaExportActivityNextEvent(t)
|
||||||
|
t = t + ExportScript.Config.ExportInterval
|
||||||
|
local coStatus
|
||||||
|
|
||||||
|
ExportScript.TickCount = ExportScript.TickCount + 1
|
||||||
|
|
||||||
|
local lMyInfo = LoGetSelfData()
|
||||||
|
if lMyInfo ~= nil then
|
||||||
|
if ExportScript.ModuleName ~= lMyInfo.Name then
|
||||||
|
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||||
|
end
|
||||||
|
lMyInfo = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local lDevice = GetDevice(0)
|
||||||
|
if type(lDevice) == "table" and ExportScript.FoundDCSModule then
|
||||||
|
|
||||||
|
lDevice:update_arguments()
|
||||||
|
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.ProcessArguments(lDevice, ExportScript.EveryFrameArguments) -- Module arguments as appropriate
|
||||||
|
else
|
||||||
|
ExportScript.coProcessArguments_EveryFrame = coroutine.create(ExportScript.Tools.ProcessArguments)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessArguments_EveryFrame, lDevice, ExportScript.EveryFrameArguments)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessIkarusDCSHighImportance(lDevice) -- Module, as appropriate; determined in ExportScript.Tools.SelectModule()
|
||||||
|
else
|
||||||
|
ExportScript.coProcessIkarusDCSHighImportance = coroutine.create(ExportScript.ProcessIkarusDCSHighImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessIkarusDCSHighImportance, lDevice)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessDACHighImportance(lDevice) -- Module, as appropriate; determined in ExportScript.Tools.SelectModule()
|
||||||
|
else
|
||||||
|
ExportScript.coProcessDACHighImportance = coroutine.create(ExportScript.ProcessDACHighImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessDACHighImportance, lDevice)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.FirstNewDataSend and ExportScript.FirstNewDataSendCount == 0 then
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
ExportScript.Tools.ResetChangeValuesDAC()
|
||||||
|
end
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
ExportScript.Tools.ResetChangeValues()
|
||||||
|
end
|
||||||
|
ExportScript.FirstNewDataSend = false
|
||||||
|
else
|
||||||
|
ExportScript.FirstNewDataSendCount = ExportScript.FirstNewDataSendCount - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.TickCount >= ExportScript.Config.ExportLowTickInterval then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.ProcessArguments(lDevice, ExportScript.Arguments) -- Module arguments as appropriate
|
||||||
|
else
|
||||||
|
ExportScript.coProcessArguments_Arguments = coroutine.create(ExportScript.Tools.ProcessArguments)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessArguments_Arguments, lDevice, ExportScript.Arguments)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessIkarusDCSLowImportance(lDevice) -- Module as appropriate; determined in ExportScript.Tools.SelectModule()
|
||||||
|
else
|
||||||
|
ExportScript.coProcessIkarusDCSLowImportance = coroutine.create(ExportScript.ProcessIkarusDCSLowImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessIkarusDCSLowImportance, lDevice)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessDACLowImportance(lDevice) -- Module, as appropriate; determined in ExportScript.Tools.SelectModule()
|
||||||
|
else
|
||||||
|
ExportScript.coProcessDACLowImportance = coroutine.create(ExportScript.ProcessDACLowImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessDACLowImportance, lDevice)
|
||||||
|
end
|
||||||
|
ExportScript.TickCountDAC = ExportScript.TickCountDAC + 1
|
||||||
|
end
|
||||||
|
ExportScript.TickCount = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
ExportScript.Tools.FlushData()
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
for i=1, #ExportScript.Config.DAC, 1 do
|
||||||
|
ExportScript.Tools.FlushDataDAC(i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif ExportScript.FoundFCModule then -- Assume FC Aircraft
|
||||||
|
|
||||||
|
ExportScript.AF.EventNumber = os.clock() --tonumber(tostring(os.clock()):gsub(".", ""))
|
||||||
|
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessIkarusFCHighImportance()
|
||||||
|
else
|
||||||
|
ExportScript.coProcessGlassCockpitFCHighImportance = coroutine.create(ExportScript.ProcessIkarusFCHighImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessGlassCockpitFCHighImportance)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessDACHighImportance(lDevice)
|
||||||
|
else
|
||||||
|
ExportScript.coProcessDACHighImportance = coroutine.create(ExportScript.ProcessDACHighImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessDACHighImportance, lDevice)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.FirstNewDataSend and ExportScript.FirstNewDataSendCount == 0 then
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
ExportScript.Tools.ResetChangeValuesDAC()
|
||||||
|
end
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
ExportScript.Tools.ResetChangeValues()
|
||||||
|
end
|
||||||
|
ExportScript.FirstNewDataSend = false
|
||||||
|
else
|
||||||
|
ExportScript.FirstNewDataSendCount = ExportScript.FirstNewDataSendCount - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.TickCount >= ExportScript.Config.ExportLowTickInterval then
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessIkarusFCLowImportance()
|
||||||
|
else
|
||||||
|
ExportScript.coProcessIkarusFCLowImportance = coroutine.create(ExportScript.ProcessIkarusFCLowImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessIkarusFCLowImportance)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.ProcessDACLowImportance(lDevice)
|
||||||
|
else
|
||||||
|
ExportScript.coProcessDACLowImportance = coroutine.create(ExportScript.ProcessDACLowImportance)
|
||||||
|
coStatus = coroutine.resume( ExportScript.coProcessDACLowImportance, lDevice)
|
||||||
|
end
|
||||||
|
ExportScript.TickCountDAC = ExportScript.TickCountDAC + 1
|
||||||
|
end
|
||||||
|
ExportScript.TickCount = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
ExportScript.Tools.FlushData()
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
for i=1, #ExportScript.Config.DAC, 1 do
|
||||||
|
ExportScript.Tools.FlushDataDAC(i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else -- No Module found
|
||||||
|
if ExportScript.FoundNoModul then
|
||||||
|
ExportScript.Tools.WriteToLog("No Module Found.")
|
||||||
|
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return t
|
||||||
|
end
|
||||||
@ -1,17 +1,17 @@
|
|||||||
-- A-10A Export
|
-- A-10A Export
|
||||||
-- Version 0.9.9 BETA
|
-- Version 0.9.9 BETA
|
||||||
|
|
||||||
gES_FoundFCModule = true
|
ExportScript.FoundFCModule = true
|
||||||
|
|
||||||
-- auxiliary function
|
-- auxiliary function
|
||||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
-- FLAMING CLIFFS AIRCRAFT / A-10A --
|
-- FLAMING CLIFFS AIRCRAFT / A-10A --
|
||||||
-- FC aircraft don't support GetDevice --
|
-- FC aircraft don't support GetDevice --
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||||
|
|
||||||
local myData = LoGetSelfData()
|
local myData = LoGetSelfData()
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ function ProcessGlassCockpitFCHighImportanceConfig()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACHighImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
local lPayloadInfo = LoGetPayloadInfo()
|
local lPayloadInfo = LoGetPayloadInfo()
|
||||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||||
@ -424,7 +424,7 @@ function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
|||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ function ProcessGlassCockpitFCLowImportanceConfig()
|
|||||||
-- Fuel Indicator end
|
-- Fuel Indicator end
|
||||||
|
|
||||||
-- Weapon Panel
|
-- Weapon Panel
|
||||||
gES_PayloadInfo = LoGetPayloadInfo()
|
ExportScript.AF.PayloadInfo = LoGetPayloadInfo()
|
||||||
--[[
|
--[[
|
||||||
ShellsCounter
|
ShellsCounter
|
||||||
Station1
|
Station1
|
||||||
@ -511,31 +511,31 @@ function ProcessGlassCockpitFCLowImportanceConfig()
|
|||||||
1 2 3 4 5 6 7 8 9 10 11
|
1 2 3 4 5 6 7 8 9 10 11
|
||||||
1 3 5 7 9 11 10 8 6 4 2 -- Weapon Station ID
|
1 3 5 7 9 11 10 8 6 4 2 -- Weapon Station ID
|
||||||
]]
|
]]
|
||||||
gES_TmpWeaponPanelActive = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
|
ExportScript.AF.TmpWeaponPanelActive = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
|
||||||
|
|
||||||
for lIndex = 1, 11, 1 do
|
for lIndex = 1, 11, 1 do
|
||||||
gES_TmpWeaponPanelActive[lIndex] = (gES_PayloadInfo.Stations[lIndex].count > 0 and 0.2 or 0.1) -- get status, empty or load
|
ExportScript.AF.TmpWeaponPanelActive[lIndex] = (ExportScript.AF.PayloadInfo.Stations[lIndex].count > 0 and 0.2 or 0.1) -- get status, empty or load
|
||||||
end
|
end
|
||||||
|
|
||||||
if gES_PayloadInfo.CurrentStation > 0 then
|
if ExportScript.AF.PayloadInfo.CurrentStation > 0 then
|
||||||
gES_TmpWeaponPanelActive[gES_PayloadInfo.CurrentStation] = 0.3 -- currrent value
|
ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.PayloadInfo.CurrentStation] = 0.3 -- currrent value
|
||||||
|
|
||||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A) -- corresponding station
|
table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A) -- corresponding station
|
||||||
end
|
end
|
||||||
|
|
||||||
SendData(26, string.format("%d;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f",
|
SendData(26, string.format("%d;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f",
|
||||||
gES_PayloadInfo.Cannon.shells,
|
ExportScript.AF.PayloadInfo.Cannon.shells,
|
||||||
gES_TmpWeaponPanelActive[1],
|
ExportScript.AF.TmpWeaponPanelActive[1],
|
||||||
gES_TmpWeaponPanelActive[3],
|
ExportScript.AF.TmpWeaponPanelActive[3],
|
||||||
gES_TmpWeaponPanelActive[5],
|
ExportScript.AF.TmpWeaponPanelActive[5],
|
||||||
gES_TmpWeaponPanelActive[7],
|
ExportScript.AF.TmpWeaponPanelActive[7],
|
||||||
gES_TmpWeaponPanelActive[9],
|
ExportScript.AF.TmpWeaponPanelActive[9],
|
||||||
gES_TmpWeaponPanelActive[11],
|
ExportScript.AF.TmpWeaponPanelActive[11],
|
||||||
gES_TmpWeaponPanelActive[10],
|
ExportScript.AF.TmpWeaponPanelActive[10],
|
||||||
gES_TmpWeaponPanelActive[8],
|
ExportScript.AF.TmpWeaponPanelActive[8],
|
||||||
gES_TmpWeaponPanelActive[6],
|
ExportScript.AF.TmpWeaponPanelActive[6],
|
||||||
gES_TmpWeaponPanelActive[4],
|
ExportScript.AF.TmpWeaponPanelActive[4],
|
||||||
gES_TmpWeaponPanelActive[2]))
|
ExportScript.AF.TmpWeaponPanelActive[2]))
|
||||||
-- Wepaon Panel end
|
-- Wepaon Panel end
|
||||||
|
|
||||||
-- UHF Gauges, no value
|
-- UHF Gauges, no value
|
||||||
@ -543,23 +543,23 @@ function ProcessGlassCockpitFCLowImportanceConfig()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessDACLowImportance(mainPanelDevice)
|
||||||
-- where necessary, specify HardwareID, example SightingSystem(2)
|
-- where necessary, specify HardwareID, example SightingSystem(2)
|
||||||
SightingSystem()
|
ExportScript.AF.SightingSystem()
|
||||||
FuelQuantityIndicator()
|
ExportScript.AF.FuelQuantityIndicator()
|
||||||
StatusLamp()
|
ExportScript.AF.StatusLamp()
|
||||||
MechanicalDevicesIndicator()
|
ExportScript.AF.MechanicalDevicesIndicator()
|
||||||
FlareChaff()
|
ExportScript.AF.FlareChaff()
|
||||||
WeaponStatusPanel()
|
ExportScript.AF.WeaponStatusPanel()
|
||||||
RWRStatusPanel()
|
ExportScript.AF.RWRStatusPanel()
|
||||||
AOAIndicator()
|
ExportScript.AF.AOAIndicator()
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
-- Custom functions --
|
-- Custom functions --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function SightingSystem(hardware)
|
function ExportScript.AF.SightingSystem(hardware)
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||||
if lSightingSystemInfo == nil then
|
if lSightingSystemInfo == nil then
|
||||||
@ -609,7 +609,7 @@ function SightingSystem(hardware)
|
|||||||
--SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
--SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||||
end
|
end
|
||||||
|
|
||||||
function FuelQuantityIndicator(hardware)
|
function ExportScript.AF.FuelQuantityIndicator(hardware)
|
||||||
-- Fuel quantity shows the fuel remaining in all tanks
|
-- Fuel quantity shows the fuel remaining in all tanks
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lEngineInfo = LoGetEngineInfo()
|
local lEngineInfo = LoGetEngineInfo()
|
||||||
@ -659,7 +659,7 @@ function FuelQuantityIndicator(hardware)
|
|||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function StatusLamp(hardware)
|
function ExportScript.AF.StatusLamp(hardware)
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||||
if lMCPState == nil then
|
if lMCPState == nil then
|
||||||
@ -734,7 +734,7 @@ function StatusLamp(hardware)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function FlareChaff(hardware)
|
function ExportScript.AF.FlareChaff(hardware)
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||||
if lSnares == nil then
|
if lSnares == nil then
|
||||||
@ -749,7 +749,7 @@ function FlareChaff(hardware)
|
|||||||
SendDataHW("801", lSnares.flare, lHardware )
|
SendDataHW("801", lSnares.flare, lHardware )
|
||||||
end
|
end
|
||||||
|
|
||||||
function MechanicalDevicesIndicator(hardware)
|
function ExportScript.AF.MechanicalDevicesIndicator(hardware)
|
||||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||||
@ -855,7 +855,7 @@ function MechanicalDevicesIndicator(hardware)
|
|||||||
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("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
|
||||||
end
|
end
|
||||||
|
|
||||||
function RWRStatusPanel(hardware)
|
function ExportScript.AF.RWRStatusPanel(hardware)
|
||||||
-- RWR Status Panel only
|
-- RWR Status Panel only
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lTWSInfo = LoGetTWSInfo()
|
local lTWSInfo = LoGetTWSInfo()
|
||||||
@ -920,7 +920,7 @@ function RWRStatusPanel(hardware)
|
|||||||
SendDataHW("444", (lScanTmp and 1 or 0), lHardware )
|
SendDataHW("444", (lScanTmp and 1 or 0), lHardware )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AOAIndicator(hardware)
|
function ExportScript.AF.AOAIndicator(hardware)
|
||||||
-- AOA Indicator only
|
-- AOA Indicator only
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
local lAoA = LoGetAngleOfAttack()
|
local lAoA = LoGetAngleOfAttack()
|
||||||
@ -946,14 +946,14 @@ function AOAIndicator(hardware)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeaponStatusPanel(hardware)
|
function ExportScript.AF.WeaponStatusPanel(hardware)
|
||||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
gES_PayloadInfo = LoGetPayloadInfo()
|
ExportScript.AF.PayloadInfo = LoGetPayloadInfo()
|
||||||
if gES_PayloadInfo == nil then
|
if ExportScript.AF.PayloadInfo == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
--WriteToLog('ExportScript.AF.PayloadInfo: '..dump(ExportScript.AF.PayloadInfo))
|
||||||
--[[ exsample
|
--[[ exsample
|
||||||
[Stations] = {
|
[Stations] = {
|
||||||
[1] = {
|
[1] = {
|
||||||
@ -1177,44 +1177,44 @@ function WeaponStatusPanel(hardware)
|
|||||||
]]
|
]]
|
||||||
-- Payload Info
|
-- Payload Info
|
||||||
-- weapon stations (panel) 1 (left) - 11 (right) reserved
|
-- weapon stations (panel) 1 (left) - 11 (right) reserved
|
||||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
|
SendDataHW("100", ExportScript.AF.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("101", (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||||
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
SendDataHW("102", (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||||
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
SendDataHW("103", (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||||
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
SendDataHW("104", (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||||
SendDataHW("105", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
SendDataHW("105", (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||||
SendDataHW("106", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station)
|
SendDataHW("106", (ExportScript.AF.PayloadInfo.Stations[11].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station)
|
||||||
SendDataHW("107", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
SendDataHW("107", (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
||||||
SendDataHW("108", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
SendDataHW("108", (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
||||||
SendDataHW("109", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
SendDataHW("109", (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
||||||
SendDataHW("110", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
SendDataHW("110", (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
||||||
SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11)
|
SendDataHW("111", (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11)
|
||||||
-- weapon stations (panel) 1 (left) - 11 (right) empty
|
-- weapon stations (panel) 1 (left) - 11 (right) empty
|
||||||
SendDataHW("121", (gES_PayloadInfo.Stations[1].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
SendDataHW("121", (ExportScript.AF.PayloadInfo.Stations[1].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||||
SendDataHW("122", (gES_PayloadInfo.Stations[3].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
SendDataHW("122", (ExportScript.AF.PayloadInfo.Stations[3].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||||
SendDataHW("123", (gES_PayloadInfo.Stations[5].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
SendDataHW("123", (ExportScript.AF.PayloadInfo.Stations[5].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||||
SendDataHW("124", (gES_PayloadInfo.Stations[7].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
SendDataHW("124", (ExportScript.AF.PayloadInfo.Stations[7].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||||
SendDataHW("125", (gES_PayloadInfo.Stations[9].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
SendDataHW("125", (ExportScript.AF.PayloadInfo.Stations[9].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||||
SendDataHW("126", (gES_PayloadInfo.Stations[11].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station)
|
SendDataHW("126", (ExportScript.AF.PayloadInfo.Stations[11].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station)
|
||||||
SendDataHW("127", (gES_PayloadInfo.Stations[10].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
SendDataHW("127", (ExportScript.AF.PayloadInfo.Stations[10].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
||||||
SendDataHW("128", (gES_PayloadInfo.Stations[8].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
SendDataHW("128", (ExportScript.AF.PayloadInfo.Stations[8].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
||||||
SendDataHW("129", (gES_PayloadInfo.Stations[6].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
SendDataHW("129", (ExportScript.AF.PayloadInfo.Stations[6].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
||||||
SendDataHW("130", (gES_PayloadInfo.Stations[4].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
SendDataHW("130", (ExportScript.AF.PayloadInfo.Stations[4].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
||||||
SendDataHW("131", (gES_PayloadInfo.Stations[2].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11)
|
SendDataHW("131", (ExportScript.AF.PayloadInfo.Stations[2].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11)
|
||||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
|
--SendDataHW("CurrentStation", ExportScript.AF.PayloadInfo.CurrentStation, lHardware )
|
||||||
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
|
-- 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
|
-- 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
|
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
|
||||||
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
|
-- Waffenbezeichnung als UUID, ExportScript.AF.PayloadInfo.Stations[X].CLSID
|
||||||
|
|
||||||
-- defination
|
-- defination
|
||||||
if gES_CurrentStationTmp == nil then
|
if ExportScript.AF.CurrentStationTmp == nil then
|
||||||
gES_CurrentStationTmp = -1
|
ExportScript.AF.CurrentStationTmp = -1
|
||||||
end
|
end
|
||||||
|
|
||||||
if gES_PayloadInfo.CurrentStation > 0 and
|
if ExportScript.AF.PayloadInfo.CurrentStation > 0 and
|
||||||
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
|
ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then
|
||||||
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
|
ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation
|
||||||
|
|
||||||
gTmpStationToPanel = {}
|
gTmpStationToPanel = {}
|
||||||
gTmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, CurrentID2 = 221, HardwareID = lHardware } -- left
|
gTmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, CurrentID2 = 221, HardwareID = lHardware } -- left
|
||||||
@ -1232,30 +1232,30 @@ function WeaponStatusPanel(hardware)
|
|||||||
WeaponStatusPanel_Reset(201, 211, lHardware)
|
WeaponStatusPanel_Reset(201, 211, lHardware)
|
||||||
WeaponStatusPanel_Reset(221, 231, lHardware)
|
WeaponStatusPanel_Reset(221, 231, lHardware)
|
||||||
|
|
||||||
SendDataHW(gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl
|
SendDataHW(gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl
|
||||||
--WriteToLog('aktiv: '..gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID)
|
--WriteToLog('aktiv: '..gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID)
|
||||||
if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].container then
|
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].container then
|
||||||
if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].count > 1 then
|
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].count > 1 then
|
||||||
SendDataHW(gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID2, 1, lHardware) -- eigentliche Auswahl
|
SendDataHW(gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID2, 1, lHardware) -- eigentliche Auswahl
|
||||||
--WriteToLog('aktiv2: '..gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID2)
|
--WriteToLog('aktiv2: '..gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||||
elseif gES_PayloadInfo.CurrentStation == 0 and gES_CurrentStationTmp > 0 then
|
elseif ExportScript.AF.PayloadInfo.CurrentStation == 0 and ExportScript.AF.CurrentStationTmp > 0 then
|
||||||
WeaponStatusPanel_Reset(201, 211, lHardware)
|
WeaponStatusPanel_Reset(201, 211, lHardware)
|
||||||
WeaponStatusPanel_Reset(221, 231, lHardware)
|
WeaponStatusPanel_Reset(221, 231, lHardware)
|
||||||
gES_CurrentStationTmp = -1
|
ExportScript.AF.CurrentStationTmp = -1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Helper functions
|
-- Helper functions
|
||||||
|
|
||||||
function WeaponStatusPanel_selectCurrentPayloadStation(_index)
|
function WeaponStatusPanel_selectCurrentPayloadStation(_index)
|
||||||
if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].CLSID == gES_PayloadInfo.Stations[_index].CLSID and gES_PayloadInfo.CurrentStation ~= _index then
|
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].CLSID == ExportScript.AF.PayloadInfo.Stations[_index].CLSID and ExportScript.AF.PayloadInfo.CurrentStation ~= _index then
|
||||||
SendDataHW(gTmpStationToPanel[_index].CurrentID, 1, gTmpStationToPanel[_index].HardwareID)
|
SendDataHW(gTmpStationToPanel[_index].CurrentID, 1, gTmpStationToPanel[_index].HardwareID)
|
||||||
--WriteToLog('aktiv3: '..gTmpStationToPanel[_index].CurrentID)
|
--WriteToLog('aktiv3: '..gTmpStationToPanel[_index].CurrentID)
|
||||||
if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].container then
|
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].container then
|
||||||
if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].count > 1 then
|
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].count > 1 then
|
||||||
SendDataHW(gTmpStationToPanel[_index].CurrentID2, 1, gTmpStationToPanel[_index].HardwareID)
|
SendDataHW(gTmpStationToPanel[_index].CurrentID2, 1, gTmpStationToPanel[_index].HardwareID)
|
||||||
--WriteToLog('aktiv3: '..gTmpStationToPanel[_index].CurrentID2)
|
--WriteToLog('aktiv3: '..gTmpStationToPanel[_index].CurrentID2)
|
||||||
end
|
end
|
||||||
@ -1271,7 +1271,7 @@ function WeaponStatusPanel_Reset(lMinId, lMaxID, lHardware)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A(_index)
|
function WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A(_index)
|
||||||
if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].CLSID == gES_PayloadInfo.Stations[_index].CLSID and gES_PayloadInfo.CurrentStation ~= _index then
|
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].CLSID == ExportScript.AF.PayloadInfo.Stations[_index].CLSID and ExportScript.AF.PayloadInfo.CurrentStation ~= _index then
|
||||||
gES_TmpWeaponPanelActive[_index] = 0.3
|
ExportScript.AF.TmpWeaponPanelActive[_index] = 0.3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
|||||||
-- Bf-109K-4 Kurfürst
|
-- Bf-109K-4 Kurfürst
|
||||||
-- Version 0.9.9
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
[1] = "%.4f", -- MW50 pressure {0.0, 3.0}kg/cm2 = {0.0, 1.0}
|
[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}
|
[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}
|
||||||
@ -24,7 +24,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
-- AFN2 blind landing system
|
-- AFN2 blind landing system
|
||||||
[14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0}
|
[14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0}
|
||||||
[15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0}
|
[15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0}
|
||||||
[16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0}
|
[16] = "%f", -- AFN2_Signal_Lamp {0.0, 1.0}
|
||||||
--Dual-Range Pressure Gauge
|
--Dual-Range Pressure Gauge
|
||||||
[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0}
|
[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}
|
[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0}
|
||||||
@ -40,28 +40,28 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[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}
|
[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
|
--oxygen pressure indicator
|
||||||
[34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
[34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
||||||
[35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
--[35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||||
-- Variometer
|
-- 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}
|
[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
|
--Weapon gauges
|
||||||
[40] = "%.4f", -- MG131_0_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
|
[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}
|
[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}
|
--[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}
|
--[43] = "%.4f", -- MG131_1_Klappanker {0.0, 60.0} = {0.0, 1.0}
|
||||||
[44] = "%1d", -- LeftWing_MG151_Control_Lamp {0.0, 1.0}
|
[44] = "%.f", -- LeftWing_MG151_Control_Lamp {0.0, 1.0}
|
||||||
[45] = "%1d", -- RightWing_MG151_Control_Lamp {0.0, 1.0}
|
[45] = "%.f", -- RightWing_MG151_Control_Lamp {0.0, 1.0}
|
||||||
--REVI_16B_Gunsight
|
--REVI_16B_Gunsight
|
||||||
[46] = "%4.f", -- BodyState {0.0, 0.15,0.25, 1.0} = {0.0, 0.15,0.25, 1.0}
|
[46] = "%4.f", -- BodyState {0.0, 0.15,0.25, 1.0} = {0.0, 0.15,0.25, 1.0}
|
||||||
[47] = "%4.f", -- SmokedScreen {0.0, 1.0}
|
[47] = "%4.f", -- SmokedScreen {0.0, 1.0}
|
||||||
[48] = "%4.f", -- SightBrightness {0.0, 1.0}
|
[48] = "%4.f", -- SightBrightness {0.0, 1.0}
|
||||||
-- Landing Gear Light
|
-- Landing Gear Light
|
||||||
[56] = "%1d", -- LandingGearRedLight {0.0, 1.0}
|
[56] = "%.f", -- LandingGearRedLight {0.0, 1.0}
|
||||||
[57] = "%1d", -- LandingGearGreenLightLeft {0.0, 1.0}
|
[57] = "%.f", -- LandingGearGreenLightLeft {0.0, 1.0}
|
||||||
[58] = "%1d", -- LandingGearGreenLightRight {0.0, 1.0}
|
[58] = "%.f", -- LandingGearGreenLightRight {0.0, 1.0}
|
||||||
-- Fuel_Reserve_Lamp
|
-- Fuel_Reserve_Lamp
|
||||||
[135] = "%1d" -- Fuel_Reserve_Lamp {0.0, 29.0} = {0.0, 1.0}
|
[135] = "%.f" -- Fuel_Reserve_Lamp {0.0, 29.0} = {0.0, 1.0}
|
||||||
}
|
}
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
-- FuseBox Controls - Electrical Switches
|
-- FuseBox Controls - Electrical Switches
|
||||||
-- RH Fuse Box Circuit Breakers
|
-- RH Fuse Box Circuit Breakers
|
||||||
@ -234,119 +234,24 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
if gES_GlassCockpitType == 1 then
|
ExportScript.Tools.SendData(35, string.format("%0.4f", mainPanelDevice:get_argument_value(35))) -- Oxygen_Flow_Blinker
|
||||||
-- HELIOS Version 1.3
|
ExportScript.Tools.SendData(42, string.format("%0.4f", mainPanelDevice:get_argument_value(42))) -- MG131_0_Klappanker
|
||||||
elseif gES_GlassCockpitType == 2 then
|
ExportScript.Tools.SendData(43, string.format("%0.4f", mainPanelDevice:get_argument_value(43))) -- MG131_1_Klappanker
|
||||||
-- 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
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll
|
-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll
|
||||||
-- In der Regel sind das die Statusanzeigen
|
-- In der Regel sind das die Statusanzeigen
|
||||||
|
|
||||||
-- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware
|
-- ExportScript.Tools.SendDataDAC(), 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
|
-- "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
|
-- 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
|
-- 178 ist die DCS ID von dem man die Werte haben will
|
||||||
-- Description
|
-- Description
|
||||||
--SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE
|
--ExportScript.Tools.SendDataDAC("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE
|
||||||
--SendDataHW("", mainPanelDevice:get_argument_value()) --
|
--ExportScript.Tools.SendDataDAC("", 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
|
end
|
||||||
|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
@ -354,44 +259,49 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
every frame export to hardware
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local lRADIO = GetDevice(14)
|
local lRADIO = GetDevice(14)
|
||||||
SendDataHW("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000))
|
||||||
|
|
||||||
|
-- Lamps
|
||||||
|
ExportScript.Tools.SendDataDAC("35", mainPanelDevice:get_argument_value(35) > 0.8 and 1 or 0) -- Oxygen_Flow_Blinker
|
||||||
|
ExportScript.Tools.SendDataDAC("42", mainPanelDevice:get_argument_value(42) > 0.8 and 1 or 0) -- MG131_0_Klappanker
|
||||||
|
ExportScript.Tools.SendDataDAC("43", mainPanelDevice:get_argument_value(43) > 0.8 and 1 or 0) -- MG131_1_Klappanker
|
||||||
|
|
||||||
--=====================================================================================
|
--=====================================================================================
|
||||||
--[[
|
--[[
|
||||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 0, 13, 1 do
|
for ltmp2 = 0, 13, 1 do
|
||||||
ltmp1 = list_indication(ltmp2)
|
ltmp1 = list_indication(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 16, 1 do
|
for ltmp2 = 1, 16, 1 do
|
||||||
ltmp1 = GetDevice(ltmp2)
|
ltmp1 = GetDevice(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
@ -400,5 +310,5 @@ end
|
|||||||
-- Custom functions --
|
-- Custom functions --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function genericRadio(key, value, hardware)
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
end
|
end
|
||||||
117
Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua
Normal file
117
Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
-- modul name
|
||||||
|
-- Version
|
||||||
|
|
||||||
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
|
{
|
||||||
|
--[[
|
||||||
|
every frames arguments
|
||||||
|
based of "mainpanel_init.lua"
|
||||||
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
|
[DeviceID] = "Format"
|
||||||
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
|
]]
|
||||||
|
}
|
||||||
|
ExportScript.ConfigArguments =
|
||||||
|
{
|
||||||
|
--[[
|
||||||
|
arguments for export in low tick interval
|
||||||
|
based on "clickabledata.lua"
|
||||||
|
]]
|
||||||
|
}
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- HIGH IMPORTANCE EXPORTS --
|
||||||
|
-- done every export event --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to DAC
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------------------------------
|
||||||
|
-- LOW IMPORTANCE EXPORTS --
|
||||||
|
-- done every gExportLowTickInterval export events --
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
export in low tick interval to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
export in low tick interval to DAC
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
|
||||||
|
--=====================================================================================
|
||||||
|
--[[
|
||||||
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 0, 13, 1 do
|
||||||
|
ltmp1 = list_indication(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
--[[
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 1, 73, 1 do
|
||||||
|
ltmp1 = GetDevice(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- Custom functions --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
|
end
|
||||||
@ -1,10 +1,20 @@
|
|||||||
-- F-86 Export
|
-- F-86 Export
|
||||||
-- Version 0.9.9 BETA
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
|
--[[
|
||||||
|
every frames arguments
|
||||||
|
based of "mainpanel_init.lua"
|
||||||
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
|
[DeviceID] = "Format"
|
||||||
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
|
]]
|
||||||
-- Mechanic clock
|
-- Mechanic clock
|
||||||
[19] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0} = {0.0, 1.0}
|
[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}
|
[18] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} = {0.0, 1.0}
|
||||||
@ -74,36 +84,41 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[814] = "%.4f", -- ARN6_Scale {1.0, 0.0}
|
[814] = "%.4f", -- ARN6_Scale {1.0, 0.0}
|
||||||
[830] = "%.4f", -- ARN6_FreqScale {0.0, 1.0}
|
[830] = "%.4f", -- ARN6_FreqScale {0.0, 1.0}
|
||||||
-- light system
|
-- light system
|
||||||
[182] = "%.4f", -- IlluminationLights {0.0, 1.0}
|
[182] = "%.f", -- IlluminationLights {0.0, 1.0}
|
||||||
[825] = "%.4f", -- StandByCompassLight {0.0, 1.0}
|
[825] = "%.f", -- StandByCompassLight {0.0, 1.0}
|
||||||
[180] = "%.4f", -- PrimaryInstLights {0.0, 1.0}
|
[180] = "%.f", -- PrimaryInstLights {0.0, 1.0}
|
||||||
[185] = "%.4f", -- AuxiliaryInstrumentLights {0.0, 1.0}
|
[185] = "%.f", -- AuxiliaryInstrumentLights {0.0, 1.0}
|
||||||
|
--
|
||||||
[603] = "%.4f", -- LABS_roll_needle {-1.0, 1.0}
|
[603] = "%.4f", -- LABS_roll_needle {-1.0, 1.0}
|
||||||
[604] = "%.4f", -- LABS_pitch_needle {-1.0, 1.0}
|
[604] = "%.4f", -- LABS_pitch_needle {-1.0, 1.0}
|
||||||
-- LAMPS
|
-- LAMPS
|
||||||
-- electric system
|
-- electric system
|
||||||
[617] = "%.1f", -- lamp_ELEC_GenOff {-1.0, 1.0}
|
[617] = "%.f", -- lamp_ELEC_GenOff {-1.0, 1.0}
|
||||||
[610] = "%.1f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
|
[610] = "%.f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
|
||||||
[611] = "%.1f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
|
[611] = "%.f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
|
||||||
[612] = "%.1f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
|
[612] = "%.f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
|
||||||
-- hydraulic system
|
-- hydraulic system
|
||||||
[614] = "%.1f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
|
[614] = "%.f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
|
||||||
[39] = "%.1f", -- lamp_HYDRO_LeftGear {-1.0, 1.0}
|
[39] = "%.f", -- lamp_HYDRO_LeftGear {-1.0, 1.0}
|
||||||
[41] = "%.1f", -- lamp_HYDRO_RightGear {-1.0, 1.0}
|
[41] = "%.f", -- lamp_HYDRO_RightGear {-1.0, 1.0}
|
||||||
[40] = "%.1f", -- lamp_HYDRO_NoseGear {-1.0, 1.0}
|
[40] = "%.f", -- lamp_HYDRO_NoseGear {-1.0, 1.0}
|
||||||
-- fuel system
|
-- fuel system
|
||||||
[625] = "%.1f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
|
[625] = "%.f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
|
||||||
-- fire detection system
|
-- fire detection system
|
||||||
[615] = "%.1f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
|
[615] = "%.f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
|
||||||
[616] = "%.1f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
|
[616] = "%.f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
|
||||||
-- control system
|
-- control system
|
||||||
[613] = "%.1f", -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
|
[613] = "%.f", -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
|
||||||
-- air system
|
-- air system
|
||||||
[614] = "%.1f" -- lamp_WindshieldAntiIceOverheatWarning {-1.0, 1.0}
|
[614] = "%.f" -- lamp_WindshieldAntiIceOverheatWarning {-1.0, 1.0}
|
||||||
}
|
}
|
||||||
|
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
|
--[[
|
||||||
|
arguments for export in low tick interval
|
||||||
|
based on "clickabledata.lua"
|
||||||
|
]]
|
||||||
-- cockpit mechanics
|
-- cockpit mechanics
|
||||||
[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0}
|
[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0}
|
||||||
[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0}
|
[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0}
|
||||||
@ -280,109 +295,31 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
if gES_GlassCockpitType == 1 then
|
--[[
|
||||||
-- HELIOS Version 1.3
|
every frame export to Ikarus
|
||||||
elseif gES_GlassCockpitType == 2 then
|
Example from A-10C
|
||||||
-- HawgTouch version 1.6
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
-- ACC
|
local lUHFRadio = GetDevice(54)
|
||||||
-- Accelerometer; AccelerometerMin; AccelerometerMax;
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
SendData(2001, string.format("%0.4f;%0.4f;%0.4f",
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
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
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll
|
--[[
|
||||||
-- In der Regel sind das die Statusanzeigen
|
every frame export to DAC
|
||||||
|
Example from A-10C
|
||||||
-- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware
|
Get Radio Frequencies
|
||||||
-- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen
|
get data from device
|
||||||
-- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der <20>bergeben DCS ID aus dem Spiel ausliest
|
local UHF_RADIO = GetDevice(54)
|
||||||
-- 178 ist die DCS ID von dem man die Werte haben will
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
-- Description
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
-- light system
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
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
|
end
|
||||||
|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
@ -390,46 +327,50 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
if gES_GlassCockpitType == 1 then
|
--[[
|
||||||
-- HELIOS Version 1.3
|
export in low tick interval to Ikarus
|
||||||
elseif gES_GlassCockpitType == 2 then
|
Example from A-10C
|
||||||
-- HawgTouch version 1.6
|
Get Radio Frequencies
|
||||||
end
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
export in low tick interval to DAC
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--=====================================================================================
|
--=====================================================================================
|
||||||
--[[
|
--[[
|
||||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 0, 13, 1 do
|
for ltmp2 = 0, 13, 1 do
|
||||||
ltmp1 = list_indication(ltmp2)
|
ltmp1 = list_indication(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 73, 1 do
|
for ltmp2 = 1, 73, 1 do
|
||||||
ltmp1 = GetDevice(ltmp2)
|
ltmp1 = GetDevice(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
@ -438,6 +379,6 @@ end
|
|||||||
-- Custom functions --
|
-- Custom functions --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function genericRadio(key, value, hardware)
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
end
|
end
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,20 @@
|
|||||||
-- FW-190D9 Dora
|
-- FW-190D9 Dora
|
||||||
-- Version 0.9.9
|
-- Version 1.0.0
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
|
--[[
|
||||||
|
every frames arguments
|
||||||
|
based of "mainpanel_init.lua"
|
||||||
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
|
[DeviceID] = "Format"
|
||||||
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
|
]]
|
||||||
-- Flight Instruments
|
-- 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}
|
[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}
|
[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}
|
||||||
@ -24,7 +34,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[41] = "%.4f", -- Slipball {-1.0, 1.0}
|
[41] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||||
--oxygen pressure indicator
|
--oxygen pressure indicator
|
||||||
[112] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
[112] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
||||||
[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
--[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||||
--Remote compass
|
--Remote compass
|
||||||
[45] = "%.4f", -- CompassHeading {0.0, 1.0}
|
[45] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||||||
[44] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
[44] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||||||
@ -53,30 +63,34 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[58] = "%.4f", -- Ammo_Counter_3 {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}
|
[61] = "%.4f", -- Ammo_Counter_4 {0.0, 500.0} = {0.0, 1.0}
|
||||||
-- Gun_Fire
|
-- Gun_Fire
|
||||||
[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
--[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
||||||
[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
--[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
||||||
[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
--[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
||||||
[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
--[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
||||||
--Target System
|
--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}
|
[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
|
--Bomb Lamps
|
||||||
[196] = "%1d", -- BombLamp_1 {0.0, 1.0}
|
[196] = "%.f", -- BombLamp_1 {0.0, 1.0}
|
||||||
[197] = "%1d", -- BombLamp_2 {0.0, 1.0}
|
[197] = "%.f", -- BombLamp_2 {0.0, 1.0}
|
||||||
[198] = "%1d", -- BombLamp_3 {0.0, 1.0}
|
[198] = "%.f", -- BombLamp_3 {0.0, 1.0}
|
||||||
[199] = "%1d", -- BombLamp_4 {0.0, 1.0}
|
[199] = "%.f", -- BombLamp_4 {0.0, 1.0}
|
||||||
[137] = "%1d", -- RocketEmCvr {0.0, 1.0}
|
[137] = "%.f", -- RocketEmCvr {0.0, 1.0}
|
||||||
--Gear Lamps
|
--Gear Lamps
|
||||||
[68] = "%1d", -- L_GEAR_UP {0.0, 1.0}
|
[68] = "%.f", -- L_GEAR_UP {0.0, 1.0}
|
||||||
[69] = "%1d", -- L_GEAR_DOWN {0.0, 1.0}
|
[69] = "%.f", -- L_GEAR_DOWN {0.0, 1.0}
|
||||||
[70] = "%1d", -- R_GEAR_UP {0.0, 1.0}
|
[70] = "%.f", -- R_GEAR_UP {0.0, 1.0}
|
||||||
[71] = "%1d", -- R_GEAR_DOWN {0.0, 1.0}
|
[71] = "%.f", -- R_GEAR_DOWN {0.0, 1.0}
|
||||||
--Flaps Lamps
|
--Flaps Lamps
|
||||||
[72] = "%1d", -- FLAPS_UP {0.0, 1.0}
|
[72] = "%.f", -- FLAPS_UP {0.0, 1.0}
|
||||||
[73] = "%1d", -- FLAPS_START {0.0, 1.0}
|
[73] = "%.f", -- FLAPS_START {0.0, 1.0}
|
||||||
[74] = "%1d" -- FLAPS_DOWN {0.0, 1.0}
|
[74] = "%1d" -- FLAPS_DOWN {0.0, 1.0}
|
||||||
}
|
}
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
|
--[[
|
||||||
|
arguments for export in low tick interval
|
||||||
|
based on "clickabledata.lua"
|
||||||
|
]]
|
||||||
[159] = "%.2f", -- Radiator Flaps Control (axis) 1.0 in 0.4 steps
|
[159] = "%.2f", -- Radiator Flaps Control (axis) 1.0 in 0.4 steps
|
||||||
[160] = "%1d", -- Cold Start/Wind Screen Washer {0, 1}
|
[160] = "%1d", -- Cold Start/Wind Screen Washer {0, 1}
|
||||||
--Engine Control Panel
|
--Engine Control Panel
|
||||||
@ -184,88 +198,46 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
if gES_GlassCockpitType == 1 then
|
--[[
|
||||||
-- HELIOS Version 1.3
|
every frame export to Ikarus
|
||||||
elseif gES_GlassCockpitType == 2 then
|
Example from A-10C
|
||||||
-- HawgTouch Version 1.6
|
Get Radio Frequencies
|
||||||
-- Altimeter_km, Altimeter_m, Altimeter_Pressure
|
get data from device
|
||||||
SendData("2000", string.format("%0.3f;%0.3f;%0.3f",
|
local lUHFRadio = GetDevice(54)
|
||||||
mainPanelDevice:get_argument_value(35),
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
mainPanelDevice:get_argument_value(32),
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
mainPanelDevice:get_argument_value(33)))
|
]]
|
||||||
|
--[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
||||||
-- LwAtt - AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball
|
--[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
||||||
SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f",
|
--[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
||||||
mainPanelDevice:get_argument_value(38),
|
--[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
||||||
mainPanelDevice:get_argument_value(37),
|
--[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||||
mainPanelDevice:get_argument_value(40),
|
ExportScript.Tools.SendData(50, string.format("%.4f", mainPanelDevice:get_argument_value(50))) -- Gun_Fire_1 {0.0, 1.0}
|
||||||
mainPanelDevice:get_argument_value(41)))
|
ExportScript.Tools.SendData(164, string.format("%.4f", mainPanelDevice:get_argument_value(164))) -- Gun_Fire_2 {0.0, 1.0}
|
||||||
|
ExportScript.Tools.SendData(165, string.format("%.4f", mainPanelDevice:get_argument_value(165))) -- Gun_Fire_3 {0.0, 1.0}
|
||||||
-- LwHead - CompassHeading, CommandedCourse liefert nur 0.000
|
ExportScript.Tools.SendData(166, string.format("%.4f", mainPanelDevice:get_argument_value(166))) -- Gun_Fire_4 {0.0, 1.0}
|
||||||
SendData("2002", string.format("%0.3f;%0.3f",
|
ExportScript.Tools.SendData(113, string.format("%.4f", mainPanelDevice:get_argument_value(113))) -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||||
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
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll
|
--[[
|
||||||
-- In der Regel sind das die Statusanzeigen
|
every frame export to DAC
|
||||||
|
Example from A-10C
|
||||||
-- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware
|
Get Radio Frequencies
|
||||||
-- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen
|
get data from device
|
||||||
-- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der <20>bergeben DCS ID aus dem Spiel ausliest
|
local UHF_RADIO = GetDevice(54)
|
||||||
-- 178 ist die DCS ID von dem man die Werte haben will
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
-- Description
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
-- SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
-- SendDataHW("", mainPanelDevice:get_argument_value()) --
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
ExportScript.Tools.SendData(50, mainPanelDevice:get_argument_value(50) > 0.3 and 1 or 0) -- Gun_Fire_1 {0.0, 1.0}
|
||||||
|
ExportScript.Tools.SendData(164, mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Gun_Fire_2 {0.0, 1.0}
|
||||||
|
ExportScript.Tools.SendData(165, mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Gun_Fire_3 {0.0, 1.0}
|
||||||
|
ExportScript.Tools.SendData(166, mainPanelDevice:get_argument_value(166) > 0.3 and 1 or 0) -- Gun_Fire_4 {0.0, 1.0}
|
||||||
|
ExportScript.Tools.SendData(113, mainPanelDevice:get_argument_value(113) > 0.3 and 1 or 0) -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
@ -273,41 +245,50 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
export in low tick interval to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
export in low tick interval to DAC
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--=====================================================================================
|
--=====================================================================================
|
||||||
--[[
|
--[[
|
||||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 0, 13, 1 do
|
for ltmp2 = 0, 13, 1 do
|
||||||
ltmp1 = list_indication(ltmp2)
|
ltmp1 = list_indication(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 73, 1 do
|
for ltmp2 = 1, 73, 1 do
|
||||||
ltmp1 = GetDevice(ltmp2)
|
ltmp1 = GetDevice(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
@ -316,5 +297,5 @@ end
|
|||||||
-- Custom functions --
|
-- Custom functions --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function genericRadio(key, value, hardware)
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
end
|
end
|
||||||
1622
Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua
Normal file
1622
Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
|||||||
-- Mi-8MTV2 Export
|
-- Mi-8MTV2 Export
|
||||||
-- Version 0.9.9 BETA
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
every frames arguments
|
every frames arguments
|
||||||
@ -13,6 +13,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
[129] = "%1d", <- decimal number
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- CONTROLLERS
|
-- CONTROLLERS
|
||||||
@ -91,7 +92,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[34] = "%.3f", -- A_036_RALT {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0}
|
[34] = "%.3f", -- A_036_RALT {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0}
|
||||||
[31] = "%.3f", -- A_036_DangerRALT_index {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0}
|
[31] = "%.3f", -- A_036_DangerRALT_index {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0}
|
||||||
[30] = "%.1f", -- A_036_DangerRALT_lamp {0.0, 1.0}
|
[30] = "%.f", -- A_036_DangerRALT_lamp {0.0, 1.0}
|
||||||
[33] = "%.1f", -- A_036_warning_flag {0.0, 1.0}
|
[33] = "%.1f", -- A_036_warning_flag {0.0, 1.0}
|
||||||
-- Engines RPM
|
-- Engines RPM
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
@ -145,10 +146,10 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[813] = "%.4f", -- diss15_coord_angle_ones {0.0, 1.0}
|
[813] = "%.4f", -- diss15_coord_angle_ones {0.0, 1.0}
|
||||||
[814] = "%.4f", -- diss15_coord_angle_minutes {0.0, 1.0}
|
[814] = "%.4f", -- diss15_coord_angle_minutes {0.0, 1.0}
|
||||||
----
|
----
|
||||||
[822] = "%.4f", -- diss15_check_control_lamp {0.0, 0.9}
|
[822] = "%.f", -- diss15_check_control_lamp {0.0, 0.9}
|
||||||
[823] = "%.4f", -- diss15_check_work_lamp {0.0, 0.9}
|
[823] = "%.f", -- diss15_check_work_lamp {0.0, 0.9}
|
||||||
[824] = "%.4f", -- diss15_check_failM_lamp {0.0, 0.9}
|
[824] = "%.f", -- diss15_check_failM_lamp {0.0, 0.9}
|
||||||
[825] = "%.4f", -- diss15_check_failC_lamp {0.0, 0.9}
|
[825] = "%.f", -- diss15_check_failC_lamp {0.0, 0.9}
|
||||||
-- Oil
|
-- Oil
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[111] = "%.4f", -- oils_p_main_reductor {0.0, 1.0}
|
[111] = "%.4f", -- oils_p_main_reductor {0.0, 1.0}
|
||||||
@ -195,15 +196,15 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
-- SPUU-52
|
-- SPUU-52
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[126] = "%.4f", -- SPUU_pointer {-1.0, 1.0}
|
[126] = "%.4f", -- SPUU_pointer {-1.0, 1.0}
|
||||||
[786] = "%.1f", -- SPUU52_lamp {0.0, 1.0}
|
[786] = "%.f", -- SPUU52_lamp {0.0, 1.0}
|
||||||
-- PU-26 LAMP
|
-- PU-26 LAMP
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[827] = "%.1f", -- PU_26_GA_Lamp {0.0, 1.0} {0.0, 0.5}
|
[827] = "%.f", -- PU_26_GA_Lamp {0.0, 1.0} {0.0, 0.5}
|
||||||
-- ARC-UD
|
-- ARC-UD
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[458] = "%.1f", -- ARC_UD_Narrow_Lamp {0.0, 0.9}
|
[458] = "%.f", -- ARC_UD_Narrow_Lamp {0.0, 0.9}
|
||||||
[459] = "%.1f", -- ARC_UD_Wide_Lamp {0.0, 0.9}
|
[459] = "%.f", -- ARC_UD_Wide_Lamp {0.0, 0.9}
|
||||||
[460] = "%.1f", -- ARC_UD_Pulse_Lamp {0.0, 0.9}
|
[460] = "%.f", -- ARC_UD_Pulse_Lamp {0.0, 0.9}
|
||||||
-- ARC-9
|
-- ARC-9
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[681] = "%.4f", -- ARC_9_Signal {0.0, 1.0}
|
[681] = "%.4f", -- ARC_9_Signal {0.0, 1.0}
|
||||||
@ -246,9 +247,9 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
--[878] = "%.1f", -- Right_Windshield {0.0, 1.0}
|
--[878] = "%.1f", -- Right_Windshield {0.0, 1.0}
|
||||||
-- Jadro 1A
|
-- Jadro 1A
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[849] = "%.1f", -- Jadro_ASU_Lamp {0.0, 1.0}
|
[849] = "%.f", -- Jadro_ASU_Lamp {0.0, 1.0}
|
||||||
[848] = "%.1f", -- Jadro_Ctl_Lamp {0.0, 1.0}
|
[848] = "%.f", -- Jadro_Ctl_Lamp {0.0, 1.0}
|
||||||
[850] = "%.1f", -- Jadro_Breakdown_Lamp {0.0, 1.0}
|
[850] = "%.f", -- Jadro_Breakdown_Lamp {0.0, 1.0}
|
||||||
----
|
----
|
||||||
[904] = "%.4f", -- RAM_Temp {-50.0, 0.0, 70.0} {-1.0, 0.0, 1.0}
|
[904] = "%.4f", -- RAM_Temp {-50.0, 0.0, 70.0} {-1.0, 0.0, 1.0}
|
||||||
----
|
----
|
||||||
@ -274,147 +275,147 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[371] = "%.2f", -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0}
|
[371] = "%.2f", -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0}
|
||||||
-- LAMPS
|
-- LAMPS
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[781] = "%.1f", -- lamp_AP_heading_on
|
[781] = "%.f", -- lamp_AP_heading_on
|
||||||
[782] = "%.1f", -- lamp_AP_heading_off
|
[782] = "%.f", -- lamp_AP_heading_off
|
||||||
[783] = "%.1f", -- lamp_AP_pitch_roll_on
|
[783] = "%.f", -- lamp_AP_pitch_roll_on
|
||||||
[784] = "%.1f", -- lamp_AP_height_on
|
[784] = "%.f", -- lamp_AP_height_on
|
||||||
[785] = "%.1f", -- lamp_AP_height_off
|
[785] = "%.f", -- lamp_AP_height_off
|
||||||
[316] = "%.1f", -- lamp_ENGINE_RT_LEFT_ON
|
[316] = "%.f", -- lamp_ENGINE_RT_LEFT_ON
|
||||||
[317] = "%.1f", -- lamp_ENGINE_RT_RIGHT_ON
|
[317] = "%.f", -- lamp_ENGINE_RT_RIGHT_ON
|
||||||
[318] = "%.1f", -- lamp_SARPP_ON
|
[318] = "%.f", -- lamp_SARPP_ON
|
||||||
[325] = "%.1f", -- lamp_Descent_Siren
|
[325] = "%.f", -- lamp_Descent_Siren
|
||||||
[326] = "%.1f", -- lamp_LOCK_OPEN
|
[326] = "%.f", -- lamp_LOCK_OPEN
|
||||||
[327] = "%.1f", -- lamp_DOORS_OPEN
|
[327] = "%.f", -- lamp_DOORS_OPEN
|
||||||
[340] = "%.1f", -- lamp_TURN_ON_RI_65
|
[340] = "%.f", -- lamp_TURN_ON_RI_65
|
||||||
[360] = "%.1f", -- lamp_FROST
|
[360] = "%.f", -- lamp_FROST
|
||||||
[362] = "%.1f", -- lamp_LEFT_ENG_HEATING
|
[362] = "%.f", -- lamp_LEFT_ENG_HEATING
|
||||||
[363] = "%.1f", -- lamp_RIGHT_ENG_HEATING
|
[363] = "%.f", -- lamp_RIGHT_ENG_HEATING
|
||||||
[361] = "%.1f", -- lamp_ANTI_ICE_ON
|
[361] = "%.f", -- lamp_ANTI_ICE_ON
|
||||||
[364] = "%.1f", -- lamp_LEFT_PZU_FRONT
|
[364] = "%.f", -- lamp_LEFT_PZU_FRONT
|
||||||
[365] = "%.1f", -- lamp_RIGHT_PZU_FRONT
|
[365] = "%.f", -- lamp_RIGHT_PZU_FRONT
|
||||||
[366] = "%.1f", -- lamp_LEFT_PZU_BACK
|
[366] = "%.f", -- lamp_LEFT_PZU_BACK
|
||||||
[367] = "%.1f", -- lamp_RIGHT_PZU_BACK
|
[367] = "%.f", -- lamp_RIGHT_PZU_BACK
|
||||||
[373] = "%.1f", -- lamp_SECTION_1
|
[373] = "%.f", -- lamp_SECTION_1
|
||||||
[375] = "%.1f", -- lamp_SECTION_2
|
[375] = "%.f", -- lamp_SECTION_2
|
||||||
[374] = "%.1f", -- lamp_SECTION_3
|
[374] = "%.f", -- lamp_SECTION_3
|
||||||
[376] = "%.1f", -- lamp_SECTION_4
|
[376] = "%.f", -- lamp_SECTION_4
|
||||||
[368] = "%.1f", -- lamp_RIO_heating_ok
|
[368] = "%.f", -- lamp_RIO_heating_ok
|
||||||
[377] = "%.1f", -- lamp_LEFT_ENG_FIRE
|
[377] = "%.f", -- lamp_LEFT_ENG_FIRE
|
||||||
[378] = "%.1f", -- lamp_RIGHT_ENG_FIRE
|
[378] = "%.f", -- lamp_RIGHT_ENG_FIRE
|
||||||
[379] = "%.1f", -- lamp_KO50_FIRE
|
[379] = "%.f", -- lamp_KO50_FIRE
|
||||||
[380] = "%.1f", -- lamp_REDUC_AI9_FIRE
|
[380] = "%.f", -- lamp_REDUC_AI9_FIRE
|
||||||
[381] = "%.1f", -- lamp_FIRE_LENG_1_QUEUE
|
[381] = "%.f", -- lamp_FIRE_LENG_1_QUEUE
|
||||||
[382] = "%.1f", -- lamp_FIRE_RENG_1_QUEUE
|
[382] = "%.f", -- lamp_FIRE_RENG_1_QUEUE
|
||||||
[383] = "%.1f", -- lamp_FIRE_KO50_1_QUEUE
|
[383] = "%.f", -- lamp_FIRE_KO50_1_QUEUE
|
||||||
[384] = "%.1f", -- lamp_FIRE_REDUCT_1_QUEUE
|
[384] = "%.f", -- lamp_FIRE_REDUCT_1_QUEUE
|
||||||
[385] = "%.1f", -- lamp_FIRE_LENG_2_QUEUE
|
[385] = "%.f", -- lamp_FIRE_LENG_2_QUEUE
|
||||||
[386] = "%.1f", -- lamp_FIRE_RENG_2_QUEUE
|
[386] = "%.f", -- lamp_FIRE_RENG_2_QUEUE
|
||||||
[387] = "%.1f", -- lamp_FIRE_KO50_2_QUEUE
|
[387] = "%.f", -- lamp_FIRE_KO50_2_QUEUE
|
||||||
[388] = "%.1f", -- lamp_FIRE_REDUCT_2_QUEUE
|
[388] = "%.f", -- lamp_FIRE_REDUCT_2_QUEUE
|
||||||
[398] = "%.1f", -- lamp_CHECK_SENSORS
|
[398] = "%.f", -- lamp_CHECK_SENSORS
|
||||||
[407] = "%.1f", -- lamp_HYDRO_main_on
|
[407] = "%.f", -- lamp_HYDRO_main_on
|
||||||
[408] = "%.1f", -- lamp_HYDRO_aux_on
|
[408] = "%.f", -- lamp_HYDRO_aux_on
|
||||||
[414] = "%.1f", -- lamp_APD9_on
|
[414] = "%.f", -- lamp_APD9_on
|
||||||
[416] = "%.1f", -- lamp_APD9_oil_pressure
|
[416] = "%.f", -- lamp_APD9_oil_pressure
|
||||||
[417] = "%.1f", -- lamp_APD9_rpm
|
[417] = "%.f", -- lamp_APD9_rpm
|
||||||
[418] = "%.1f", -- lamp_APD9_rpm_high
|
[418] = "%.f", -- lamp_APD9_rpm_high
|
||||||
[420] = "%.1f", -- lamp_APD_on
|
[420] = "%.f", -- lamp_APD_on
|
||||||
[424] = "%.1f", -- lamp_APD_starter_on
|
[424] = "%.f", -- lamp_APD_starter_on
|
||||||
[434] = "%.1f", -- lamp_FUEL_left_closed
|
[434] = "%.f", -- lamp_FUEL_left_closed
|
||||||
[435] = "%.1f", -- lamp_FUEL_right_closed
|
[435] = "%.f", -- lamp_FUEL_right_closed
|
||||||
[436] = "%.1f", -- lamp_FUEL_ring_closed
|
[436] = "%.f", -- lamp_FUEL_ring_closed
|
||||||
[441] = "%.1f", -- lamp_FUEL_center_on
|
[441] = "%.f", -- lamp_FUEL_center_on
|
||||||
[442] = "%.1f", -- lamp_FUEL_left_on
|
[442] = "%.f", -- lamp_FUEL_left_on
|
||||||
[443] = "%.1f", -- lamp_FUEL_right_on
|
[443] = "%.f", -- lamp_FUEL_right_on
|
||||||
[461] = "%.1f", -- lamp_HEATER
|
[461] = "%.f", -- lamp_HEATER
|
||||||
[462] = "%.1f", -- lamp_IGNITION
|
[462] = "%.f", -- lamp_IGNITION
|
||||||
[463] = "%.1f", -- lamp_KO50_ON
|
[463] = "%.f", -- lamp_KO50_ON
|
||||||
[341] = "%.1f", -- lamp_LEFT_PITOT_HEATER_OK
|
[341] = "%.f", -- lamp_LEFT_PITOT_HEATER_OK
|
||||||
[490] = "%.1f", -- lamp_RIGHT_PITOT_HEATER_OK
|
[490] = "%.f", -- lamp_RIGHT_PITOT_HEATER_OK
|
||||||
[509] = "%.1f", -- lamp_LEFT_PZU_ON
|
[509] = "%.f", -- lamp_LEFT_PZU_ON
|
||||||
[510] = "%.1f", -- lamp_RIGHT_PZU_ON
|
[510] = "%.f", -- lamp_RIGHT_PZU_ON
|
||||||
[504] = "%.1f", -- lamp_ELEC_turn_VU1
|
[504] = "%.f", -- lamp_ELEC_turn_VU1
|
||||||
[505] = "%.1f", -- lamp_ELEC_turn_VU2
|
[505] = "%.f", -- lamp_ELEC_turn_VU2
|
||||||
[506] = "%.1f", -- lamp_ELEC_turn_VU3
|
[506] = "%.f", -- lamp_ELEC_turn_VU3
|
||||||
[507] = "%.1f", -- lamp_ELEC_DC_ground
|
[507] = "%.f", -- lamp_ELEC_DC_ground
|
||||||
[508] = "%.1f", -- lamp_ELEC_test_equipment
|
[508] = "%.f", -- lamp_ELEC_test_equipment
|
||||||
[543] = "%.1f", -- lamp_ELEC_gen1_fail
|
[543] = "%.f", -- lamp_ELEC_gen1_fail
|
||||||
[544] = "%.1f", -- lamp_ELEC_gen2_fail
|
[544] = "%.f", -- lamp_ELEC_gen2_fail
|
||||||
[545] = "%.1f", -- lamp_ELEC_AC_ground
|
[545] = "%.f", -- lamp_ELEC_AC_ground
|
||||||
[546] = "%.1f", -- lamp_ELEC_PO_500
|
[546] = "%.f", -- lamp_ELEC_PO_500
|
||||||
[86] = "%.1f", -- lamp_CIRCUIT_FROM_BATTERY
|
[86] = "%.f", -- lamp_CIRCUIT_FROM_BATTERY
|
||||||
[68] = "%.1f", -- lamp_CLOG_TF_LEFT
|
[68] = "%.f", -- lamp_CLOG_TF_LEFT
|
||||||
[69] = "%.1f", -- lamp_CLOG_TF_RIGHT
|
[69] = "%.f", -- lamp_CLOG_TF_RIGHT
|
||||||
[70] = "%.1f", -- lamp_CHIP_LEFT_ENG
|
[70] = "%.f", -- lamp_CHIP_LEFT_ENG
|
||||||
[71] = "%.1f", -- lamp_CHIP_RIGHT_ENG
|
[71] = "%.f", -- lamp_CHIP_RIGHT_ENG
|
||||||
[72] = "%.1f", -- lamp_VIBRATION_LEFT_HIGH
|
[72] = "%.f", -- lamp_VIBRATION_LEFT_HIGH
|
||||||
[73] = "%.1f", -- lamp_VIBRATION_RIGHT_HIGH
|
[73] = "%.f", -- lamp_VIBRATION_RIGHT_HIGH
|
||||||
[74] = "%.1f", -- lamp_FIRE
|
[74] = "%.f", -- lamp_FIRE
|
||||||
[76] = "%.1f", -- lamp_LEFT_ENG_TURN_OFF
|
[76] = "%.f", -- lamp_LEFT_ENG_TURN_OFF
|
||||||
[77] = "%.1f", -- lamp_RIGHT_ENG_TURN_OFF
|
[77] = "%.f", -- lamp_RIGHT_ENG_TURN_OFF
|
||||||
[78] = "%.1f", -- lamp_FT_LEFT_HIGH
|
[78] = "%.f", -- lamp_FT_LEFT_HIGH
|
||||||
[79] = "%.1f", -- lamp_FT_RIGHT_HIGH
|
[79] = "%.f", -- lamp_FT_RIGHT_HIGH
|
||||||
[80] = "%.1f", -- lamp_OIL_PRESSURE_LEFT
|
[80] = "%.f", -- lamp_OIL_PRESSURE_LEFT
|
||||||
[81] = "%.1f", -- lamp_OIL_PRESSURE_RIGHT
|
[81] = "%.f", -- lamp_OIL_PRESSURE_RIGHT
|
||||||
[82] = "%.1f", -- lamp_ER_LEFT
|
[82] = "%.f", -- lamp_ER_LEFT
|
||||||
[83] = "%.1f", -- lamp_ER_RIGHT
|
[83] = "%.f", -- lamp_ER_RIGHT
|
||||||
[84] = "%.1f", -- lamp_EEC_LEFT_OFF
|
[84] = "%.f", -- lamp_EEC_LEFT_OFF
|
||||||
[85] = "%.1f", -- lamp_EEC_RIGHT_OFF
|
[85] = "%.f", -- lamp_EEC_RIGHT_OFF
|
||||||
[873] = "%.1f", -- lamp_CHIP_MAIN_REDUCTOR
|
[873] = "%.f", -- lamp_CHIP_MAIN_REDUCTOR
|
||||||
[874] = "%.1f", -- lamp_CHIP_INTER_REDUCTOR
|
[874] = "%.f", -- lamp_CHIP_INTER_REDUCTOR
|
||||||
[875] = "%.1f", -- lamp_CHIP_TAIL_REDUCTOR
|
[875] = "%.f", -- lamp_CHIP_TAIL_REDUCTOR
|
||||||
[64] = "%.1f", -- lamp_300_Left
|
[64] = "%.f", -- lamp_300_Left
|
||||||
[65] = "%.1f", -- lamp_DISS_OFF
|
[65] = "%.f", -- lamp_DISS_OFF
|
||||||
[555] = "%.1f", -- lamp_BD1
|
[555] = "%.f", -- lamp_BD1
|
||||||
[556] = "%.1f", -- lamp_BD2
|
[556] = "%.f", -- lamp_BD2
|
||||||
[557] = "%.1f", -- lamp_BD3
|
[557] = "%.f", -- lamp_BD3
|
||||||
[558] = "%.1f", -- lamp_BD4
|
[558] = "%.f", -- lamp_BD4
|
||||||
[559] = "%.1f", -- lamp_BD5
|
[559] = "%.f", -- lamp_BD5
|
||||||
[560] = "%.1f", -- lamp_BD6
|
[560] = "%.f", -- lamp_BD6
|
||||||
[711] = "%.1f", -- lamp_BD1Bomb
|
[711] = "%.f", -- lamp_BD1Bomb
|
||||||
[712] = "%.1f", -- lamp_BD2Bomb
|
[712] = "%.f", -- lamp_BD2Bomb
|
||||||
[713] = "%.1f", -- lamp_BD3Bomb
|
[713] = "%.f", -- lamp_BD3Bomb
|
||||||
[714] = "%.1f", -- lamp_BD4Bomb
|
[714] = "%.f", -- lamp_BD4Bomb
|
||||||
[715] = "%.1f", -- lamp_BD5Bomb
|
[715] = "%.f", -- lamp_BD5Bomb
|
||||||
[716] = "%.1f", -- lamp_BD6Bomb
|
[716] = "%.f", -- lamp_BD6Bomb
|
||||||
[562] = "%.1f", -- lamp_PUS1
|
[562] = "%.f", -- lamp_PUS1
|
||||||
[563] = "%.1f", -- lamp_PUS3
|
[563] = "%.f", -- lamp_PUS3
|
||||||
[564] = "%.1f", -- lamp_PUS4
|
[564] = "%.f", -- lamp_PUS4
|
||||||
[565] = "%.1f", -- lamp_PUS6
|
[565] = "%.f", -- lamp_PUS6
|
||||||
[561] = "%.1f", -- lamp_EmergExplode
|
[561] = "%.f", -- lamp_EmergExplode
|
||||||
[705] = "%.1f", -- lamp_EmergExplodeSec
|
[705] = "%.f", -- lamp_EmergExplodeSec
|
||||||
[710] = "%.1f", -- lamp_BV_Net_On
|
[710] = "%.f", -- lamp_BV_Net_On
|
||||||
[566] = "%.1f", -- lamp_RS_Net_On
|
[566] = "%.f", -- lamp_RS_Net_On
|
||||||
[567] = "%.1f", -- lamp_GUV_Net_On
|
[567] = "%.f", -- lamp_GUV_Net_On
|
||||||
--[] = "%.1f", -- lamp_MV_Net_On
|
--[] = "%.f", -- lamp_MV_Net_On
|
||||||
[568] = "%.1f", -- lamp_FKP_On
|
[568] = "%.f", -- lamp_FKP_On
|
||||||
[778] = "%.1f", -- lamp_Caution_Weap
|
[778] = "%.f", -- lamp_Caution_Weap
|
||||||
--[] = "%.1f", -- lamp_LeftSignal
|
--[] = "%.f", -- lamp_LeftSignal
|
||||||
--[] = "%.1f", -- lamp_RightSignal
|
--[] = "%.f", -- lamp_RightSignal
|
||||||
[586] = "%.1f", -- lamp_Caution_Weap1
|
[586] = "%.f", -- lamp_Caution_Weap1
|
||||||
[587] = "%.1f", -- lamp_Caution_Weap2
|
[587] = "%.f", -- lamp_Caution_Weap2
|
||||||
[588] = "%.1f", -- lamp_Caution_Weap3
|
[588] = "%.f", -- lamp_Caution_Weap3
|
||||||
[306] = "%.1f", -- lamp_Record_P503B
|
[306] = "%.f", -- lamp_Record_P503B
|
||||||
[302] = "%.1f", -- lamp_IFF_KD
|
[302] = "%.f", -- lamp_IFF_KD
|
||||||
[303] = "%.1f", -- lamp_IFF_KP
|
[303] = "%.f", -- lamp_IFF_KP
|
||||||
[912] = "%.1f", -- lamp_IFF_TurnOnReserve
|
[912] = "%.f", -- lamp_IFF_TurnOnReserve
|
||||||
[87] = "%.1f", -- lamp_IFF_Failure
|
[87] = "%.f", -- lamp_IFF_Failure
|
||||||
-- Lights system
|
-- Lights system
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
[880] = "%.1f", -- RedLightLhGr1 {1.0, 0.0}
|
[880] = "%.f", -- RedLightLhGr1 {1.0, 0.0}
|
||||||
[896] = "%.1f", -- RedLightLhGr2 {1.0, 0.0}
|
[896] = "%.f", -- RedLightLhGr2 {1.0, 0.0}
|
||||||
[897] = "%.1f", -- RedLightRhGr1 {1.0, 0.0}
|
[897] = "%.f", -- RedLightRhGr1 {1.0, 0.0}
|
||||||
[898] = "%.1f", -- RedLightRhGr2 {1.0, 0.0}
|
[898] = "%.f", -- RedLightRhGr2 {1.0, 0.0}
|
||||||
[899] = "%.1f", -- RedLightChGr1 {1.0, 0.0}
|
[899] = "%.f", -- RedLightChGr1 {1.0, 0.0}
|
||||||
[901] = "%.1f", -- RedLightChGr2 {1.0, 0.0}
|
[901] = "%.f", -- RedLightChGr2 {1.0, 0.0}
|
||||||
[922] = "%.1f", -- RedLightChGr12 {1.0, 0.0}
|
[922] = "%.f", -- RedLightChGr12 {1.0, 0.0}
|
||||||
[902] = "%.1f", -- RedLight5V5 {1.0, 0.0}
|
[902] = "%.f", -- RedLight5V5 {1.0, 0.0}
|
||||||
[900] = "%.1f", -- PlafondBrightness {1.0, 0.0}
|
[900] = "%.f", -- PlafondBrightness {1.0, 0.0}
|
||||||
[547] = "%.1f", -- LeftPlafond {1.0, 0.0}
|
[547] = "%.f", -- LeftPlafond {1.0, 0.0}
|
||||||
[665] = "%.1f", -- RightPlafond {1.0, 0.0}
|
[665] = "%.f", -- RightPlafond {1.0, 0.0}
|
||||||
[920] = "%.1f" -- RecorderP503B_PanelLightness {1.0, 0.0}
|
[920] = "%.f" -- RecorderP503B_PanelLightness {1.0, 0.0}
|
||||||
}
|
}
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
arguments for export in low tick interval
|
arguments for export in low tick interval
|
||||||
@ -975,275 +976,31 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
if gES_GlassCockpitType == 1 then
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
-- HELIOS Version 1.3
|
|
||||||
elseif gES_GlassCockpitType == 2 then
|
|
||||||
--[[
|
--[[
|
||||||
every frame export to GlassCockpit
|
every frame export to Ikarus
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local lUHFRadio = GetDevice(54)
|
local lUHFRadio = GetDevice(54)
|
||||||
SendData("ExportID", "Format")
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
]]
|
]]
|
||||||
-- Altimeter
|
|
||||||
-- VD_10K_L_100_Ind; VD_10K_L_10_Ind; VD_10K_L_PRESS
|
|
||||||
SendData(2000, string.format("%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(98),
|
|
||||||
mainPanelDevice:get_argument_value(99),
|
|
||||||
mainPanelDevice:get_argument_value(21)))
|
|
||||||
-- Altimeter Radar
|
|
||||||
-- A_036_RALT;A_036_DangerRALT_index;A_036_DangerRALT_lamp;A_036_warning_flag
|
|
||||||
SendData(2001, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(34),
|
|
||||||
mainPanelDevice:get_argument_value(31),
|
|
||||||
mainPanelDevice:get_argument_value(30),
|
|
||||||
mainPanelDevice:get_argument_value(33)))
|
|
||||||
-- AGB_3K
|
|
||||||
-- AGB_3K_Left_roll, AGB_3K_Left_pitch, steering_warning_flag, SlipBallPosition
|
|
||||||
SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(13),
|
|
||||||
mainPanelDevice:get_argument_value(12),
|
|
||||||
mainPanelDevice:get_argument_value(14),
|
|
||||||
mainPanelDevice:get_argument_value(15)))
|
|
||||||
|
|
||||||
-- Clock
|
|
||||||
-- currtimeHours; currtimeMinutes; currtimeSeconds; flightTimeMeterStatus;
|
|
||||||
-- flightHours;flightMinutes; secondsMeterTimeMinutes; secondsMeterTimeSeconds;
|
|
||||||
SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(49),
|
|
||||||
mainPanelDevice:get_argument_value(50),
|
|
||||||
mainPanelDevice:get_argument_value(51),
|
|
||||||
mainPanelDevice:get_argument_value(56),
|
|
||||||
mainPanelDevice:get_argument_value(52),
|
|
||||||
mainPanelDevice:get_argument_value(53),
|
|
||||||
mainPanelDevice:get_argument_value(54),
|
|
||||||
mainPanelDevice:get_argument_value(55)))
|
|
||||||
-- DirectionalGyro
|
|
||||||
-- UGR_4K_heading_L;UGR_4K_commanded_course_L;UGR_4K_bearing_needle_L
|
|
||||||
SendData(2004, string.format("%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(25),
|
|
||||||
mainPanelDevice:get_argument_value(27),
|
|
||||||
mainPanelDevice:get_argument_value(28)))
|
|
||||||
-- DriftIndicator
|
|
||||||
-- diss15_drift_angle;diss15_W_shutter;diss15_W_memory_lamp;diss15_W_hundreds; diss15_W_tens;diss15_W_ones
|
|
||||||
SendData(2005, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(791),
|
|
||||||
mainPanelDevice:get_argument_value(795),
|
|
||||||
mainPanelDevice:get_argument_value(796),
|
|
||||||
mainPanelDevice:get_argument_value(792),
|
|
||||||
mainPanelDevice:get_argument_value(793),
|
|
||||||
mainPanelDevice:get_argument_value(794)))
|
|
||||||
-- EGT
|
|
||||||
-- LeftEngineTemperatureHund; LeftEngineTemperatureTenth; RightEngineTemperatureHund;RightEngineTemperatureTenth
|
|
||||||
SendData(2006, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(43),
|
|
||||||
mainPanelDevice:get_argument_value(44),
|
|
||||||
mainPanelDevice:get_argument_value(45),
|
|
||||||
mainPanelDevice:get_argument_value(46)))
|
|
||||||
-- Engine Power
|
|
||||||
-- EnginesMode;LeftEngineMode;RightEngineMode ????
|
|
||||||
SendData(2007, string.format("%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(39),
|
|
||||||
mainPanelDevice:get_argument_value(37),
|
|
||||||
mainPanelDevice:get_argument_value(38)))
|
|
||||||
-- Hover
|
|
||||||
-- diss15_hover_x; diss15_hover_y;diss15_hover_z;diss15_hover_lamp_off;
|
|
||||||
SendData(2008, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(830),
|
|
||||||
mainPanelDevice:get_argument_value(828),
|
|
||||||
mainPanelDevice:get_argument_value(829),
|
|
||||||
mainPanelDevice:get_argument_value(831),
|
|
||||||
mainPanelDevice:get_argument_value(16)))
|
|
||||||
-- Oil Engine Left
|
|
||||||
-- oils_p_left_engine;oils_t_left_engine
|
|
||||||
SendData(2009, string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(115),
|
|
||||||
mainPanelDevice:get_argument_value(116)))
|
|
||||||
-- Oil Engine Right
|
|
||||||
-- oils_p_right_engine;oils_t_right_engine
|
|
||||||
SendData(2010, string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(117),
|
|
||||||
mainPanelDevice:get_argument_value(118)))
|
|
||||||
-- Oil Transition
|
|
||||||
-- oils_p_main_reductor;oils_t_main_reductor;oils_temp_tail_reductor;
|
|
||||||
SendData(2011, string.format("%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(111),
|
|
||||||
mainPanelDevice:get_argument_value(114),
|
|
||||||
mainPanelDevice:get_argument_value(113)))
|
|
||||||
-- RPM
|
|
||||||
-- LeftEngineRPM;RightEngineRPM
|
|
||||||
SendData(2012, string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(40),
|
|
||||||
mainPanelDevice:get_argument_value(41)))
|
|
||||||
-- Turn Indicator
|
|
||||||
-- EUP_speed;EUP_sideslip
|
|
||||||
SendData(2013, string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(22),
|
|
||||||
mainPanelDevice:get_argument_value(23)))
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
every frame export to DAC
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- Radar altimeter A-036
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("30", mainPanelDevice:get_argument_value(30) > 0.3 and 1 or 0) -- A_036_DangerRALT_lamp {0.0, 1.0}
|
|
||||||
-- DISS15
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("822", mainPanelDevice:get_argument_value(822) > 0.3 and 1 or 0) -- diss15_check_control_lamp {0.0, 0.9}
|
|
||||||
SendDataHW("823", mainPanelDevice:get_argument_value(823) > 0.3 and 1 or 0) -- diss15_check_work_lamp {0.0, 0.9}
|
|
||||||
SendDataHW("824", mainPanelDevice:get_argument_value(824) > 0.3 and 1 or 0) -- diss15_check_failM_lamp {0.0, 0.9}
|
|
||||||
SendDataHW("825", mainPanelDevice:get_argument_value(825) > 0.3 and 1 or 0) -- diss15_check_failC_lamp {0.0, 0.9}
|
|
||||||
-- SPUU-52
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("786", mainPanelDevice:get_argument_value(786) > 0.3 and 1 or 0) -- SPUU52_lamp {0.0, 1.0}
|
|
||||||
-- PU-26 LAMP
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("827", mainPanelDevice:get_argument_value(827) > 0.3 and 1 or 0) -- PU_26_GA_Lamp {0.0, 0.5}
|
|
||||||
-- ARC-UD
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("458", mainPanelDevice:get_argument_value(458) > 0.3 and 1 or 0) -- ARC_UD_Narrow_Lamp {0.0, 0.9}
|
|
||||||
SendDataHW("459", mainPanelDevice:get_argument_value(459) > 0.3 and 1 or 0) -- ARC_UD_Wide_Lamp {0.0, 0.9}
|
|
||||||
SendDataHW("460", mainPanelDevice:get_argument_value(460) > 0.3 and 1 or 0) -- ARC_UD_Pulse_Lamp {0.0, 0.9}
|
|
||||||
-- Jadro 1A
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("849", mainPanelDevice:get_argument_value(849) > 0.3 and 1 or 0) -- Jadro_ASU_Lamp {0.0, 1.0}
|
|
||||||
SendDataHW("848", mainPanelDevice:get_argument_value(848) > 0.3 and 1 or 0) -- Jadro_Ctl_Lamp {0.0, 1.0}
|
|
||||||
SendDataHW("850", mainPanelDevice:get_argument_value(450) > 0.3 and 1 or 0) -- Jadro_Breakdown_Lamp {0.0, 1.0}
|
|
||||||
-- Autopilot LAMPS
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("781", mainPanelDevice:get_argument_value(781) > 0.3 and 1 or 0) -- lamp_AP_heading_on
|
|
||||||
SendDataHW("782", mainPanelDevice:get_argument_value(782) > 0.3 and 1 or 0) -- lamp_AP_heading_off
|
|
||||||
SendDataHW("783", mainPanelDevice:get_argument_value(783) > 0.3 and 1 or 0) -- lamp_AP_pitch_roll_on
|
|
||||||
SendDataHW("784", mainPanelDevice:get_argument_value(784) > 0.3 and 1 or 0) -- lamp_AP_height_on
|
|
||||||
SendDataHW("785", mainPanelDevice:get_argument_value(785) > 0.3 and 1 or 0) -- lamp_AP_height_off
|
|
||||||
-- LAMPS
|
|
||||||
---------------------------------------------------------------
|
|
||||||
SendDataHW("316", mainPanelDevice:get_argument_value(316) > 0.3 and 1 or 0) -- lamp_ENGINE_RT_LEFT_ON
|
|
||||||
SendDataHW("317", mainPanelDevice:get_argument_value(317) > 0.3 and 1 or 0) -- lamp_ENGINE_RT_RIGHT_ON
|
|
||||||
SendDataHW("318", mainPanelDevice:get_argument_value(318) > 0.3 and 1 or 0) -- lamp_SARPP_ON
|
|
||||||
SendDataHW("326", mainPanelDevice:get_argument_value(326) > 0.3 and 1 or 0) -- lamp_LOCK_OPEN
|
|
||||||
SendDataHW("327", mainPanelDevice:get_argument_value(327) > 0.3 and 1 or 0) -- lamp_DOORS_OPEN
|
|
||||||
SendDataHW("340", mainPanelDevice:get_argument_value(340) > 0.3 and 1 or 0) -- lamp_TURN_ON_RI_65
|
|
||||||
SendDataHW("360", mainPanelDevice:get_argument_value(360) > 0.3 and 1 or 0) -- lamp_FROST
|
|
||||||
SendDataHW("362", mainPanelDevice:get_argument_value(362) > 0.3 and 1 or 0) -- lamp_LEFT_ENG_HEATING
|
|
||||||
SendDataHW("363", mainPanelDevice:get_argument_value(363) > 0.3 and 1 or 0) -- lamp_RIGHT_ENG_HEATING
|
|
||||||
SendDataHW("361", mainPanelDevice:get_argument_value(361) > 0.3 and 1 or 0) -- lamp_ANTI_ICE_ON
|
|
||||||
SendDataHW("364", mainPanelDevice:get_argument_value(364) > 0.3 and 1 or 0) -- lamp_LEFT_PZU_FRONT
|
|
||||||
SendDataHW("365", mainPanelDevice:get_argument_value(365) > 0.3 and 1 or 0) -- lamp_RIGHT_PZU_FRONT
|
|
||||||
SendDataHW("366", mainPanelDevice:get_argument_value(366) > 0.3 and 1 or 0) -- lamp_LEFT_PZU_BACK
|
|
||||||
SendDataHW("367", mainPanelDevice:get_argument_value(367) > 0.3 and 1 or 0) -- lamp_RIGHT_PZU_BACK
|
|
||||||
SendDataHW("373", mainPanelDevice:get_argument_value(373) > 0.3 and 1 or 0) -- lamp_SECTION_1
|
|
||||||
SendDataHW("375", mainPanelDevice:get_argument_value(375) > 0.3 and 1 or 0) -- lamp_SECTION_2
|
|
||||||
SendDataHW("374", mainPanelDevice:get_argument_value(374) > 0.3 and 1 or 0) -- lamp_SECTION_3
|
|
||||||
SendDataHW("376", mainPanelDevice:get_argument_value(376) > 0.3 and 1 or 0) -- lamp_SECTION_4
|
|
||||||
SendDataHW("368", mainPanelDevice:get_argument_value(368) > 0.3 and 1 or 0) -- lamp_RIO_heating_ok
|
|
||||||
SendDataHW("377", mainPanelDevice:get_argument_value(377) > 0.3 and 1 or 0) -- lamp_LEFT_ENG_FIRE
|
|
||||||
SendDataHW("378", mainPanelDevice:get_argument_value(378) > 0.3 and 1 or 0) -- lamp_RIGHT_ENG_FIRE
|
|
||||||
SendDataHW("379", mainPanelDevice:get_argument_value(379) > 0.3 and 1 or 0) -- lamp_KO50_FIRE
|
|
||||||
SendDataHW("380", mainPanelDevice:get_argument_value(380) > 0.3 and 1 or 0) -- lamp_REDUC_AI9_FIRE
|
|
||||||
SendDataHW("381", mainPanelDevice:get_argument_value(381) > 0.3 and 1 or 0) -- lamp_FIRE_LENG_1_QUEUE
|
|
||||||
SendDataHW("382", mainPanelDevice:get_argument_value(382) > 0.3 and 1 or 0) -- lamp_FIRE_RENG_1_QUEUE
|
|
||||||
SendDataHW("383", mainPanelDevice:get_argument_value(383) > 0.3 and 1 or 0) -- lamp_FIRE_KO50_1_QUEUE
|
|
||||||
SendDataHW("384", mainPanelDevice:get_argument_value(384) > 0.3 and 1 or 0) -- lamp_FIRE_REDUCT_1_QUEUE
|
|
||||||
SendDataHW("385", mainPanelDevice:get_argument_value(385) > 0.3 and 1 or 0) -- lamp_FIRE_LENG_2_QUEUE
|
|
||||||
SendDataHW("386", mainPanelDevice:get_argument_value(386) > 0.3 and 1 or 0) -- lamp_FIRE_RENG_2_QUEUE
|
|
||||||
SendDataHW("387", mainPanelDevice:get_argument_value(387) > 0.3 and 1 or 0) -- lamp_FIRE_KO50_2_QUEUE
|
|
||||||
SendDataHW("388", mainPanelDevice:get_argument_value(388) > 0.3 and 1 or 0) -- lamp_FIRE_REDUCT_2_QUEUE
|
|
||||||
SendDataHW("398", mainPanelDevice:get_argument_value(398) > 0.3 and 1 or 0) -- lamp_CHECK_SENSORS
|
|
||||||
SendDataHW("407", mainPanelDevice:get_argument_value(407) > 0.3 and 1 or 0) -- lamp_HYDRO_main_on
|
|
||||||
SendDataHW("408", mainPanelDevice:get_argument_value(408) > 0.3 and 1 or 0) -- lamp_HYDRO_aux_on
|
|
||||||
SendDataHW("414", mainPanelDevice:get_argument_value(414) > 0.3 and 1 or 0) -- lamp_APD9_on
|
|
||||||
SendDataHW("416", mainPanelDevice:get_argument_value(416) > 0.3 and 1 or 0) -- lamp_APD9_oil_pressure
|
|
||||||
SendDataHW("417", mainPanelDevice:get_argument_value(417) > 0.3 and 1 or 0) -- lamp_APD9_rpm
|
|
||||||
SendDataHW("418", mainPanelDevice:get_argument_value(418) > 0.3 and 1 or 0) -- lamp_APD9_rpm_high
|
|
||||||
SendDataHW("420", mainPanelDevice:get_argument_value(420) > 0.3 and 1 or 0) -- lamp_APD_on
|
|
||||||
SendDataHW("424", mainPanelDevice:get_argument_value(424) > 0.3 and 1 or 0) -- lamp_APD_starter_on
|
|
||||||
SendDataHW("434", mainPanelDevice:get_argument_value(434) > 0.3 and 1 or 0) -- lamp_FUEL_left_closed
|
|
||||||
SendDataHW("435", mainPanelDevice:get_argument_value(435) > 0.3 and 1 or 0) -- lamp_FUEL_right_closed
|
|
||||||
SendDataHW("436", mainPanelDevice:get_argument_value(436) > 0.3 and 1 or 0) -- lamp_FUEL_ring_closed
|
|
||||||
SendDataHW("441", mainPanelDevice:get_argument_value(441) > 0.3 and 1 or 0) -- lamp_FUEL_center_on
|
|
||||||
SendDataHW("442", mainPanelDevice:get_argument_value(442) > 0.3 and 1 or 0) -- lamp_FUEL_left_on
|
|
||||||
SendDataHW("443", mainPanelDevice:get_argument_value(443) > 0.3 and 1 or 0) -- lamp_FUEL_right_on
|
|
||||||
SendDataHW("461", mainPanelDevice:get_argument_value(461) > 0.3 and 1 or 0) -- lamp_HEATER
|
|
||||||
SendDataHW("462", mainPanelDevice:get_argument_value(462) > 0.3 and 1 or 0) -- lamp_IGNITION
|
|
||||||
SendDataHW("463", mainPanelDevice:get_argument_value(463) > 0.3 and 1 or 0) -- lamp_KO50_ON
|
|
||||||
SendDataHW("341", mainPanelDevice:get_argument_value(341) > 0.3 and 1 or 0) -- lamp_LEFT_PITOT_HEATER_OK
|
|
||||||
SendDataHW("490", mainPanelDevice:get_argument_value(490) > 0.3 and 1 or 0) -- lamp_RIGHT_PITOT_HEATER_OK
|
|
||||||
SendDataHW("509", mainPanelDevice:get_argument_value(509) > 0.3 and 1 or 0) -- lamp_LEFT_PZU_ON
|
|
||||||
SendDataHW("510", mainPanelDevice:get_argument_value(510) > 0.3 and 1 or 0) -- lamp_RIGHT_PZU_ON
|
|
||||||
SendDataHW("504", mainPanelDevice:get_argument_value(504) > 0.3 and 1 or 0) -- lamp_ELEC_turn_VU1
|
|
||||||
SendDataHW("505", mainPanelDevice:get_argument_value(505) > 0.3 and 1 or 0) -- lamp_ELEC_turn_VU2
|
|
||||||
SendDataHW("506", mainPanelDevice:get_argument_value(506) > 0.3 and 1 or 0) -- lamp_ELEC_turn_VU3
|
|
||||||
SendDataHW("507", mainPanelDevice:get_argument_value(507) > 0.3 and 1 or 0) -- lamp_ELEC_DC_ground
|
|
||||||
SendDataHW("508", mainPanelDevice:get_argument_value(508) > 0.3 and 1 or 0) -- lamp_ELEC_test_equipment
|
|
||||||
SendDataHW("543", mainPanelDevice:get_argument_value(543) > 0.3 and 1 or 0) -- lamp_ELEC_gen1_fail
|
|
||||||
SendDataHW("544", mainPanelDevice:get_argument_value(544) > 0.3 and 1 or 0) -- lamp_ELEC_gen2_fail
|
|
||||||
SendDataHW("545", mainPanelDevice:get_argument_value(545) > 0.3 and 1 or 0) -- lamp_ELEC_AC_ground
|
|
||||||
SendDataHW("546", mainPanelDevice:get_argument_value(546) > 0.3 and 1 or 0) -- lamp_ELEC_PO_500
|
|
||||||
SendDataHW("86", mainPanelDevice:get_argument_value(86) > 0.3 and 1 or 0) -- lamp_CIRCUIT_FROM_BATTERY
|
|
||||||
SendDataHW("68", mainPanelDevice:get_argument_value(68) > 0.3 and 1 or 0) -- lamp_CLOG_TF_LEFT
|
|
||||||
SendDataHW("69", mainPanelDevice:get_argument_value(69) > 0.3 and 1 or 0) -- lamp_CLOG_TF_RIGHT
|
|
||||||
SendDataHW("70", mainPanelDevice:get_argument_value(70) > 0.3 and 1 or 0) -- lamp_CHIP_LEFT_ENG
|
|
||||||
SendDataHW("71", mainPanelDevice:get_argument_value(71) > 0.3 and 1 or 0) -- lamp_CHIP_RIGHT_ENG
|
|
||||||
SendDataHW("72", mainPanelDevice:get_argument_value(72) > 0.3 and 1 or 0) -- lamp_VIBRATION_LEFT_HIGH
|
|
||||||
SendDataHW("73", mainPanelDevice:get_argument_value(73) > 0.3 and 1 or 0) -- lamp_VIBRATION_RIGHT_HIGH
|
|
||||||
SendDataHW("74", mainPanelDevice:get_argument_value(74) > 0.3 and 1 or 0) -- lamp_FIRE
|
|
||||||
SendDataHW("76", mainPanelDevice:get_argument_value(76) > 0.3 and 1 or 0) -- lamp_LEFT_ENG_TURN_OFF
|
|
||||||
SendDataHW("77", mainPanelDevice:get_argument_value(77) > 0.3 and 1 or 0) -- lamp_RIGHT_ENG_TURN_OFF
|
|
||||||
SendDataHW("78", mainPanelDevice:get_argument_value(78) > 0.3 and 1 or 0) -- lamp_FT_LEFT_HIGH
|
|
||||||
SendDataHW("79", mainPanelDevice:get_argument_value(79) > 0.3 and 1 or 0) -- lamp_FT_RIGHT_HIGH
|
|
||||||
SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- lamp_OIL_PRESSURE_LEFT
|
|
||||||
SendDataHW("81", mainPanelDevice:get_argument_value(81) > 0.3 and 1 or 0) -- lamp_OIL_PRESSURE_RIGHT
|
|
||||||
SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- lamp_ER_LEFT
|
|
||||||
SendDataHW("83", mainPanelDevice:get_argument_value(83) > 0.3 and 1 or 0) -- lamp_ER_RIGHT
|
|
||||||
SendDataHW("84", mainPanelDevice:get_argument_value(84) > 0.3 and 1 or 0) -- lamp_EEC_LEFT_OFF
|
|
||||||
SendDataHW("85", mainPanelDevice:get_argument_value(85) > 0.3 and 1 or 0) -- lamp_EEC_RIGHT_OFF
|
|
||||||
SendDataHW("873", mainPanelDevice:get_argument_value(873) > 0.3 and 1 or 0) -- lamp_CHIP_MAIN_REDUCTOR
|
|
||||||
SendDataHW("874", mainPanelDevice:get_argument_value(874) > 0.3 and 1 or 0) -- lamp_CHIP_INTER_REDUCTOR
|
|
||||||
SendDataHW("875", mainPanelDevice:get_argument_value(875) > 0.3 and 1 or 0) -- lamp_CHIP_TAIL_REDUCTOR
|
|
||||||
SendDataHW("64", mainPanelDevice:get_argument_value(64) > 0.3 and 1 or 0) -- lamp_300_Left
|
|
||||||
SendDataHW("65", mainPanelDevice:get_argument_value(65) > 0.3 and 1 or 0) -- lamp_DISS_OFF
|
|
||||||
SendDataHW("555", mainPanelDevice:get_argument_value(555) > 0.3 and 1 or 0) -- lamp_BD1
|
|
||||||
SendDataHW("556", mainPanelDevice:get_argument_value(556) > 0.3 and 1 or 0) -- lamp_BD2
|
|
||||||
SendDataHW("557", mainPanelDevice:get_argument_value(557) > 0.3 and 1 or 0) -- lamp_BD3
|
|
||||||
SendDataHW("558", mainPanelDevice:get_argument_value(558) > 0.3 and 1 or 0) -- lamp_BD4
|
|
||||||
SendDataHW("559", mainPanelDevice:get_argument_value(559) > 0.3 and 1 or 0) -- lamp_BD5
|
|
||||||
SendDataHW("560", mainPanelDevice:get_argument_value(560) > 0.3 and 1 or 0) -- lamp_BD6
|
|
||||||
SendDataHW("711", mainPanelDevice:get_argument_value(711) > 0.3 and 1 or 0) -- lamp_BD1Bomb
|
|
||||||
SendDataHW("712", mainPanelDevice:get_argument_value(712) > 0.3 and 1 or 0) -- lamp_BD2Bomb
|
|
||||||
SendDataHW("713", mainPanelDevice:get_argument_value(713) > 0.3 and 1 or 0) -- lamp_BD3Bomb
|
|
||||||
SendDataHW("714", mainPanelDevice:get_argument_value(714) > 0.3 and 1 or 0) -- lamp_BD4Bomb
|
|
||||||
SendDataHW("715", mainPanelDevice:get_argument_value(715) > 0.3 and 1 or 0) -- lamp_BD5Bomb
|
|
||||||
SendDataHW("716", mainPanelDevice:get_argument_value(716) > 0.3 and 1 or 0) -- lamp_BD6Bomb
|
|
||||||
SendDataHW("562", mainPanelDevice:get_argument_value(562) > 0.3 and 1 or 0) -- lamp_PUS1
|
|
||||||
SendDataHW("563", mainPanelDevice:get_argument_value(563) > 0.3 and 1 or 0) -- lamp_PUS3
|
|
||||||
SendDataHW("564", mainPanelDevice:get_argument_value(564) > 0.3 and 1 or 0) -- lamp_PUS4
|
|
||||||
SendDataHW("565", mainPanelDevice:get_argument_value(565) > 0.3 and 1 or 0) -- lamp_PUS6
|
|
||||||
SendDataHW("561", mainPanelDevice:get_argument_value(561) > 0.3 and 1 or 0) -- lamp_EmergExplode
|
|
||||||
SendDataHW("705", mainPanelDevice:get_argument_value(705) > 0.3 and 1 or 0) -- lamp_EmergExplodeSec
|
|
||||||
SendDataHW("710", mainPanelDevice:get_argument_value(710) > 0.3 and 1 or 0) -- lamp_BV_Net_On
|
|
||||||
SendDataHW("566", mainPanelDevice:get_argument_value(566) > 0.3 and 1 or 0) -- lamp_RS_Net_On
|
|
||||||
SendDataHW("567", mainPanelDevice:get_argument_value(567) > 0.3 and 1 or 0) -- lamp_GUV_Net_On
|
|
||||||
--SendDataHW("", mainPanelDevice:get_argument_value() > 0.3 and 1 or 0) -- lamp_MV_Net_On
|
|
||||||
SendDataHW("568", mainPanelDevice:get_argument_value(568) > 0.3 and 1 or 0) -- lamp_FKP_On
|
|
||||||
SendDataHW("778", mainPanelDevice:get_argument_value(778) > 0.3 and 1 or 0) -- lamp_Caution_Weap
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
@ -1251,93 +1008,94 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
export in low tick interval to GlassCockpit
|
export in low tick interval to Ikarus
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local lUHFRadio = GetDevice(54)
|
local lUHFRadio = GetDevice(54)
|
||||||
SendData("ExportID", "Format")
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
-- AGB_3K_LEFT
|
-- AGB_3K_LEFT
|
||||||
local lAGB_3K_LEFT = GetDevice(6)
|
local lAGB_3K_LEFT = GetDevice(6)
|
||||||
WriteToLog('lAGB_3K_LEFT:get_sideslip '..dump(lAGB_3K_LEFT:get_sideslip()))
|
ExportScript.Tools.WriteToLog('lAGB_3K_LEFT:get_sideslip '..ExportScript.Tools.dump(lAGB_3K_LEFT:get_sideslip()))
|
||||||
WriteToLog('lAGB_3K_LEFT:get_bank '..dump(lAGB_3K_LEFT:get_bank()))
|
ExportScript.Tools.WriteToLog('lAGB_3K_LEFT:get_bank '..ExportScript.Tools.dump(lAGB_3K_LEFT:get_bank()))
|
||||||
WriteToLog('lAGB_3K_LEFT:get_pitch '..dump(lAGB_3K_LEFT:get_pitch()))
|
ExportScript.Tools.WriteToLog('lAGB_3K_LEFT:get_pitch '..ExportScript.Tools.dump(lAGB_3K_LEFT:get_pitch()))
|
||||||
|
|
||||||
-- AGB_3K_RIGHT
|
-- AGB_3K_RIGHT
|
||||||
local lAGB_3K_RIGHT = GetDevice(7)
|
local lAGB_3K_RIGHT = GetDevice(7)
|
||||||
WriteToLog('lAGB_3K_RIGHT:get_sideslip '..dump(lAGB_3K_RIGHT:get_sideslip()))
|
ExportScript.Tools.WriteToLog('lAGB_3K_RIGHT:get_sideslip '..ExportScript.Tools.dump(lAGB_3K_RIGHT:get_sideslip()))
|
||||||
WriteToLog('lAGB_3K_RIGHT:get_bank '..dump(lAGB_3K_RIGHT:get_bank()))
|
ExportScript.Tools.WriteToLog('lAGB_3K_RIGHT:get_bank '..ExportScript.Tools.dump(lAGB_3K_RIGHT:get_bank()))
|
||||||
WriteToLog('lAGB_3K_RIGHT:get_pitch '..dump(lAGB_3K_RIGHT:get_pitch()))
|
ExportScript.Tools.WriteToLog('lAGB_3K_RIGHT:get_pitch '..ExportScript.Tools.dump(lAGB_3K_RIGHT:get_pitch()))
|
||||||
|
|
||||||
-- DISS_15
|
-- DISS_15
|
||||||
local lDISS_15 = GetDevice(15)
|
local lDISS_15 = GetDevice(15)
|
||||||
WriteToLog('lDISS_15:get_w_vector '..dump(lDISS_15:get_w_vector()))
|
ExportScript.Tools.WriteToLog('lDISS_15:get_w_vector '..ExportScript.Tools.dump(lDISS_15:get_w_vector()))
|
||||||
WriteToLog('lDISS_15:get_drift_angle '..dump(lDISS_15:get_drift_angle()))
|
ExportScript.Tools.WriteToLog('lDISS_15:get_drift_angle '..ExportScript.Tools.dump(lDISS_15:get_drift_angle()))
|
||||||
|
|
||||||
-- RADAR_ALTIMETER
|
-- RADAR_ALTIMETER
|
||||||
local lRADAR_ALTIMETER = GetDevice(18)
|
local lRADAR_ALTIMETER = GetDevice(18)
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_altitude '..dump(lRADAR_ALTIMETER:get_altitude()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_altitude '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_altitude()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_dangerous_height_flag '..dump(lRADAR_ALTIMETER:get_dangerous_height_flag()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_dangerous_height_flag '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_dangerous_height_flag()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..dump(lRADAR_ALTIMETER:get_distance_limit()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_distance_limit()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_dangerous_height '..dump(lRADAR_ALTIMETER:get_dangerous_height()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_dangerous_height '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_dangerous_height()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_warning_flag '..dump(lRADAR_ALTIMETER:get_warning_flag()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_warning_flag '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_warning_flag()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_mode '..dump(lRADAR_ALTIMETER:get_mode()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_mode '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_mode()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..dump(lRADAR_ALTIMETER:get_aperture_size()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_aperture_size()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_needle_value '..dump(lRADAR_ALTIMETER:get_needle_value()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_needle_value '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_needle_value()))
|
||||||
|
|
||||||
-- MISC_SYSTEMS_INTERFACE
|
-- MISC_SYSTEMS_INTERFACE
|
||||||
local lMISC_SYSTEMS_INTERFACE = GetDevice(20)
|
local lMISC_SYSTEMS_INTERFACE = GetDevice(20)
|
||||||
WriteToLog('lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch '..dump(lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch()))
|
ExportScript.Tools.WriteToLog('lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch '..ExportScript.Tools.dump(lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch()))
|
||||||
WriteToLog('lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm '..dump(lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm()))
|
ExportScript.Tools.WriteToLog('lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm '..ExportScript.Tools.dump(lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm()))
|
||||||
|
|
||||||
-- SPU_7 (Intercom)
|
-- SPU_7 (Intercom)
|
||||||
local lSPU_7 = GetDevice(36)
|
local lSPU_7 = GetDevice(36)
|
||||||
WriteToLog('lSPU_7:is_communicator_available '..dump(lSPU_7:is_communicator_available()))
|
ExportScript.Tools.WriteToLog('lSPU_7:is_communicator_available '..ExportScript.Tools.dump(lSPU_7:is_communicator_available()))
|
||||||
WriteToLog('lSPU_7:get_noise_level '..dump(lSPU_7:get_noise_level()))
|
ExportScript.Tools.WriteToLog('lSPU_7:get_noise_level '..ExportScript.Tools.dump(lSPU_7:get_noise_level()))
|
||||||
WriteToLog('lSPU_7:get_signal_level '..dump(lSPU_7:get_signal_level()))
|
ExportScript.Tools.WriteToLog('lSPU_7:get_signal_level '..ExportScript.Tools.dump(lSPU_7:get_signal_level()))
|
||||||
--WriteToLog('lSPU_7:set_communicator '..dump(lSPU_7:set_communicator())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lSPU_7:set_communicator '..ExportScript.Tools.dump(lSPU_7:set_communicator())) -- test parameters
|
||||||
--WriteToLog('lSPU_7:set_voip_mode '..dump(lSPU_7:set_voip_mode())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lSPU_7:set_voip_mode '..ExportScript.Tools.dump(lSPU_7:set_voip_mode())) -- test parameters
|
||||||
|
|
||||||
-- JADRO_1A
|
-- JADRO_1A
|
||||||
local lJADRO_1A = GetDevice(37)
|
local lJADRO_1A = GetDevice(37)
|
||||||
WriteToLog('lJADRO_1A:is_on '..dump(lJADRO_1A:is_on()))
|
ExportScript.Tools.WriteToLog('lJADRO_1A:is_on '..ExportScript.Tools.dump(lJADRO_1A:is_on()))
|
||||||
WriteToLog('lJADRO_1A:get_frequency '..dump(lJADRO_1A:get_frequency()))
|
ExportScript.Tools.WriteToLog('lJADRO_1A:get_frequency '..ExportScript.Tools.dump(lJADRO_1A:get_frequency()))
|
||||||
--WriteToLog('lJADRO_1A:set_frequency '..dump(lJADRO_1A:set_frequency())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lJADRO_1A:set_frequency '..ExportScript.Tools.dump(lJADRO_1A:set_frequency())) -- test parameters
|
||||||
--WriteToLog('lJADRO_1A:set_modulation '..dump(lJADRO_1A:set_modulation())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lJADRO_1A:set_modulation '..ExportScript.Tools.dump(lJADRO_1A:set_modulation())) -- test parameters
|
||||||
--WriteToLog('lJADRO_1A:set_channel '..dump(lJADRO_1A:set_channel())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lJADRO_1A:set_channel '..ExportScript.Tools.dump(lJADRO_1A:set_channel())) -- test parameters
|
||||||
|
|
||||||
-- R_863
|
-- R_863
|
||||||
local lR_863 = GetDevice(38)
|
local lR_863 = GetDevice(38)
|
||||||
WriteToLog('lR_863:is_on '..dump(lR_863:is_on()))
|
ExportScript.Tools.WriteToLog('lR_863:is_on '..ExportScript.Tools.dump(lR_863:is_on()))
|
||||||
WriteToLog('lR_863:get_frequency '..dump(lR_863:get_frequency()))
|
ExportScript.Tools.WriteToLog('lR_863:get_frequency '..ExportScript.Tools.dump(lR_863:get_frequency()))
|
||||||
--WriteToLog('lR_863:set_frequency '..dump(lR_863:set_frequency())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lR_863:set_frequency '..ExportScript.Tools.dump(lR_863:set_frequency())) -- test parameters
|
||||||
--WriteToLog('lR_863:set_modulation '..dump(lR_863:set_modulation())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lR_863:set_modulation '..ExportScript.Tools.dump(lR_863:set_modulation())) -- test parameters
|
||||||
--WriteToLog('lR_863:set_channel '..dump(lR_863:set_channel())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lR_863:set_channel '..ExportScript.Tools.dump(lR_863:set_channel())) -- test parameters
|
||||||
|
|
||||||
-- R_828
|
-- R_828
|
||||||
local lR_828 = GetDevice(39)
|
local lR_828 = GetDevice(39)
|
||||||
WriteToLog('lR_828:is_on '..dump(lR_828:is_on()))
|
ExportScript.Tools.WriteToLog('lR_828:is_on '..ExportScript.Tools.dump(lR_828:is_on()))
|
||||||
WriteToLog('lR_828:get_frequency '..dump(lR_828:get_frequency()))
|
ExportScript.Tools.WriteToLog('lR_828:get_frequency '..ExportScript.Tools.dump(lR_828:get_frequency()))
|
||||||
--WriteToLog('lR_828:set_frequency '..dump(lR_828:set_frequency())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lR_828:set_frequency '..ExportScript.Tools.dump(lR_828:set_frequency())) -- test parameters
|
||||||
--WriteToLog('lR_828:set_modulation '..dump(lR_828:set_modulation())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lR_828:set_modulation '..ExportScript.Tools.dump(lR_828:set_modulation())) -- test parameters
|
||||||
--WriteToLog('lR_828:set_channel '..dump(lR_828:set_channel())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lR_828:set_channel '..ExportScript.Tools.dump(lR_828:set_channel())) -- test parameters
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
export in low tick interval to hardware
|
export in low tick interval to hardware
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Landing Gear
|
Landing Gear
|
||||||
mainPanelDevice, basis panel
|
mainPanelDevice, basis panel
|
||||||
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
|
ExportScript.Tools.SendDataDAC("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
|
||||||
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
|
ExportScript.Tools.SendDataDAC("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
|
||||||
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
|
ExportScript.Tools.SendDataDAC("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
|
||||||
|
|
||||||
Device test, Device 2 to 32
|
Device test, Device 2 to 32
|
||||||
is value "userdata", is only DLL intern functions
|
is value "userdata", is only DLL intern functions
|
||||||
@ -1345,8 +1103,8 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 50, 1 do
|
for ltmp2 = 1, 50, 1 do
|
||||||
ltmp1 = GetDevice(ltmp2)
|
ltmp1 = GetDevice(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.ExportScript.Tools.dump(ltmp1))
|
||||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
ExportScript.Tools.ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
|
|
||||||
@ -1354,34 +1112,34 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|||||||
-- JADRO 1A
|
-- JADRO 1A
|
||||||
local lJADRO_1A = GetDevice(37)
|
local lJADRO_1A = GetDevice(37)
|
||||||
if lJADRO_1A:is_on() then
|
if lJADRO_1A:is_on() then
|
||||||
SendDataHW("2000", string.format("%7.4f", lJADRO_1A:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.4f", lJADRO_1A:get_frequency()/1000000))
|
||||||
else
|
else
|
||||||
SendDataHW("2000", "-")
|
ExportScript.Tools.SendDataDAC("2000", "-")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- R_863 (center)
|
-- R_863 (center)
|
||||||
local lR_863_c = GetDevice(38)
|
local lR_863_c = GetDevice(38)
|
||||||
SendDataHW("2001", string.format("%7.3f", lR_863_c:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2001", string.format("%7.3f", lR_863_c:get_frequency()/1000000))
|
||||||
|
|
||||||
-- R_863 (left) Channel
|
-- R_863 (left) Channel
|
||||||
local lR_863_l = {[0.0]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
local lR_863_l = {[0.0]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
||||||
SendDataHW("2002", lR_863_l[math.round(mainPanelDevice:get_argument_value(370), 2)])
|
ExportScript.Tools.SendDataDAC("2002", lR_863_l[ExportScript.Tools.round(mainPanelDevice:get_argument_value(370), 2)])
|
||||||
|
|
||||||
-- R_863 (left) Frequency
|
-- R_863 (left) Frequency
|
||||||
-- is the same frequency as R_863 (center), but not the frequency from R_863 (left)
|
-- is the same frequency as R_863 (center), but not the frequency from R_863 (left)
|
||||||
local lR_863_F = GetDevice(38)
|
local lR_863_F = GetDevice(38)
|
||||||
SendDataHW("2003", string.format("%7.3f", lR_863_F:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2003", string.format("%7.3f", lR_863_F:get_frequency()/1000000))
|
||||||
|
|
||||||
-- R_828 Channel
|
-- R_828 Channel
|
||||||
local lR_828 = {[0.0]="1",[0.101]="2",[0.199]="3",[0.302]="4",[0.400]="5",[0.502]="6",[0.601]="7",[0.697]="8",[0.801]="9",[0.898]="10"}
|
local lR_828 = {[0.0]="1",[0.101]="2",[0.199]="3",[0.302]="4",[0.400]="5",[0.502]="6",[0.601]="7",[0.697]="8",[0.801]="9",[0.898]="10"}
|
||||||
SendDataHW("2004", lR_828[math.round(mainPanelDevice:get_argument_value(736), 3)])
|
ExportScript.Tools.SendDataDAC("2004", lR_828[ExportScript.Tools.round(mainPanelDevice:get_argument_value(736), 3)])
|
||||||
|
|
||||||
-- R_828 Frequency
|
-- R_828 Frequency
|
||||||
local lR_828_F = GetDevice(39)
|
local lR_828_F = GetDevice(39)
|
||||||
if lR_828_F:is_on() then
|
if lR_828_F:is_on() then
|
||||||
SendDataHW("2005", string.format("%7.3f", lR_828_F:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2005", string.format("%7.3f", lR_828_F:get_frequency()/1000000))
|
||||||
else
|
else
|
||||||
SendDataHW("2005", "-")
|
ExportScript.Tools.SendDataDAC("2005", "-")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- UV-26
|
-- UV-26
|
||||||
@ -1390,18 +1148,25 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|||||||
lUV26 = lUV26:gsub("txt_digits", "")
|
lUV26 = lUV26:gsub("txt_digits", "")
|
||||||
lUV26 = lUV26:gsub("%c", "")
|
lUV26 = lUV26:gsub("%c", "")
|
||||||
|
|
||||||
SendDataHW("2006", string.format("%s", lUV26))
|
ExportScript.Tools.SendDataDAC("2006", string.format("%s", lUV26))
|
||||||
|
|
||||||
|
|
||||||
--============================================================================================
|
--============================================================================================
|
||||||
--[[
|
--[[
|
||||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
|
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 10, 1 do
|
for ltmp2 = 1, 10, 1 do
|
||||||
ltmp1 = list_indication(ltmp2)
|
ltmp1 = list_indication(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- Custom functions --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
|
end
|
||||||
@ -1,12 +1,20 @@
|
|||||||
-- MiG-15Bis
|
-- MiG-15Bis
|
||||||
-- Version 0.9.9 BETA
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
-- arguments for export every frame
|
--[[
|
||||||
-- based of "mainpanel_init.lua"
|
every frames arguments
|
||||||
|
based of "mainpanel_init.lua"
|
||||||
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
|
[DeviceID] = "Format"
|
||||||
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
|
]]
|
||||||
[225] = "%.4f", -- Canopy
|
[225] = "%.4f", -- Canopy
|
||||||
[223] = "%.4f", -- LeftCanopyLever
|
[223] = "%.4f", -- LeftCanopyLever
|
||||||
[222] = "%.4f", -- RightCanopyLever
|
[222] = "%.4f", -- RightCanopyLever
|
||||||
@ -84,34 +92,34 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[245] = "%.4f", -- ASP_3N_Range
|
[245] = "%.4f", -- ASP_3N_Range
|
||||||
-- Lamps
|
-- Lamps
|
||||||
-- electric system
|
-- electric system
|
||||||
[57] = "%.4f", -- lamp_GeneratorOff {-1.0, 1.0}{-1.0, 1.0}
|
[57] = "%.f", -- lamp_GeneratorOff {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[58] = "%.4f", -- lamp_Ignition {-1.0, 1.0}{-1.0, 1.0}
|
[58] = "%.f", -- lamp_Ignition {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- power plant
|
-- power plant
|
||||||
[119] = "%.4f", -- lamp_IsolatingValve {-1.0, 1.0}{-1.0, 1.0}
|
[119] = "%.f", -- lamp_IsolatingValve {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- gear system
|
-- gear system
|
||||||
[75] = "%.4f", -- lamp_LeftGearExt {-1.0, 1.0}{-1.0, 1.0}
|
[75] = "%.f", -- lamp_LeftGearExt {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[74] = "%.4f", -- lamp_LeftGearRet {-1.0, 1.0}{-1.0, 1.0}
|
[74] = "%.f", -- lamp_LeftGearRet {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[79] = "%.4f", -- lamp_RightGearExt {-1.0, 1.0}{-1.0, 1.0}
|
[79] = "%.f", -- lamp_RightGearExt {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[78] = "%.4f", -- lamp_RightGearRet {-1.0, 1.0}{-1.0, 1.0}
|
[78] = "%.f", -- lamp_RightGearRet {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[77] = "%.4f", -- lamp_NoseGearExt {-1.0, 1.0}{-1.0, 1.0}
|
[77] = "%.f", -- lamp_NoseGearExt {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[76] = "%.4f", -- lamp_NoseGearRet {-1.0, 1.0}{-1.0, 1.0}
|
[76] = "%.f", -- lamp_NoseGearRet {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[53] = "%.4f", -- lamp_ExtendGears {-1.0, 1.0}{-1.0, 1.0}
|
[53] = "%.f", -- lamp_ExtendGears {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- fuel system
|
-- fuel system
|
||||||
[56] = "%.4f", -- lamp_Remain300 {-1.0, 1.0}{-1.0, 1.0}
|
[56] = "%.f", -- lamp_Remain300 {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[50] = "%.4f", -- lamp_AftEmpty {-1.0, 1.0}{-1.0, 1.0}
|
[50] = "%.f", -- lamp_AftEmpty {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[52] = "%.4f", -- lamp_DropTanks {-1.0, 1.0}{-1.0, 1.0}
|
[52] = "%.f", -- lamp_DropTanks {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[51] = "%.4f", -- lamp_BoostPressure {-1.0, 1.0}{-1.0, 1.0}
|
[51] = "%.f", -- lamp_BoostPressure {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- control system
|
-- control system
|
||||||
[113] = "%.4f", -- lamp_TrimmerNeutral {-1.0, 1.0}{-1.0, 1.0}
|
[113] = "%.f", -- lamp_TrimmerNeutral {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[59] = "%.4f", -- lamp_FlapsExt {-1.0, 1.0}{-1.0, 1.0}
|
[59] = "%.f", -- lamp_FlapsExt {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[124] = "%.4f", -- lamp_AirBrakeExt {-1.0, 1.0}{-1.0, 1.0}
|
[124] = "%.f", -- lamp_AirBrakeExt {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- fire extinguisher system
|
-- fire extinguisher system
|
||||||
[135] = "%.4f", -- lamp_FireDetected {-1.0, 1.0}{-1.0, 1.0}
|
[135] = "%.f", -- lamp_FireDetected {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- ARC-5
|
-- ARC-5
|
||||||
[183] = "%.4f", -- lamp_ARC_5 {-1.0, 1.0}{-1.0, 1.0}
|
[183] = "%.f", -- lamp_ARC_5 {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[218] = "%.4f", -- light_ARC_5_scale {-1.0, 1.0}{-1.0, 1.0}
|
[218] = "%.f", -- light_ARC_5_scale {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- MRP-48P
|
-- MRP-48P
|
||||||
[54] = "%.4f", -- lamp_Marker {-1.0, 1.0}{-1.0, 1.0}
|
[54] = "%.f", -- lamp_Marker {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- Light System
|
-- Light System
|
||||||
[226] = "%.4f", -- light_LeftUV {-1.0, 1.0}{-1.0, 1.0}
|
[226] = "%.4f", -- light_LeftUV {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[215] = "%.4f", -- light_CenterUV {-1.0, 1.0}{-1.0, 1.0}
|
[215] = "%.4f", -- light_CenterUV {-1.0, 1.0}{-1.0, 1.0}
|
||||||
@ -119,9 +127,9 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[217] = "%.4f", -- light_Panels {-1.0, 1.0}{-1.0, 1.0}
|
[217] = "%.4f", -- light_Panels {-1.0, 1.0}{-1.0, 1.0}
|
||||||
[216] = "%.4f", -- light_AuxLeftPanel {-1.0, 1.0}{-1.0, 1.0}
|
[216] = "%.4f", -- light_AuxLeftPanel {-1.0, 1.0}{-1.0, 1.0}
|
||||||
-- Gun Camera
|
-- Gun Camera
|
||||||
[55] = "%.4f" -- lamp_GunCamera {-1.0, 1.0}{-1.0, 1.0}
|
[55] = "%.f" -- lamp_GunCamera {-1.0, 1.0}{-1.0, 1.0}
|
||||||
}
|
}
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
arguments for export in low tick interval
|
arguments for export in low tick interval
|
||||||
@ -271,132 +279,31 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
if gES_GlassCockpitType == 1 then
|
--[[
|
||||||
-- HELIOS Version 1.3
|
every frame export to Ikarus
|
||||||
elseif gES_GlassCockpitType == 2 then
|
Example from A-10C
|
||||||
-- HawgTouch version 1.6
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
-- ADI
|
local lUHFRadio = GetDevice(54)
|
||||||
-- AGK_47B_roll;AGK_47B_pitch;AGK_47B_failure_flag;AGK_47B_sideslip;
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
-- AGK_47B_turn;AGK_47B_horizon
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
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
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
-- SendDataHW("", mainPanelDevice:get_argument_value()) --
|
--[[
|
||||||
-- Lamps
|
every frame export to DAC
|
||||||
-- electric system
|
Example from A-10C
|
||||||
SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- lamp_GeneratorOff
|
Get Radio Frequencies
|
||||||
SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- lamp_Ignition
|
get data from device
|
||||||
-- power plant
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("119", mainPanelDevice:get_argument_value(119)) -- lamp_IsolatingValve
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
-- gear system
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("75", mainPanelDevice:get_argument_value(75)) -- lamp_LeftGearExt
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
SendDataHW("74", mainPanelDevice:get_argument_value(74)) -- lamp_LeftGearRet
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
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
|
end
|
||||||
|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
@ -404,46 +311,51 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
if gES_GlassCockpitType == 1 then
|
--[[
|
||||||
-- HELIOS Version 1.3
|
export in low tick interval to Ikarus
|
||||||
elseif gES_GlassCockpitType == 2 then
|
Example from A-10C
|
||||||
-- HawgTouch version 1.6
|
Get Radio Frequencies
|
||||||
end
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|
||||||
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
every frame export to hardware
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--=====================================================================================
|
--=====================================================================================
|
||||||
--[[
|
--[[
|
||||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 0, 13, 1 do
|
for ltmp2 = 0, 13, 1 do
|
||||||
ltmp1 = list_indication(ltmp2)
|
ltmp1 = list_indication(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 73, 1 do
|
for ltmp2 = 1, 73, 1 do
|
||||||
ltmp1 = GetDevice(ltmp2)
|
ltmp1 = GetDevice(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
@ -452,5 +364,5 @@ end
|
|||||||
-- Custom functions --
|
-- Custom functions --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function genericRadio(key, value, hardware)
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
end
|
end
|
||||||
@ -1,9 +1,9 @@
|
|||||||
-- MiG-21Bis Export
|
-- MiG-21Bis Export
|
||||||
-- Version 0.9.9 BETA
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
every frames arguments
|
every frames arguments
|
||||||
@ -11,8 +11,8 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
[DeviceID] = "Format"
|
[DeviceID] = "Format"
|
||||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
[19] = "%0.1f", <- floating-point number with
|
||||||
[129] = "%1d", <- decimal number
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
]]
|
]]
|
||||||
[239] = "%.1f", -- CANOPY_anti_ice
|
[239] = "%.1f", -- CANOPY_anti_ice
|
||||||
--ALCOHOL, COMPRESSED_AIR other similar stuff == == == == == == == == == == == == == == == == == == == == == == =
|
--ALCOHOL, COMPRESSED_AIR other similar stuff == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
@ -24,12 +24,12 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[60] = "%.1f", -- OXYGENE_instrument_IK52_blinking_lungs
|
[60] = "%.1f", -- OXYGENE_instrument_IK52_blinking_lungs
|
||||||
[58] = "%.1f", -- OXYGENE_instrument_M2000
|
[58] = "%.1f", -- OXYGENE_instrument_M2000
|
||||||
--GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
--GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[9] = "%.1f", -- GEAR_NOSE_UP_LIGHT
|
[9] = "%.f", -- GEAR_NOSE_UP_LIGHT
|
||||||
[12] = "%.1f", -- GEAR_NOSE_DOWN_LIGHT
|
[12] = "%.f", -- GEAR_NOSE_DOWN_LIGHT
|
||||||
[10] = "%.1f", -- GEAR_LEFT_UP_LIGHT
|
[10] = "%.f", -- GEAR_LEFT_UP_LIGHT
|
||||||
[13] = "%.1f", -- GEAR_LEFT_DOWN_LIGHT
|
[13] = "%.f", -- GEAR_LEFT_DOWN_LIGHT
|
||||||
[11] = "%.1f", -- GEAR_RIGHT_UP_LIGHT
|
[11] = "%.f", -- GEAR_RIGHT_UP_LIGHT
|
||||||
[14] = "%.1f", -- GEAR_RIGHT_DOWN_LIGHT
|
[14] = "%.f", -- GEAR_RIGHT_DOWN_LIGHT
|
||||||
-- AIRBRAKES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- AIRBRAKES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[316] = "%.1f", -- AIRBRAKES_button
|
[316] = "%.1f", -- AIRBRAKES_button
|
||||||
[7] = "%.1f", -- AIRBRAKES_3D
|
[7] = "%.1f", -- AIRBRAKES_3D
|
||||||
@ -43,8 +43,8 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
--/N/ KSI subgroup (NPP) --------------------------------------------------------------------------------------------------------------------------
|
--/N/ KSI subgroup (NPP) --------------------------------------------------------------------------------------------------------------------------
|
||||||
[178] = "%.1f", -- KSI_switch
|
[178] = "%.1f", -- KSI_switch
|
||||||
[258] = "%.1f", -- KSI_adjust_button
|
[258] = "%.1f", -- KSI_adjust_button
|
||||||
[111] = "%.1f", -- KSI_course_indicator
|
[111] = "%.4f", -- KSI_course_indicator
|
||||||
[68] = "%.1f", -- KSI_course_set_needle
|
[68] = "%.4f", -- KSI_course_set_needle
|
||||||
-- RSBN subgroup ------------------------------------------------------------------------------------------------------------------------------------------------
|
-- RSBN subgroup ------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
[176] = "%.1f", -- RSBN_switch
|
[176] = "%.1f", -- RSBN_switch
|
||||||
[548] = "%.1f", -- RSBN_azimut_korekcija_LIGHT
|
[548] = "%.1f", -- RSBN_azimut_korekcija_LIGHT
|
||||||
@ -59,19 +59,19 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[589] = "%.4f", -- RSBN_NPP_glisada_needle
|
[589] = "%.4f", -- RSBN_NPP_glisada_needle
|
||||||
[567] = "%.1f", -- RSBN_KPP_kren_blinker
|
[567] = "%.1f", -- RSBN_KPP_kren_blinker
|
||||||
[568] = "%.1f", -- RSBN_KPP_tangaz_blinker
|
[568] = "%.1f", -- RSBN_KPP_tangaz_blinker
|
||||||
[565] = "%.4f", -- RSBN_KPP_kurs_director
|
--[565] = "%.4f", -- RSBN_KPP_kurs_director
|
||||||
[566] = "%.4f", -- RSBN_KPP_glisada_director
|
--[566] = "%.4f", -- RSBN_KPP_glisada_director
|
||||||
--/N/ ARK subgroup ---------------------------------------------------------------------------------------------------------------------------------
|
--/N/ ARK subgroup ---------------------------------------------------------------------------------------------------------------------------------
|
||||||
[174] = "%.1f", -- ARK_switch
|
[174] = "%.1f", -- ARK_switch
|
||||||
[254] = "%.1f", -- ARK_dal_bliz_selector
|
[254] = "%.1f", -- ARK_dal_bliz_selector
|
||||||
[36] = "%.4f", -- ARK_RSBN_needle
|
--[36] = "%.4f", -- ARK_RSBN_needle
|
||||||
-- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
[175] = "%.1f", -- RADIO_ALTIMETER_MARKER_switch
|
[175] = "%.1f", -- RADIO_ALTIMETER_MARKER_switch
|
||||||
[103] = "%.4f", -- RADIO_ALTIMETER_indicator
|
[103] = "%.4f", -- RADIO_ALTIMETER_indicator
|
||||||
[500] = "%.1f", -- LOW_ALT_LIGHT
|
[500] = "%.f", -- LOW_ALT_LIGHT
|
||||||
-- UUA and SUA subgroup -----------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- UUA and SUA subgroup -----------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
[105] = "%.4f", -- UUA_indicator
|
[105] = "%.4f", -- UUA_indicator
|
||||||
[537] = "%.1f", -- AOA_WARNING_LIGHT
|
[537] = "%.f", -- AOA_WARNING_LIGHT
|
||||||
-- DA-200 subgroup ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- DA-200 subgroup ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
[107] = "%.6f", -- DA200_TurnNeedle
|
[107] = "%.6f", -- DA200_TurnNeedle
|
||||||
[106] = "%.4f", -- DA200_VerticalVelocity
|
[106] = "%.4f", -- DA200_VerticalVelocity
|
||||||
@ -88,7 +88,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[114] = "%.4f", -- MIN_G_needle
|
[114] = "%.4f", -- MIN_G_needle
|
||||||
--TRIMMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
--TRIMMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[172] = "%.1f", -- TRIMMER_switch
|
[172] = "%.1f", -- TRIMMER_switch
|
||||||
[519] = "%.1f", -- TRIMMER_light
|
[519] = "%.f", -- TRIMMER_light
|
||||||
--PITOT TUBES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
--PITOT TUBES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[229] = "%.1f", -- PITOT_TUBES_SELECTOR
|
[229] = "%.1f", -- PITOT_TUBES_SELECTOR
|
||||||
[279] = "%.1f", -- PITOT_TUBES_HEATING_main
|
[279] = "%.1f", -- PITOT_TUBES_HEATING_main
|
||||||
@ -101,7 +101,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[124] = "%.4f", -- DC_BUS_V_needle
|
[124] = "%.4f", -- DC_BUS_V_needle
|
||||||
[165] = "%.1f", -- DC_BUS_battery
|
[165] = "%.1f", -- DC_BUS_battery
|
||||||
[155] = "%.1f", -- DC_BUS_battery_heat
|
[155] = "%.1f", -- DC_BUS_battery_heat
|
||||||
[510] = "%.1f", -- DC_GENERATOR_LIGHT
|
[510] = "%.f", -- DC_GENERATOR_LIGHT
|
||||||
[16666] = "%.1f", -- DC_GENERATOR
|
[16666] = "%.1f", -- DC_GENERATOR
|
||||||
[563] = "%.1f", -- DC_BUS
|
[563] = "%.1f", -- DC_BUS
|
||||||
[55] = "%.1f", -- DC_BUS_ISA_K
|
[55] = "%.1f", -- DC_BUS_ISA_K
|
||||||
@ -111,7 +111,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[15466] = "%.1f", -- AC_BUS_PO7502
|
[15466] = "%.1f", -- AC_BUS_PO7502
|
||||||
[16466] = "%.1f", -- AC_BUS_Emerg_Inverter
|
[16466] = "%.1f", -- AC_BUS_Emerg_Inverter
|
||||||
[16966] = "%.1f", -- AC_GENERATOR
|
[16966] = "%.1f", -- AC_GENERATOR
|
||||||
[511] = "%.1f", -- AC_GENERATOR_LIGHT
|
[511] = "%.f", -- AC_GENERATOR_LIGHT
|
||||||
--/N/ FUEL PUMPS & FUEL SYSTEM == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
--/N/ FUEL PUMPS & FUEL SYSTEM == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[159] = "%.1f", -- FUEL_PUMP_3
|
[159] = "%.1f", -- FUEL_PUMP_3
|
||||||
[160] = "%.1f", -- FUEL_PUMP_1
|
[160] = "%.1f", -- FUEL_PUMP_1
|
||||||
@ -119,15 +119,15 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[402] = "%.4f", -- FUEL_PRESSURE { 0, 45 } ????
|
[402] = "%.4f", -- FUEL_PRESSURE { 0, 45 } ????
|
||||||
[52] = "%.1f", -- FUEL_METER
|
[52] = "%.1f", -- FUEL_METER
|
||||||
--FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
--FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[501] = "%.1f", -- FUEL_LIGHT_FUELPODC
|
[501] = "%.f", -- FUEL_LIGHT_FUELPODC
|
||||||
[502] = "%.1f", -- FUEL_LIGHT_1GR
|
[502] = "%.f", -- FUEL_LIGHT_1GR
|
||||||
[503] = "%.1f", -- FUEL_LIGHT_450
|
[503] = "%.f", -- FUEL_LIGHT_450
|
||||||
[504] = "%.1f", -- FUEL_LIGHT_3GR
|
[504] = "%.f", -- FUEL_LIGHT_3GR
|
||||||
[505] = "%.1f", -- FUEL_LIGHT_FUELPODW
|
[505] = "%.f", -- FUEL_LIGHT_FUELPODW
|
||||||
[506] = "%.1f", -- FUEL_LIGHT_RASHOD
|
[506] = "%.f", -- FUEL_LIGHT_RASHOD
|
||||||
--ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
--ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[403] = "%.1f", -- ENGINE_START_DEVICE_STATUS { -1, 0, 1, 2 }
|
[403] = "%.1f", -- ENGINE_START_DEVICE_STATUS { -1, 0, 1, 2 }
|
||||||
[509] = "%.1f", -- START_DEVICE_ZAZIG_LIGHT
|
[509] = "%.f", -- START_DEVICE_ZAZIG_LIGHT
|
||||||
[415] = "%.1f", -- ENGINE_OXYGENE_STATUS
|
[415] = "%.1f", -- ENGINE_OXYGENE_STATUS
|
||||||
[61] = "%.4f", -- ENGINE_OXYGENE_manometer
|
[61] = "%.4f", -- ENGINE_OXYGENE_manometer
|
||||||
-- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
@ -138,13 +138,13 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[670] = "%.4f", -- ENGINE_RPM2
|
[670] = "%.4f", -- ENGINE_RPM2
|
||||||
[51] = "%.4f", -- ENGINE_TEMP
|
[51] = "%.4f", -- ENGINE_TEMP
|
||||||
[404] = "%.4f", -- ENGINE_STRESS
|
[404] = "%.4f", -- ENGINE_STRESS
|
||||||
[507] = "%.1f", -- FORSAZ_1_LIGHT
|
[507] = "%.f", -- FORSAZ_1_LIGHT
|
||||||
[508] = "%.1f", -- FORSAZ_2_LIGHT
|
[508] = "%.f", -- FORSAZ_2_LIGHT
|
||||||
[512] = "%.1f", -- NOZZLE_LIGHT
|
[512] = "%.f", -- NOZZLE_LIGHT
|
||||||
[517] = "%.1f", -- KONUS_LIGHT
|
[517] = "%.f", -- KONUS_LIGHT
|
||||||
[513] = "%.1f", -- OIL_LIGHT
|
[513] = "%.f", -- OIL_LIGHT
|
||||||
[627] = "%.4f", -- OIL_PRESSURE
|
[627] = "%.4f", -- OIL_PRESSURE
|
||||||
[534] = "%.1f", -- FIRE_LIGHT
|
[534] = "%.f", -- FIRE_LIGHT
|
||||||
[405] = "%.1f", -- ENGINE_SURGE_DOORS_POZITION { -1, 0, 1 }
|
[405] = "%.1f", -- ENGINE_SURGE_DOORS_POZITION { -1, 0, 1 }
|
||||||
-- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[418] = "%.4f", -- PRIMARY_GIDRO_Pressure
|
[418] = "%.4f", -- PRIMARY_GIDRO_Pressure
|
||||||
@ -153,8 +153,8 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[125] = "%.4f", -- SECONDARY_GIDRO_Pressure_needle
|
[125] = "%.4f", -- SECONDARY_GIDRO_Pressure_needle
|
||||||
[171] = "%.1f", -- GIDRO_NR27_switch
|
[171] = "%.1f", -- GIDRO_NR27_switch
|
||||||
[319] = "%.1f", -- GIDRO_ailerones_busters_switch
|
[319] = "%.1f", -- GIDRO_ailerones_busters_switch
|
||||||
[515] = "%.1f", -- HYDRAULIC_LIGHT
|
[515] = "%.f", -- HYDRAULIC_LIGHT
|
||||||
[514] = "%.1f", -- BUSTER_LIGHT
|
[514] = "%.f", -- BUSTER_LIGHT
|
||||||
--HELMET == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
--HELMET == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[306] = "%.1f", -- HELMET_heat_man_auto_switch
|
[306] = "%.1f", -- HELMET_heat_man_auto_switch
|
||||||
[310] = "%.1f", -- HELMET_quick_heat_button
|
[310] = "%.1f", -- HELMET_quick_heat_button
|
||||||
@ -162,25 +162,25 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
--AIR CONDITIONING == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
--AIR CONDITIONING == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[412] = "%.4f", -- AIR_CONDITION_cockpit_temperature
|
[412] = "%.4f", -- AIR_CONDITION_cockpit_temperature
|
||||||
-- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[541] = "%.1f", -- CANOPY_WARNING_LIGHT
|
[541] = "%.f", -- CANOPY_WARNING_LIGHT
|
||||||
[542] = "%.1f", -- SORC_LIGHT
|
[542] = "%.f", -- SORC_LIGHT
|
||||||
[407] = "%.1f", -- WARNING_LIGHTS_CHECK_STATE
|
[407] = "%.f", -- WARNING_LIGHTS_CHECK_STATE
|
||||||
[516] = "%.1f", -- MARKER_LIGHT
|
[516] = "%.f", -- MARKER_LIGHT
|
||||||
[518] = "%.1f", -- STABILISATOR_LIGHT
|
[518] = "%.f", -- STABILISATOR_LIGHT
|
||||||
[520] = "%.1f", -- CHECK_GEAR_LIGHT
|
[520] = "%.f", -- CHECK_GEAR_LIGHT
|
||||||
[521] = "%.1f", -- FLAPS_LIGHT
|
[521] = "%.f", -- FLAPS_LIGHT
|
||||||
[522] = "%.1f", -- AIRBRAKE_LIGHT
|
[522] = "%.f", -- AIRBRAKE_LIGHT
|
||||||
[523] = "%.1f", -- CENTRAL_PYLON_LIGHT
|
[523] = "%.f", -- CENTRAL_PYLON_LIGHT
|
||||||
[524] = "%.1f", -- RATO_L_LIGHT
|
[524] = "%.f", -- RATO_L_LIGHT
|
||||||
[525] = "%.1f", -- RATO_R_LIGHT
|
[525] = "%.f", -- RATO_R_LIGHT
|
||||||
[526] = "%.1f", -- PYLON_1_ON_LIGHT
|
[526] = "%.f", -- PYLON_1_ON_LIGHT
|
||||||
[527] = "%.1f", -- PYLON_2_ON_LIGHT
|
[527] = "%.f", -- PYLON_2_ON_LIGHT
|
||||||
[528] = "%.1f", -- PYLON_3_ON_LIGHT
|
[528] = "%.f", -- PYLON_3_ON_LIGHT
|
||||||
[529] = "%.1f", -- PYLON_4_ON_LIGHT
|
[529] = "%.f", -- PYLON_4_ON_LIGHT
|
||||||
[530] = "%.1f", -- PYLON_1_OFF_LIGHT
|
[530] = "%.f", -- PYLON_1_OFF_LIGHT
|
||||||
[531] = "%.1f", -- PYLON_2_OFF_LIGHT
|
[531] = "%.f", -- PYLON_2_OFF_LIGHT
|
||||||
[532] = "%.1f", -- PYLON_3_OFF_LIGHT
|
[532] = "%.f", -- PYLON_3_OFF_LIGHT
|
||||||
[533] = "%.1f", -- PYLON_4_OFF_LIGHT
|
[533] = "%.f", -- PYLON_4_OFF_LIGHT
|
||||||
-- GIRO DEVICES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- GIRO DEVICES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[536] = "%.1f", -- GIRO_ARRETIR
|
[536] = "%.1f", -- GIRO_ARRETIR
|
||||||
[408] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_STATE
|
[408] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_STATE
|
||||||
@ -230,22 +230,22 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
-- SARPP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
-- SARPP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[193] = "%.1f", -- SARPP_switch
|
[193] = "%.1f", -- SARPP_switch
|
||||||
-- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[546] = "%.1f", -- SAU_stabilization_LIGHT
|
[546] = "%.f", -- SAU_stabilization_LIGHT
|
||||||
[547] = "%.1f", -- SAU_privedenie_LIGHT
|
[547] = "%.f", -- SAU_privedenie_LIGHT
|
||||||
[544] = "%.1f", -- SAU_landing_COMMAND_LIGHT
|
[544] = "%.f", -- SAU_landing_COMMAND_LIGHT
|
||||||
[545] = "%.1f", -- SAU_landing_AUTO_LIGHT
|
[545] = "%.f", -- SAU_landing_AUTO_LIGHT
|
||||||
-- ARU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
-- ARU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[64] = "%.1f", -- ARU_3G_instrument
|
[64] = "%.1f", -- ARU_3G_instrument
|
||||||
-- KONUS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
-- KONUS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[66] = "%.1f", -- KONUS_UPES_3_instrument
|
[66] = "%.1f", -- KONUS_UPES_3_instrument
|
||||||
-- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[550] = "%.1f", -- GUN_GOTOVN_LIGHT
|
[550] = "%.f", -- GUN_GOTOVN_LIGHT
|
||||||
-- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
-- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
|
||||||
[601] = "%.1f", -- SPO_L_F
|
[601] = "%.f", -- SPO_L_F
|
||||||
[602] = "%.1f", -- SPO_R_F
|
[602] = "%.f", -- SPO_R_F
|
||||||
[603] = "%.1f", -- SPO_R_B
|
[603] = "%.f", -- SPO_R_B
|
||||||
[604] = "%.1f", -- SPO_L_B
|
[604] = "%.f", -- SPO_L_B
|
||||||
[605] = "%.1f", -- SPO_MUTED
|
[605] = "%.f", -- SPO_MUTED
|
||||||
-- SOD == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
-- SOD == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
[606] = "%.1f", -- SOD_ANSWER
|
[606] = "%.1f", -- SOD_ANSWER
|
||||||
[607] = "%.1f", -- SRZO_ON
|
[607] = "%.1f", -- SRZO_ON
|
||||||
@ -263,8 +263,20 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[652] = "%.4f", -- H_indicator_needle_max
|
[652] = "%.4f", -- H_indicator_needle_max
|
||||||
[655] = "%.4f", -- COCKPIT_PRESSURE_ALTIMETER
|
[655] = "%.4f", -- COCKPIT_PRESSURE_ALTIMETER
|
||||||
[656] = "%.4f", -- COCKPIT_PRESSURE
|
[656] = "%.4f", -- COCKPIT_PRESSURE
|
||||||
|
-- Clock == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
|
||||||
|
-- currtimeHours; currtimeMinutes; currtimeSeconds; flightTimeMeterStatus;
|
||||||
|
-- flightHours;flightMinutes; secondsMeterTimeMinutes; secondsMeterTimeSeconds;
|
||||||
|
-- 115; 116; 117; 118; 119; 120; 121; 122;
|
||||||
|
[115] = "%.4f", -- currtimeHours
|
||||||
|
[116] = "%.4f", -- currtimeMinutes
|
||||||
|
[117] = "%.4f", -- currtimeSeconds
|
||||||
|
[118] = "%.4f", -- flightTimeMeterStatus
|
||||||
|
[119] = "%.4f", -- flightHours
|
||||||
|
[120] = "%.4f", -- flightMinutes
|
||||||
|
[121] = "%.4f", -- secondsMeterTimeMinutes
|
||||||
|
[122] = "%.4f", -- secondsMeterTimeSeconds
|
||||||
}
|
}
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
arguments for export in low tick interval
|
arguments for export in low tick interval
|
||||||
@ -568,231 +580,38 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
if gES_GlassCockpitType == 1 then
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
-- HELIOS Version 1.3
|
--[[
|
||||||
elseif gES_GlassCockpitType == 2 then
|
every frame export to Ikarus
|
||||||
-- HawgTouch version 1.6
|
Example from A-10C
|
||||||
--[[
|
Get Radio Frequencies
|
||||||
every frame export
|
get data from device
|
||||||
Example from A-10C
|
local lUHFRadio = GetDevice(54)
|
||||||
Landing Gear
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
mainPanelDevice, basis panel
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
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
|
|
||||||
]]
|
|
||||||
|
|
||||||
|
-- ADI/KPP correction
|
||||||
|
ExportScript.Tools.SendData(565, string.format("%.4f", (mainPanelDevice:get_argument_value(565) * 3))) -- RSBN_KPP_kurs_director
|
||||||
|
ExportScript.Tools.SendData(566, string.format("%.4f", (mainPanelDevice:get_argument_value(566) * 3))) -- RSBN_KPP_glisada_director
|
||||||
|
|
||||||
-- Distance
|
-- HSI/NPP correction
|
||||||
-- distance_meter_Hundreds;distance_meter_Tens;distance_meter_Singles
|
ExportScript.Tools.SendData(36, string.format("%.4f", (mainPanelDevice:get_argument_value(36) - 0.5)))
|
||||||
-- 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;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(111),
|
|
||||||
mainPanelDevice:get_argument_value(68),
|
|
||||||
((mainPanelDevice:get_argument_value(36) + 0.25) - mainPanelDevice:get_argument_value(111)), --Needle is wrong
|
|
||||||
mainPanelDevice:get_argument_value(588), -- RSBN_NPP_glisada_blinker
|
|
||||||
mainPanelDevice:get_argument_value(587), -- RSBN_NPP_kurs_blinker
|
|
||||||
mainPanelDevice:get_argument_value(589), -- RSBN_NPP_glisada_needle
|
|
||||||
mainPanelDevice:get_argument_value(590))) -- RSBN_NPP_kurs_needle
|
|
||||||
-- 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;sideslip;RSBN_KPP_tangaz_blinker(Flag_L);RSBN_KPP_kren_blinker(Flag_R);
|
|
||||||
-- desiredBank;desirePitch;airSpeedDeviation;trackDeviation;heightDeviation;
|
|
||||||
SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(108), -- bank
|
|
||||||
mainPanelDevice:get_argument_value(109), -- pitch
|
|
||||||
mainPanelDevice:get_argument_value(31), -- sideslip
|
|
||||||
mainPanelDevice:get_argument_value(568), -- RSBN_KPP_tangaz_blinker(Flag_L)
|
|
||||||
mainPanelDevice:get_argument_value(567), -- RSBN_KPP_kren_blinker(Flag_R)
|
|
||||||
(mainPanelDevice:get_argument_value(565) * 3), -- RSBN_KPP_kurs_director
|
|
||||||
(mainPanelDevice:get_argument_value(566) * 3), -- RSBN_KPP_glisada_director (maybe multiply by 3)
|
|
||||||
0, -- ?
|
|
||||||
mainPanelDevice:get_argument_value(590), -- RSBN_NPP_kurs_needle
|
|
||||||
mainPanelDevice:get_argument_value(589))) -- RSBN_NPP_glisada_needle
|
|
||||||
-- 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
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
every frame export to DAC
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("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
|
end
|
||||||
|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
@ -800,40 +619,57 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
export in low tick interval to HELIOS
|
export in low tick interval to Ikarus
|
||||||
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
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local lUHFRadio = GetDevice(54)
|
local lUHFRadio = GetDevice(54)
|
||||||
SendData("ExportID", "Format")
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
ExportScript.Tools.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
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to hardware
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
|
||||||
|
--=====================================================================================
|
||||||
|
--[[
|
||||||
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 0, 13, 1 do
|
||||||
|
ltmp1 = list_indication(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
--[[
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 1, 73, 1 do
|
||||||
|
ltmp1 = GetDevice(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- Custom functions --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
|
end
|
||||||
331
Scripts/DCS-ExportScript/ExportsModules/P-51D.lua
Normal file
331
Scripts/DCS-ExportScript/ExportsModules/P-51D.lua
Normal file
@ -0,0 +1,331 @@
|
|||||||
|
-- P-51D Export
|
||||||
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
|
{
|
||||||
|
--[[
|
||||||
|
every frames arguments
|
||||||
|
based of "mainpanel_init.lua"
|
||||||
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
|
[DeviceID] = "Format"
|
||||||
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
|
]]
|
||||||
|
-- Flight Instruments
|
||||||
|
[11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7}
|
||||||
|
[29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6}
|
||||||
|
-- Altimeter
|
||||||
|
[97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0}
|
||||||
|
[96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0}
|
||||||
|
[24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0}
|
||||||
|
[25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0}
|
||||||
|
-- Artificial horizon
|
||||||
|
[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0}
|
||||||
|
[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
|
||||||
|
[16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0}
|
||||||
|
[20] = "%.1f", -- AHorizon_Caged {0.0, 1.0}
|
||||||
|
-- directional gyro
|
||||||
|
[12] = "%.4f", -- GyroHeading
|
||||||
|
-- turn indicator
|
||||||
|
[27] = "%.4f", -- TurnNeedle {-1.0, 1.0}
|
||||||
|
[28] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||||
|
-- oxygen pressure indicator
|
||||||
|
[34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0}
|
||||||
|
[33] = "%.4f", -- Oxygen_Flow_Blinker
|
||||||
|
-- fuel system
|
||||||
|
[155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
||||||
|
[156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
||||||
|
[160] = "%.4f", -- Fuel_Tank_Fuselage {0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0} {0.0,0.12,0.28,0.40,0.51,0.62,0.72,0.83,0.96,1.0}
|
||||||
|
[32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0}
|
||||||
|
-- A-11 clock
|
||||||
|
[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0}
|
||||||
|
[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0}
|
||||||
|
[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0}
|
||||||
|
-- AN5730 remote compass
|
||||||
|
[1] = "%.4f", -- CompassHeading
|
||||||
|
[2] = "%.4f", -- CommandedCourse
|
||||||
|
[3] = "%.4f", -- CommandedCourseKnob
|
||||||
|
-- TailRadarWarning
|
||||||
|
[161] = "%.f", -- Lamp TailRadarWarning
|
||||||
|
-- SCR-522A Control panel
|
||||||
|
[122] = "%.f", -- A_channel_light
|
||||||
|
[123] = "%.f", -- B_channel_light
|
||||||
|
[124] = "%.f", -- C_channel_light
|
||||||
|
[125] = "%.f", -- D_channel_light
|
||||||
|
[126] = "%.f", -- Transmit_light
|
||||||
|
-- hydraulic pressure
|
||||||
|
[78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0}
|
||||||
|
-- Landing gears handle
|
||||||
|
[150] = "%.4f", -- Landing_Gear_Handle
|
||||||
|
[151] = "%.4f", -- Landing_Gear_Handle_Indoor
|
||||||
|
[80] = "%.f", -- LandingGearGreenLight
|
||||||
|
[82] = "%.f", -- LandingGearRedLight
|
||||||
|
-- gauges
|
||||||
|
[10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0}
|
||||||
|
[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0}
|
||||||
|
[9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0}
|
||||||
|
[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
|
||||||
|
[22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1}
|
||||||
|
[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0}
|
||||||
|
[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0}
|
||||||
|
[164] = "%.1f", -- Left_Fluor_Light
|
||||||
|
[165] = "%.1f", -- Right_Fluor_Light
|
||||||
|
[59] = "%.f", -- Hight_Blower_Lamp
|
||||||
|
-- Trimmer
|
||||||
|
[170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0}
|
||||||
|
[172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0}
|
||||||
|
[171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0}
|
||||||
|
[174] = "%.4f", -- Control_Lock_Bracket
|
||||||
|
[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}
|
||||||
|
[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0}
|
||||||
|
-- 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
|
||||||
|
-------------
|
||||||
|
--[413] = "%.1f", -- WindShieldDamages
|
||||||
|
--[412] = "%.1f", -- WindShieldOil
|
||||||
|
}
|
||||||
|
|
||||||
|
ExportScript.ConfigArguments =
|
||||||
|
{
|
||||||
|
--[[
|
||||||
|
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] = "%.4f", -- Right Fluorescent Light (rotary)
|
||||||
|
[90] = "%.4f", -- Left Fluorescent Light (rotary)
|
||||||
|
-- Flight Instrument panel
|
||||||
|
[3] = "%.4f", -- Course Set (rotary)
|
||||||
|
[13] = "%.4f", -- Heading Set/Cage (rotary)
|
||||||
|
[179] = "%d", -- Heading Set/Cage Button
|
||||||
|
[17] = "%.4f", -- Pitch Adjustment (rotary)
|
||||||
|
[18] = "%.4f", -- Cage (rotary)
|
||||||
|
[19] = "%d", -- Cage Button
|
||||||
|
[8] = "%d", -- Winding/Adjustment Clock Button
|
||||||
|
[7] = "%.4f", -- Winding/Adjustment Clock (rotary)
|
||||||
|
[26] = "%.4f", -- Set Pressure (rotary)
|
||||||
|
-- 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 (rotary)
|
||||||
|
[116] = "%.4f", -- Radio Audio Volume (rotary)
|
||||||
|
[44] = "%d", -- Microphone On
|
||||||
|
[200] = "%d", -- Arm rest
|
||||||
|
[129] = "%d", -- Switch Locking Lever
|
||||||
|
[128] = "%d", -- Radio Mode Transmit/Receive/Remote
|
||||||
|
-------------
|
||||||
|
[71] = "%.4f", -- Cockpit Lights (rotary)
|
||||||
|
[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.4f", -- 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 (rotary)
|
||||||
|
-------------
|
||||||
|
[79] = "%d", -- Hydraulic Release Knob
|
||||||
|
[94] = "%.4f", -- Flaps Control Handle (rotary)
|
||||||
|
[84] = "%d", -- Parking Brake Handle
|
||||||
|
[81] = "%d", -- Safe Landing Gear Light Test
|
||||||
|
[83] = "%d", -- Unsafe Landing Gear Light Test
|
||||||
|
-- Detrola receiver
|
||||||
|
[137] = "%.4f", -- Detrola Frequency Selector (rotary)
|
||||||
|
[138] = "%.4f", -- Detrola Volume (rotary)
|
||||||
|
-- canopy
|
||||||
|
[147] = "%.4f", -- Canopy Hand Crank (rotary)
|
||||||
|
[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 (rotary)
|
||||||
|
[92] = "%.4f", -- Elevator Trim (rotary)
|
||||||
|
[93] = "%.4f", -- Rudder Trim (rotary)
|
||||||
|
-------------
|
||||||
|
[157] = "%.4f", -- Defroster (rotary)
|
||||||
|
[158] = "%.4f", -- Cold Air (rotary)
|
||||||
|
[159] = "%.4f", -- Hot Air (rotary)
|
||||||
|
-------------
|
||||||
|
[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 (rotary)
|
||||||
|
[135] = "%0.1f", -- Carburetor Warm Air Control (rotary)
|
||||||
|
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
|
||||||
|
[43] = "%.4f", -- Throttle (rotary)
|
||||||
|
[46] = "%.4f", -- Propeller RPM (rotary)
|
||||||
|
[173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
|
||||||
|
[48] = "%.4f", -- Lock Throttle (rotary)
|
||||||
|
[49] = "%.4f", -- Lock Propeller & Mixture (rotary)
|
||||||
|
[176] = "%d", -- G-meter reset
|
||||||
|
[183] = "%d", -- Mirror
|
||||||
|
}
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- HIGH IMPORTANCE EXPORTS --
|
||||||
|
-- done every export event --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to DAC
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------------------------------
|
||||||
|
-- LOW IMPORTANCE EXPORTS --
|
||||||
|
-- done every gExportLowTickInterval export events --
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
export in low tick interval to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to hardware
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
|
||||||
|
--=====================================================================================
|
||||||
|
--[[
|
||||||
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 0, 13, 1 do
|
||||||
|
ltmp1 = list_indication(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
--[[
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 1, 73, 1 do
|
||||||
|
ltmp1 = GetDevice(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- Custom functions --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
|
end
|
||||||
@ -1,19 +1,19 @@
|
|||||||
-- Su-25T Export
|
-- Su-25T Export
|
||||||
-- Version 0.9.9 BETA
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundFCModule = true
|
ExportScript.FoundFCModule = true
|
||||||
|
|
||||||
-- auxiliary function
|
-- auxiliary function
|
||||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
|
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
|
||||||
-- FC aircraft don't support GetDevice --
|
-- FC aircraft don't support GetDevice --
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||||
|
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||||
local myData = LoGetSelfData()
|
local myData = nil -- = LoGetSelfData()
|
||||||
|
|
||||||
if (myData) then
|
if (myData) then
|
||||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||||
@ -140,15 +140,20 @@ function ProcessGlassCockpitFCHighImportanceConfig()
|
|||||||
FC_Russian_Clock_late(12)
|
FC_Russian_Clock_late(12)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
--WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance()
|
function ExportScript.ProcessDACConfigHighImportance()
|
||||||
|
local lFunctionTyp = "DAC" -- function type for shared function
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||||
|
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||||
|
|
||||||
|
ExportScript.AF.SPO15RWR(lFunctionTyp)
|
||||||
|
ExportScript.AF.WeaponPanel_SU25(lFunctionTyp)
|
||||||
|
|
||||||
if gES_GlassCockpitType == 1 then
|
if gES_GlassCockpitType == 1 then
|
||||||
-- HELIOS Version 1.3
|
-- HELIOS Version 1.3
|
||||||
@ -299,14 +304,14 @@ function ProcessGlassCockpitFCLowImportanceConfig()
|
|||||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance()
|
function ExportScript.ProcessDACConfigLowImportance()
|
||||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
local lFunctionTyp = "DAC" -- function type for shared function
|
||||||
WeaponStatusPanel()
|
-- WeaponStatusPanel()
|
||||||
MechanicalDevicesIndicator()
|
-- MechanicalDevicesIndicator()
|
||||||
StatusLamp()
|
-- StatusLamp()
|
||||||
FuelQuantityIndicator()
|
-- FuelQuantityIndicator()
|
||||||
SightingSystem()
|
-- SightingSystem()
|
||||||
SPO15RWR()
|
-- SPO15RWR()
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
310
Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua
Normal file
310
Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
-- TF-51D Export
|
||||||
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
|
{
|
||||||
|
--[[
|
||||||
|
every frames arguments
|
||||||
|
based of "mainpanel_init.lua"
|
||||||
|
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||||
|
[DeviceID] = "Format"
|
||||||
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
|
]]
|
||||||
|
-- Flight Instruments
|
||||||
|
[11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7}
|
||||||
|
[29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6}
|
||||||
|
-- Altimeter
|
||||||
|
[97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0}
|
||||||
|
[96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0}
|
||||||
|
[24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0}
|
||||||
|
[25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0}
|
||||||
|
-- Artificial horizon
|
||||||
|
[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0}
|
||||||
|
[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
|
||||||
|
[16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0}
|
||||||
|
[20] = "%.1f", -- AHorizon_Caged {0.0, 1.0}
|
||||||
|
-- directional gyro
|
||||||
|
[12] = "%.4f", -- GyroHeading
|
||||||
|
-- turn indicator
|
||||||
|
[27] = "%.4f", -- TurnNeedle {-1.0, 1.0}
|
||||||
|
[28] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||||
|
-- oxygen pressure indicator
|
||||||
|
[34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0}
|
||||||
|
[33] = "%.4f", -- Oxygen_Flow_Blinker
|
||||||
|
-- fuel system
|
||||||
|
[155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
||||||
|
[156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0}
|
||||||
|
[32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0}
|
||||||
|
-- A-11 clock
|
||||||
|
[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0}
|
||||||
|
[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0}
|
||||||
|
[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0}
|
||||||
|
-- AN5730 remote compass
|
||||||
|
[1] = "%.4f", -- CompassHeading
|
||||||
|
[2] = "%.4f", -- CommandedCourse
|
||||||
|
[3] = "%.4f", -- CommandedCourseKnob
|
||||||
|
-- TailRadarWarning
|
||||||
|
[161] = "%.f", -- Lamp TailRadarWarning
|
||||||
|
-- SCR-522A Control panel
|
||||||
|
[122] = "%.f", -- A_channel_light
|
||||||
|
[123] = "%.f", -- B_channel_light
|
||||||
|
[124] = "%.f", -- C_channel_light
|
||||||
|
[125] = "%.f", -- D_channel_light
|
||||||
|
[126] = "%.f", -- Transmit_light
|
||||||
|
-- hydraulic pressure
|
||||||
|
[78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0}
|
||||||
|
-- Landing gears handle
|
||||||
|
[150] = "%.4f", -- Landing_Gear_Handle
|
||||||
|
[151] = "%.4f", -- Landing_Gear_Handle_Indoor
|
||||||
|
[80] = "%.f", -- LandingGearGreenLight
|
||||||
|
[82] = "%.f", -- LandingGearRedLight
|
||||||
|
-- gauges
|
||||||
|
[10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0}
|
||||||
|
[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0}
|
||||||
|
[9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0}
|
||||||
|
[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
|
||||||
|
[22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1}
|
||||||
|
[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0}
|
||||||
|
[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0}
|
||||||
|
[164] = "%.1f", -- Left_Fluor_Light
|
||||||
|
[165] = "%.1f", -- Right_Fluor_Light
|
||||||
|
[59] = "%.f", -- Hight_Blower_Lamp
|
||||||
|
-- Trimmer
|
||||||
|
[170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0}
|
||||||
|
[172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0}
|
||||||
|
[171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0}
|
||||||
|
[174] = "%.4f", -- Control_Lock_Bracket
|
||||||
|
[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}
|
||||||
|
[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0}
|
||||||
|
-- light
|
||||||
|
[185] = "%.1f", -- Left_cockpit_light
|
||||||
|
[186] = "%.1f", -- Right_cockpit_light
|
||||||
|
[190] = "%.4f", -- warEmergencyPowerLimWire
|
||||||
|
}
|
||||||
|
|
||||||
|
ExportScript.ConfigArguments =
|
||||||
|
{
|
||||||
|
--[[
|
||||||
|
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] = "%.4f", -- Right Fluorescent Light (rotary)
|
||||||
|
[90] = "%.4f", -- Left Fluorescent Light (rotary)
|
||||||
|
-- Flight Instrument panel
|
||||||
|
[3] = "%.4f", -- Course Set (rotary)
|
||||||
|
[13] = "%.4f", -- Heading Set/Cage (rotary)
|
||||||
|
[179] = "%d", -- Heading Set/Cage Button
|
||||||
|
[17] = "%.4f", -- Pitch Adjustment (rotary)
|
||||||
|
[18] = "%.4f", -- Cage (rotary)
|
||||||
|
[19] = "%d", -- Cage Button
|
||||||
|
[8] = "%d", -- Winding/Adjustment Clock Button
|
||||||
|
[7] = "%.4f", -- Winding/Adjustment Clock (rotary)
|
||||||
|
[26] = "%.4f", -- Set Pressure (rotary)
|
||||||
|
-- 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 (rotary)
|
||||||
|
[116] = "%.4f", -- Radio Audio Volume (rotary)
|
||||||
|
[44] = "%d", -- Microphone On
|
||||||
|
[129] = "%d", -- Switch Locking Lever
|
||||||
|
[128] = "%d", -- Radio Mode Transmit/Receive/Remote
|
||||||
|
-------------
|
||||||
|
[71] = "%.4f", -- Cockpit Lights (rotary)
|
||||||
|
[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 (rotary)
|
||||||
|
-------------
|
||||||
|
[79] = "%d", -- Hydraulic Release Knob
|
||||||
|
[94] = "%.4f", -- Flaps Control Handle (rotary)
|
||||||
|
[84] = "%d", -- Parking Brake Handle
|
||||||
|
[81] = "%d", -- Safe Landing Gear Light Test
|
||||||
|
[83] = "%d", -- Unsafe Landing Gear Light Test
|
||||||
|
-- Detrola receiver
|
||||||
|
[137] = "%.4f", -- Detrola Frequency Selector (rotary)
|
||||||
|
[138] = "%.4f", -- Detrola Volume (rotary)
|
||||||
|
-- canopy
|
||||||
|
[147] = "%.4f", -- Canopy Hand Crank (rotary)
|
||||||
|
[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 (rotary)
|
||||||
|
[92] = "%.4f", -- Elevator Trim (rotary)
|
||||||
|
[93] = "%.4f", -- Rudder Trim (rotary)
|
||||||
|
-------------
|
||||||
|
[157] = "%.4f", -- Defroster (rotary)
|
||||||
|
[158] = "%.4f", -- Cold Air (rotary)
|
||||||
|
[159] = "%.4f", -- Hot Air (rotary)
|
||||||
|
-------------
|
||||||
|
[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 (rotary)
|
||||||
|
[135] = "%0.1f", -- Carburetor Warm Air Control (rotary)
|
||||||
|
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
|
||||||
|
[43] = "%.4f", -- Throttle (rotary)
|
||||||
|
[46] = "%.4f", -- Propeller RPM (rotary)
|
||||||
|
[173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
|
||||||
|
[48] = "%.4f", -- Lock Throttle (rotary)
|
||||||
|
[49] = "%.4f", -- Lock Propeller & Mixture (rotary)
|
||||||
|
[176] = "%d", -- G-meter reset
|
||||||
|
[183] = "%d", -- 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] = "%.1f", -- Gun Sight Brightness
|
||||||
|
[35] = "%.1f", -- Wing Span Selector
|
||||||
|
-------------
|
||||||
|
[132] = "%.4f", -- Left Payload Salvo
|
||||||
|
[133] = "%.4f" -- Right Payload Salvo
|
||||||
|
}
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- HIGH IMPORTANCE EXPORTS --
|
||||||
|
-- done every export event --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to DAC
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
-----------------------------------------------------
|
||||||
|
-- LOW IMPORTANCE EXPORTS --
|
||||||
|
-- done every gExportLowTickInterval export events --
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
export in low tick interval to Ikarus
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
|
--[[
|
||||||
|
every frame export to hardware
|
||||||
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
|
get data from device
|
||||||
|
local UHF_RADIO = GetDevice(54)
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
|
]]
|
||||||
|
|
||||||
|
--=====================================================================================
|
||||||
|
--[[
|
||||||
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
|
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||||
|
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 0, 13, 1 do
|
||||||
|
ltmp1 = list_indication(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
--[[
|
||||||
|
local ltmp1 = 0
|
||||||
|
for ltmp2 = 1, 73, 1 do
|
||||||
|
ltmp1 = GetDevice(ltmp2)
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- Custom functions --
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
|
end
|
||||||
@ -1,9 +1,9 @@
|
|||||||
-- Uh-1H Export
|
-- Uh-1H Export
|
||||||
-- Version 0.9.9 BETA
|
-- Version 1.0.0 BETA
|
||||||
|
|
||||||
gES_FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
|
||||||
gES_GlassCockpitConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
every frames arguments
|
every frames arguments
|
||||||
@ -13,6 +13,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||||
[129] = "%1d", <- decimal number
|
[129] = "%1d", <- decimal number
|
||||||
|
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||||
]]
|
]]
|
||||||
-- Controlls Pilot
|
-- Controlls Pilot
|
||||||
--[184] = "%.4f", -- rudder
|
--[184] = "%.4f", -- rudder
|
||||||
@ -140,9 +141,9 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
--[438] = "%.4f", -- PilotSightHeight
|
--[438] = "%.4f", -- PilotSightHeight
|
||||||
--[442] = "%.2f", -- PilotSightGlass
|
--[442] = "%.2f", -- PilotSightGlass
|
||||||
-- Light
|
-- Light
|
||||||
--[279] = "%.4f", -- light_ConsoleLight
|
[279] = "%.4f", -- light_ConsoleLight
|
||||||
--[410] = "%.4f", -- light_DomeLight
|
[410] = "%.4f", -- light_DomeLight
|
||||||
--[411] = "%.4f", -- light_DomeLightGreen
|
[411] = "%.4f", -- light_DomeLightGreen
|
||||||
-- Damage
|
-- Damage
|
||||||
--[248] = "%.1f", -- DeadPilot
|
--[248] = "%.1f", -- DeadPilot
|
||||||
--[249] = "%.1f", -- DeadCoPilot
|
--[249] = "%.1f", -- DeadCoPilot
|
||||||
@ -160,8 +161,8 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
-- Radar Altimeter
|
-- Radar Altimeter
|
||||||
[443] = "%.4f", -- RALT_Needle {0.0, 0.98} {0.0, 0.98}
|
[443] = "%.4f", -- RALT_Needle {0.0, 0.98} {0.0, 0.98}
|
||||||
[467] = "%.1f", -- RALT_Off_Flag
|
[467] = "%.1f", -- RALT_Off_Flag
|
||||||
[447] = "%.1f", -- RALT_LO_Lamp
|
[447] = "%.f", -- RALT_LO_Lamp
|
||||||
[465] = "%.1f", -- RALT_HI_Lamp
|
[465] = "%.f", -- RALT_HI_Lamp
|
||||||
[444] = "%.4f", -- RALT_LO_Index {-0.02, -0.01, -0.0001,0.0, 0.744} {0.97, 0.99, 1.0, 0.0, 0.744}
|
[444] = "%.4f", -- RALT_LO_Index {-0.02, -0.01, -0.0001,0.0, 0.744} {0.97, 0.99, 1.0, 0.0, 0.744}
|
||||||
[466] = "%.4f", -- RALT_HI_Index {0.0, 0.744} {0.0, 0.744}
|
[466] = "%.4f", -- RALT_HI_Index {0.0, 0.744} {0.0, 0.744}
|
||||||
[468] = "%0.1f", -- RALT_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
[468] = "%0.1f", -- RALT_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
||||||
@ -169,45 +170,45 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[470] = "%0.1f", -- RALT_Digit_3 {0.0, 10.0} {0.0, 1.0}
|
[470] = "%0.1f", -- RALT_Digit_3 {0.0, 10.0} {0.0, 1.0}
|
||||||
[471] = "%0.1f", -- RALT_Digit_4 {0.0, 10.0} {0.0, 1.0}
|
[471] = "%0.1f", -- RALT_Digit_4 {0.0, 10.0} {0.0, 1.0}
|
||||||
-- FLARE CHAFF
|
-- FLARE CHAFF
|
||||||
[460] = "%1d", -- FLARE_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
[460] = "%.1f", -- FLARE_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
||||||
[461] = "%1d", -- FLARE_Digit_2 {0.0, 10.0} {0.0, 1.0}
|
[461] = "%.1f", -- FLARE_Digit_2 {0.0, 10.0} {0.0, 1.0}
|
||||||
[462] = "%1d", -- CHAFF_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
[462] = "%.1f", -- CHAFF_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
||||||
[463] = "%1d", -- CHAFF_Digit_2 {0.0, 10.0} {0.0, 1.0}
|
[463] = "%.1f", -- CHAFF_Digit_2 {0.0, 10.0} {0.0, 1.0}
|
||||||
-- XM130 Chaff Flare
|
-- XM130 Chaff Flare
|
||||||
[458] = "%.1f", -- lamp_XM130_ARMED
|
[458] = "%.f", -- lamp_XM130_ARMED
|
||||||
-- SIGHTS_FOR_CIVIL
|
-- SIGHTS_FOR_CIVIL
|
||||||
[473] = "$.1f", -- SIGHTS_FOR_CIVIL
|
[473] = "$.1f", -- SIGHTS_FOR_CIVIL
|
||||||
-- Main Panel Lights
|
-- Main Panel Lights
|
||||||
[277] = "%.1f", -- lamp_MASTER
|
[277] = "%.f", -- lamp_MASTER
|
||||||
[276] = "%.1f", -- lamp_LOW_RPM
|
[276] = "%.f", -- lamp_LOW_RPM
|
||||||
[275] = "%.1f", -- lamp_FIRE
|
[275] = "%.f", -- lamp_FIRE
|
||||||
-- Caution Panel Lights
|
-- Caution Panel Lights
|
||||||
[91] = "%.1f", -- lamp_ENGINE_OIL_PRESS
|
[91] = "%.f", -- lamp_ENGINE_OIL_PRESS
|
||||||
[92] = "%.1f", -- lamp_ENGINE_ICING
|
[92] = "%.f", -- lamp_ENGINE_ICING
|
||||||
[93] = "%.1f", -- lamp_ENGINE_ICE_JET
|
[93] = "%.f", -- lamp_ENGINE_ICE_JET
|
||||||
[94] = "%.1f", -- lamp_ENGINE_CHIP_DET
|
[94] = "%.f", -- lamp_ENGINE_CHIP_DET
|
||||||
[95] = "%.1f", -- lamp_LEFT_FUEL_BOOST
|
[95] = "%.f", -- lamp_LEFT_FUEL_BOOST
|
||||||
[96] = "%.1f", -- lamp_RIGHT_FUEL_BOOST
|
[96] = "%.f", -- lamp_RIGHT_FUEL_BOOST
|
||||||
[97] = "%.1f", -- lamp_ENG_FUEL_PUMP
|
[97] = "%.f", -- lamp_ENG_FUEL_PUMP
|
||||||
[98] = "%.1f", -- lamp_20_MINUTE
|
[98] = "%.f", -- lamp_20_MINUTE
|
||||||
[99] = "%.1f", -- lamp_FUEL_FILTER
|
[99] = "%.f", -- lamp_FUEL_FILTER
|
||||||
[100] = "%.1f", -- lamp_GOV_EMERG
|
[100] = "%.f", -- lamp_GOV_EMERG
|
||||||
[101] = "%.1f", -- lamp_AUX_FUEL_LOW
|
[101] = "%.f", -- lamp_AUX_FUEL_LOW
|
||||||
[102] = "%.1f", -- lamp_XMSN_OIL_PRESS
|
[102] = "%.f", -- lamp_XMSN_OIL_PRESS
|
||||||
[103] = "%.1f", -- lamp_XMSN_OIL_HOT
|
[103] = "%.f", -- lamp_XMSN_OIL_HOT
|
||||||
[104] = "%.1f", -- lamp_HYD_PRESSURE
|
[104] = "%.f", -- lamp_HYD_PRESSURE
|
||||||
[105] = "%.1f", -- lamp_ENGINE_INLET_AIR
|
[105] = "%.f", -- lamp_ENGINE_INLET_AIR
|
||||||
[106] = "%.1f", -- lamp_INST_INVERTER
|
[106] = "%.f", -- lamp_INST_INVERTER
|
||||||
[107] = "%.1f", -- lamp_DC_GENERATOR
|
[107] = "%.f", -- lamp_DC_GENERATOR
|
||||||
[108] = "%.1f", -- lamp_EXTERNAL_POWER
|
[108] = "%.f", -- lamp_EXTERNAL_POWER
|
||||||
[109] = "%.1f", -- lamp_CHIP_DETECTOR
|
[109] = "%.f", -- lamp_CHIP_DETECTOR
|
||||||
[110] = "%.1f", -- lamp_IFF
|
[110] = "%.f", -- lamp_IFF
|
||||||
-- M21
|
-- M21
|
||||||
[254] = "%.1f", -- lamp_M21_ARMED
|
[254] = "%.f", -- lamp_M21_ARMED
|
||||||
[255] = "%.1f", -- lamp_M21_SAFE
|
[255] = "%.f", -- lamp_M21_SAFE
|
||||||
--
|
--
|
||||||
[76] = "%.1f", -- lamp_IFF_REPLY
|
[76] = "%.f", -- lamp_IFF_REPLY
|
||||||
[77] = "%.1f", -- lamp_IFF_TEST
|
[77] = "%.f", -- lamp_IFF_TEST
|
||||||
-- Electic Gauges
|
-- Electic Gauges
|
||||||
[526] = "%.4f", -- DC_voltage {0.0, 30.0} {0.0, 1.0}
|
[526] = "%.4f", -- DC_voltage {0.0, 30.0} {0.0, 1.0}
|
||||||
[532] = "%.2f", -- AC_voltage {0.0, 100.0, 150.0, 200.0, 250.0} {0.0, 0.14, 0.31, 0.56, 1.0}
|
[532] = "%.2f", -- AC_voltage {0.0, 100.0, 150.0, 200.0, 250.0} {0.0, 0.14, 0.31, 0.56, 1.0}
|
||||||
@ -220,7 +221,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
|||||||
[534] = "%.2f", -- AC_generator_II_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0}
|
[534] = "%.2f", -- AC_generator_II_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0}
|
||||||
[371] = "%.2f" -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0}
|
[371] = "%.2f" -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0}
|
||||||
}
|
}
|
||||||
gES_GlassCockpitConfigArguments =
|
ExportScript.ConfigArguments =
|
||||||
{
|
{
|
||||||
--[[
|
--[[
|
||||||
arguments for export in low tick interval
|
arguments for export in low tick interval
|
||||||
@ -502,370 +503,30 @@ gES_GlassCockpitConfigArguments =
|
|||||||
-- done every export event --
|
-- done every export event --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||||
if gES_GlassCockpitType == 1 then
|
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||||
-- HELIOS Version 1.3
|
--[[
|
||||||
elseif gES_GlassCockpitType == 2 then
|
export in low tick interval to Ikarus
|
||||||
-- HawgTouch Version 1.6
|
Example from A-10C
|
||||||
|
Get Radio Frequencies
|
||||||
-- Pilot Gauges
|
get data from device
|
||||||
|
local lUHFRadio = GetDevice(54)
|
||||||
-- Airspeed indicator
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
-- [117] = "%0.4f", -- AIRSPEED_Nose
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
-- {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0}
|
]]
|
||||||
-- {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0}
|
|
||||||
|
|
||||||
-- Attitude Indicators
|
|
||||||
-- ADI - pilot
|
|
||||||
-- [142] = "%.4f", -- Attitude_Roll
|
|
||||||
-- [143] = "%.4f", -- Attitude_Pitch
|
|
||||||
-- [148] = "%.1f", -- Attitude_Off_flag
|
|
||||||
SendData("2000", string.format("%0.4f;%0.4f;%0.1f",
|
|
||||||
mainPanelDevice:get_argument_value(142),
|
|
||||||
mainPanelDevice:get_argument_value(143),
|
|
||||||
mainPanelDevice:get_argument_value(148)))
|
|
||||||
|
|
||||||
-- Dual tachometer
|
|
||||||
-- [122] = "%.4f", -- EngineTach
|
|
||||||
-- [123] = "%.4f", -- RotorTach
|
|
||||||
SendData("2001", string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(122),
|
|
||||||
mainPanelDevice:get_argument_value(123)))
|
|
||||||
|
|
||||||
-- Altimeter Indicator (AAU-31/A)
|
|
||||||
-- Altimeter Indicator AAU-7/A (pilot)
|
|
||||||
-- [182] = "%.4f", -- Press_AAU_7A
|
|
||||||
-- [178] = "%.4f", -- Alt_10000_AAU_7A
|
|
||||||
-- [179] = "%.4f", -- Alt_1000_AAU_7A
|
|
||||||
-- [180] = "%.4f", -- Alt_100_AAU_7A
|
|
||||||
SendData("2002", string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(182),
|
|
||||||
mainPanelDevice:get_argument_value(178),
|
|
||||||
mainPanelDevice:get_argument_value(179),
|
|
||||||
mainPanelDevice:get_argument_value(180)))
|
|
||||||
|
|
||||||
-- Radio Compass Indicator
|
|
||||||
-- GMC
|
|
||||||
-- [159] = "%.4f", -- GMC_CoursePointer1
|
|
||||||
-- [160] = "%.4f", -- GMC_CoursePointer2
|
|
||||||
-- [165] = "%.4f", -- GMC_Heading
|
|
||||||
-- [162] = "%.4f", -- GMC_HeadingMarker
|
|
||||||
-- [166] = "%.4f", -- GMC_Annunciator
|
|
||||||
-- [167] = "%.2f", -- GMC_PowerFail
|
|
||||||
SendData("2003", string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.2f",
|
|
||||||
mainPanelDevice:get_argument_value(159),
|
|
||||||
mainPanelDevice:get_argument_value(160),
|
|
||||||
mainPanelDevice:get_argument_value(165),
|
|
||||||
mainPanelDevice:get_argument_value(162),
|
|
||||||
mainPanelDevice:get_argument_value(166),
|
|
||||||
mainPanelDevice:get_argument_value(167)))
|
|
||||||
|
|
||||||
-- Vertical velocity indicator
|
|
||||||
-- [134] = "%.2f", -- VertVelocPilot
|
|
||||||
-- {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0}
|
|
||||||
-- {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0}
|
|
||||||
|
|
||||||
-- Exhaust gas temperature indicator
|
|
||||||
-- [121] = "%.4f", -- ExhaustTem
|
|
||||||
|
|
||||||
-- Gas Producer Tachometer Indicator
|
|
||||||
-- [119] = "%.4f", -- GasProducerTach
|
|
||||||
-- [120] = "%.4f", -- GasProducerTach_U
|
|
||||||
SendData("2004", string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(119),
|
|
||||||
mainPanelDevice:get_argument_value(120)))
|
|
||||||
|
|
||||||
-- Turn and slip indicator
|
|
||||||
-- [132] = "%.4f", -- TurnPtr
|
|
||||||
-- [133] = "%.4f", -- SideSlip
|
|
||||||
SendData("2005", string.format("%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(132),
|
|
||||||
mainPanelDevice:get_argument_value(133)))
|
|
||||||
|
|
||||||
-- Torquemeter Indicator
|
|
||||||
-- [124] = "%.4f", -- TorquePress
|
|
||||||
-- {-3.0, 0.0, 100.0}
|
|
||||||
-- {0.0, 0.029, 1.0}
|
|
||||||
|
|
||||||
-- Mechanic clock
|
|
||||||
-- [127] = "%.4f", -- CLOCK_hours
|
|
||||||
-- [128] = "%.4f", -- CLOCK_minutes
|
|
||||||
-- [129] = "%.4f", -- CLOCK_seconds
|
|
||||||
SendData("2006", string.format("%0.4f;%0.4f;%0.1f",
|
|
||||||
mainPanelDevice:get_argument_value(127),
|
|
||||||
mainPanelDevice:get_argument_value(128),
|
|
||||||
mainPanelDevice:get_argument_value(129)))
|
|
||||||
|
|
||||||
-- Course deviation indicator
|
|
||||||
-- Course Indicator ID-1347
|
|
||||||
-- [151] = "%.4f", -- VerticalBar
|
|
||||||
-- {-1.0, 1.0}
|
|
||||||
-- {-0.7, 0.7}
|
|
||||||
-- [152] = "%.4f", -- HorisontalBar
|
|
||||||
-- {-1.0, 1.0}
|
|
||||||
-- {-0.7, 0.7}
|
|
||||||
-- [153] = "%.4f", -- ToMarker
|
|
||||||
-- [154] = "%.4f", -- FromMarker
|
|
||||||
-- [156] = "%.4f", -- RotCourseCard
|
|
||||||
-- [157] = "%.1f", -- VerticalOFF
|
|
||||||
-- [158] = "%.1f", -- HorisontalOFF
|
|
||||||
SendData("2007", string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(151),
|
|
||||||
mainPanelDevice:get_argument_value(152),
|
|
||||||
mainPanelDevice:get_argument_value(153),
|
|
||||||
mainPanelDevice:get_argument_value(154),
|
|
||||||
mainPanelDevice:get_argument_value(156),
|
|
||||||
mainPanelDevice:get_argument_value(157),
|
|
||||||
mainPanelDevice:get_argument_value(158)))
|
|
||||||
|
|
||||||
-- Standby magnetic compass
|
|
||||||
-- no ID
|
|
||||||
-- SendData("2008", string.format("%0.4f;%0.4f;%0.1f",
|
|
||||||
-- mainPanelDevice:get_argument_value(),
|
|
||||||
-- mainPanelDevice:get_argument_value(),
|
|
||||||
-- mainPanelDevice:get_argument_value()))
|
|
||||||
|
|
||||||
-- Radar Altimeter - AN/APN-209
|
|
||||||
-- [443] = "%.4f", -- RALT_Needle
|
|
||||||
-- [467] = "%.2f", -- RALT_Off_Flag
|
|
||||||
-- [447] = "%.1f", -- RALT_LO_Lamp
|
|
||||||
-- [465] = "%.1f", -- RALT_HI_Lamp
|
|
||||||
-- [444] = "%.4f", -- RALT_LO_Index
|
|
||||||
-- {-0.02, -0.01, -0.0001,0.0, 0.744}
|
|
||||||
-- {0.97, 0.99, 1.0, 0.0, 0.744}
|
|
||||||
-- [466] = "%.4f", -- RALT_HI_Index
|
|
||||||
-- {0.0, 0.744}
|
|
||||||
-- {0.0, 0.744}
|
|
||||||
-- [468] = "%0.1f", -- RALT_Digit_1
|
|
||||||
-- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' '
|
|
||||||
-- [469] = "%0.1f", -- RALT_Digit_2
|
|
||||||
-- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' '
|
|
||||||
-- [470] = "%0.1f", -- RALT_Digit_3
|
|
||||||
-- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' '
|
|
||||||
-- [471] = "%0.1f", -- RALT_Digit_4
|
|
||||||
-- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' '
|
|
||||||
SendData("2009", string.format("%0.4f;%0.2f;%0.1f;%0.1f;%.4f;%.4f;%0.1f;%0.1f;%0.1f;%0.1f",
|
|
||||||
mainPanelDevice:get_argument_value(443),
|
|
||||||
mainPanelDevice:get_argument_value(467),
|
|
||||||
mainPanelDevice:get_argument_value(447),
|
|
||||||
mainPanelDevice:get_argument_value(465),
|
|
||||||
mainPanelDevice:get_argument_value(444),
|
|
||||||
mainPanelDevice:get_argument_value(466),
|
|
||||||
mainPanelDevice:get_argument_value(468),
|
|
||||||
mainPanelDevice:get_argument_value(469),
|
|
||||||
mainPanelDevice:get_argument_value(470),
|
|
||||||
mainPanelDevice:get_argument_value(471)))
|
|
||||||
|
|
||||||
-- CoPilot Gauges
|
|
||||||
|
|
||||||
-- Airspeed indicator
|
|
||||||
-- [117] = "%0.4f", -- AIRSPEED_Nose
|
|
||||||
-- {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0}
|
|
||||||
-- {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0}
|
|
||||||
|
|
||||||
-- Attitude Indicators
|
|
||||||
-- ADI - operator
|
|
||||||
-- [135] = "%.4f", -- Attitude_Roll_left
|
|
||||||
-- [136] = "%.4f", -- Attitude_Pitch_left
|
|
||||||
-- [141] = "%.1f", -- Attitude_Off_flag_left
|
|
||||||
-- [138] = "%.4f", -- Attitude_PitchShift
|
|
||||||
SendData("2010", string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(135),
|
|
||||||
mainPanelDevice:get_argument_value(136),
|
|
||||||
mainPanelDevice:get_argument_value(141),
|
|
||||||
mainPanelDevice:get_argument_value(138)))
|
|
||||||
|
|
||||||
-- Radio compass indicator
|
|
||||||
-- GMC
|
|
||||||
-- [266] = "%.4f", -- GMC_CoursePointer1
|
|
||||||
-- [267] = "%.4f", -- GMC_CoursePointer2
|
|
||||||
-- [269] = "%.4f", -- GMC_Heading
|
|
||||||
SendData("2011", string.format("%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(266),
|
|
||||||
mainPanelDevice:get_argument_value(267),
|
|
||||||
mainPanelDevice:get_argument_value(269)))
|
|
||||||
|
|
||||||
-- Altimeter indicator (AAU-32/A)
|
|
||||||
-- [168] = "%.4f", -- Pointer
|
|
||||||
-- [169] = "%.4f", -- Alt1AAU_10000_footCount
|
|
||||||
-- [170] = "%.4f", -- Alt1AAU_1000_footCount
|
|
||||||
-- [171] = "%.4f", -- Alt1AAU_100_footCount
|
|
||||||
-- [174] = "%.2f", -- AAU_32_Drum_Counter
|
|
||||||
-- [175] = "%.2f", -- AAU_32_Drum_Counter
|
|
||||||
-- [176] = "%.2f", -- AAU_32_Drum_Counter
|
|
||||||
-- [177] = "%.1f", -- CodeOff_flag
|
|
||||||
SendData("2012", string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.2f;%0.2f;%0.2f;%0.1f",
|
|
||||||
mainPanelDevice:get_argument_value(168),
|
|
||||||
mainPanelDevice:get_argument_value(169),
|
|
||||||
mainPanelDevice:get_argument_value(170),
|
|
||||||
mainPanelDevice:get_argument_value(171),
|
|
||||||
mainPanelDevice:get_argument_value(174),
|
|
||||||
mainPanelDevice:get_argument_value(175),
|
|
||||||
mainPanelDevice:get_argument_value(176),
|
|
||||||
mainPanelDevice:get_argument_value(177)))
|
|
||||||
|
|
||||||
-- Whisky Compass
|
|
||||||
-- [269] = "%.4f", -- RMI_Heading
|
|
||||||
-- [142] = "%.4f", -- Attitude_Roll
|
|
||||||
-- [143] = "%.4f", -- Attitude_Pitch
|
|
||||||
SendData("2013", string.format("%0.4f;%0.4f;%0.4f",
|
|
||||||
mainPanelDevice:get_argument_value(269),
|
|
||||||
mainPanelDevice:get_argument_value(142),
|
|
||||||
mainPanelDevice:get_argument_value(143)))
|
|
||||||
|
|
||||||
-- Vertical velocity indicator
|
|
||||||
-- [251] = "%.2f", -- VertVelocCopilot
|
|
||||||
-- {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0}
|
|
||||||
-- {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0}
|
|
||||||
|
|
||||||
-- Fuel Pressure Indicator
|
|
||||||
-- [126] = "%.4f", -- FuelPress
|
|
||||||
-- {-2.0, 0.0, 50.0}
|
|
||||||
-- {0.0, 0.015, 1.0}
|
|
||||||
|
|
||||||
-- Transmission oil pressure
|
|
||||||
-- [115] = "%.4f", -- TransmOilPress
|
|
||||||
-- {-3.0, 0.0, 100.0}
|
|
||||||
-- {0.0, 0.029, 1.0}
|
|
||||||
|
|
||||||
-- DC Loadmeters (Main)
|
|
||||||
-- [436] = "%.4f", -- LoadmeterMainGen
|
|
||||||
-- {-1.5, 0.0, 12.5}
|
|
||||||
-- {0.0, 0.156, 1.0}
|
|
||||||
|
|
||||||
-- DC Loadmeters (Standby)
|
|
||||||
-- [125] = "%.4f", -- LoadmeterSTBYGen
|
|
||||||
-- {-1.5, 0.0, 12.5}
|
|
||||||
-- {0.0, 0.09, 1.0}
|
|
||||||
|
|
||||||
-- Engine oil pressure indicator
|
|
||||||
-- [113] = "%.4f", -- EngOilPress
|
|
||||||
-- {-3.0, 0.0, 100.0}
|
|
||||||
-- {0.0, 0.029, 1.0}
|
|
||||||
|
|
||||||
-- AC voltmeter
|
|
||||||
-- [150] = "%.4f", -- VoltageAC
|
|
||||||
|
|
||||||
-- DC voltmeter
|
|
||||||
-- [149] = "%.4f", -- VoltageDC
|
|
||||||
|
|
||||||
-- Transmission oil temperature indicator
|
|
||||||
-- [116] = "%.4f", -- TransmOilTemp
|
|
||||||
-- {-70.0, -50.0, 0.0, 100.0, 150.0}
|
|
||||||
-- {0.0, 0.13, 0.38, 0.71, 1.0}
|
|
||||||
|
|
||||||
-- Engine oil temperature
|
|
||||||
-- [114] = "%.4f", -- EngOilTemp
|
|
||||||
-- {-70.0, -50.0, 0.0, 100.0, 150.0}
|
|
||||||
-- {0.0, 0.13, 0.38, 0.71, 1.0}
|
|
||||||
|
|
||||||
-- Fuel Quantity Indicator
|
|
||||||
-- [239] = "%.4f", -- FuelQuantity
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
every frame export to hardware
|
every frame export to DAC
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local UHF_RADIO = GetDevice(54)
|
local UHF_RADIO = GetDevice(54)
|
||||||
SendDataHW("ExportID", "Format")
|
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("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
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||||
]]
|
|
||||||
|
|
||||||
-- no dimming lights
|
|
||||||
-- Light
|
|
||||||
SendDataHW("279", mainPanelDevice:get_argument_value(279) > 0.3 and 1 or 0) -- light_ConsoleLight
|
|
||||||
SendDataHW("410", mainPanelDevice:get_argument_value(410) > 0.3 and 1 or 0) -- light_DomeLight
|
|
||||||
SendDataHW("411", mainPanelDevice:get_argument_value(411) > 0.3 and 1 or 0) -- light_DomeLightGreen
|
|
||||||
-- Radar Altimeter
|
|
||||||
SendDataHW("447", mainPanelDevice:get_argument_value(447) > 0.3 and 1 or 0) -- RALT_LO_Lamp
|
|
||||||
SendDataHW("465", mainPanelDevice:get_argument_value(465) > 0.3 and 1 or 0) -- RALT_HI_Lamp
|
|
||||||
-- Main Panel Lights
|
|
||||||
SendDataHW("277", mainPanelDevice:get_argument_value(277) > 0.3 and 1 or 0) -- lamp_MASTER
|
|
||||||
SendDataHW("276", mainPanelDevice:get_argument_value(276) > 0.3 and 1 or 0) -- lamp_LOW_RPM
|
|
||||||
SendDataHW("275", mainPanelDevice:get_argument_value(275) > 0.3 and 1 or 0) -- lamp_FIRE
|
|
||||||
-- Caution Panel Lights
|
|
||||||
SendDataHW("91", mainPanelDevice:get_argument_value(91) > 0.3 and 1 or 0) -- lamp_ENGINE_OIL_PRESS
|
|
||||||
SendDataHW("92", mainPanelDevice:get_argument_value(92) > 0.3 and 1 or 0) -- lamp_ENGINE_ICING
|
|
||||||
SendDataHW("93", mainPanelDevice:get_argument_value(93) > 0.3 and 1 or 0) -- lamp_ENGINE_ICE_JET
|
|
||||||
SendDataHW("94", mainPanelDevice:get_argument_value(94) > 0.3 and 1 or 0) -- lamp_ENGINE_CHIP_DET
|
|
||||||
SendDataHW("95", mainPanelDevice:get_argument_value(95) > 0.3 and 1 or 0) -- lamp_LEFT_FUEL_BOOST
|
|
||||||
SendDataHW("96", mainPanelDevice:get_argument_value(96) > 0.3 and 1 or 0) -- lamp_RIGHT_FUEL_BOOST
|
|
||||||
SendDataHW("97", mainPanelDevice:get_argument_value(97) > 0.3 and 1 or 0) -- lamp_ENG_FUEL_PUMP
|
|
||||||
SendDataHW("98", mainPanelDevice:get_argument_value(98) > 0.3 and 1 or 0) -- lamp_20_MINUTE
|
|
||||||
SendDataHW("99", mainPanelDevice:get_argument_value(99) > 0.3 and 1 or 0) -- lamp_FUEL_FILTER
|
|
||||||
SendDataHW("100", mainPanelDevice:get_argument_value(100) > 0.3 and 1 or 0) -- lamp_GOV_EMERG
|
|
||||||
SendDataHW("101", mainPanelDevice:get_argument_value(101) > 0.3 and 1 or 0) -- lamp_AUX_FUEL_LOW
|
|
||||||
SendDataHW("102", mainPanelDevice:get_argument_value(102) > 0.3 and 1 or 0) -- lamp_XMSN_OIL_PRESS
|
|
||||||
SendDataHW("103", mainPanelDevice:get_argument_value(103) > 0.3 and 1 or 0) -- lamp_XMSN_OIL_HOT
|
|
||||||
SendDataHW("104", mainPanelDevice:get_argument_value(104) > 0.3 and 1 or 0) -- lamp_HYD_PRESSURE
|
|
||||||
SendDataHW("105", mainPanelDevice:get_argument_value(105) > 0.3 and 1 or 0) -- lamp_ENGINE_INLET_AIR
|
|
||||||
SendDataHW("106", mainPanelDevice:get_argument_value(106) > 0.3 and 1 or 0) -- lamp_INST_INVERTER
|
|
||||||
SendDataHW("107", mainPanelDevice:get_argument_value(107) > 0.3 and 1 or 0) -- lamp_DC_GENERATOR
|
|
||||||
SendDataHW("108", mainPanelDevice:get_argument_value(108) > 0.3 and 1 or 0) -- lamp_EXTERNAL_POWER
|
|
||||||
SendDataHW("109", mainPanelDevice:get_argument_value(109) > 0.3 and 1 or 0) -- lamp_CHIP_DETECTOR
|
|
||||||
SendDataHW("110", mainPanelDevice:get_argument_value(110) > 0.3 and 1 or 0) -- lamp_IFF
|
|
||||||
-- M21
|
|
||||||
SendDataHW("254", mainPanelDevice:get_argument_value(254) > 0.3 and 1 or 0) -- lamp_M21_ARMED
|
|
||||||
SendDataHW("255", mainPanelDevice:get_argument_value(255) > 0.3 and 1 or 0) -- lamp_M21_SAFE
|
|
||||||
-- IFF
|
|
||||||
SendDataHW("76", mainPanelDevice:get_argument_value(76) > 0.3 and 1 or 0) -- lamp_IFF_REPLY
|
|
||||||
SendDataHW("77", mainPanelDevice:get_argument_value(77) > 0.3 and 1 or 0) -- lamp_IFF_TEST
|
|
||||||
-- Beacon
|
|
||||||
SendDataHW("56", mainPanelDevice:get_argument_value(56) > 0.3 and 1 or 0) -- lamp_Marker_Beacon
|
|
||||||
-- XM130 Chaff Flare
|
|
||||||
SendDataHW("458", mainPanelDevice:get_argument_value(458) > 0.3 and 1 or 0) -- lamp_XM130_ARMED
|
|
||||||
|
|
||||||
--[[
|
|
||||||
-- dimming lights
|
|
||||||
-- Light
|
|
||||||
SendDataHW("279", string.format("%.1f", mainPanelDevice:get_argument_value(279))) -- light_ConsoleLight
|
|
||||||
SendDataHW("410", string.format("%.1f", mainPanelDevice:get_argument_value(410))) -- light_DomeLight
|
|
||||||
SendDataHW("411", string.format("%.1f", mainPanelDevice:get_argument_value(411))) -- light_DomeLightGreen
|
|
||||||
-- Radar Altimeter
|
|
||||||
SendDataHW("447", string.format("%.1f", mainPanelDevice:get_argument_value(447))) -- RALT_LO_Lamp
|
|
||||||
SendDataHW("465", string.format("%.1f", mainPanelDevice:get_argument_value(465))) -- RALT_HI_Lamp
|
|
||||||
-- Main Panel Lights
|
|
||||||
SendDataHW("277", string.format("%.1f", mainPanelDevice:get_argument_value(277))) -- lamp_MASTER
|
|
||||||
SendDataHW("276", string.format("%.1f", mainPanelDevice:get_argument_value(276))) -- lamp_LOW_RPM
|
|
||||||
SendDataHW("275", string.format("%.1f", mainPanelDevice:get_argument_value(275))) -- lamp_FIRE
|
|
||||||
-- Caution Panel Lights
|
|
||||||
SendDataHW("91", string.format("%.1f", mainPanelDevice:get_argument_value(91))) -- lamp_ENGINE_OIL_PRESS
|
|
||||||
SendDataHW("92", string.format("%.1f", mainPanelDevice:get_argument_value(92))) -- lamp_ENGINE_ICING
|
|
||||||
SendDataHW("93", string.format("%.1f", mainPanelDevice:get_argument_value(93))) -- lamp_ENGINE_ICE_JET
|
|
||||||
SendDataHW("94", string.format("%.1f", mainPanelDevice:get_argument_value(94))) -- lamp_ENGINE_CHIP_DET
|
|
||||||
SendDataHW("95", string.format("%.1f", mainPanelDevice:get_argument_value(95))) -- lamp_LEFT_FUEL_BOOST
|
|
||||||
SendDataHW("96", string.format("%.1f", mainPanelDevice:get_argument_value(96))) -- lamp_RIGHT_FUEL_BOOST
|
|
||||||
SendDataHW("97", string.format("%.1f", mainPanelDevice:get_argument_value(97))) -- lamp_ENG_FUEL_PUMP
|
|
||||||
SendDataHW("98", string.format("%.1f", mainPanelDevice:get_argument_value(98))) -- lamp_20_MINUTE
|
|
||||||
SendDataHW("99", string.format("%.1f", mainPanelDevice:get_argument_value(99))) -- lamp_FUEL_FILTER
|
|
||||||
SendDataHW("100", string.format("%.1f", mainPanelDevice:get_argument_value(100))) -- lamp_GOV_EMERG
|
|
||||||
SendDataHW("101", string.format("%.1f", mainPanelDevice:get_argument_value(101))) -- lamp_AUX_FUEL_LOW
|
|
||||||
SendDataHW("102", string.format("%.1f", mainPanelDevice:get_argument_value(102))) -- lamp_XMSN_OIL_PRESS
|
|
||||||
SendDataHW("103", string.format("%.1f", mainPanelDevice:get_argument_value(103))) -- lamp_XMSN_OIL_HOT
|
|
||||||
SendDataHW("104", string.format("%.1f", mainPanelDevice:get_argument_value(104))) -- lamp_HYD_PRESSURE
|
|
||||||
SendDataHW("105", string.format("%.1f", mainPanelDevice:get_argument_value(105))) -- lamp_ENGINE_INLET_AIR
|
|
||||||
SendDataHW("106", string.format("%.1f", mainPanelDevice:get_argument_value(106))) -- lamp_INST_INVERTER
|
|
||||||
SendDataHW("107", string.format("%.1f", mainPanelDevice:get_argument_value(107))) -- lamp_DC_GENERATOR
|
|
||||||
SendDataHW("108", string.format("%.1f", mainPanelDevice:get_argument_value(108))) -- lamp_EXTERNAL_POWER
|
|
||||||
SendDataHW("109", string.format("%.1f", mainPanelDevice:get_argument_value(109))) -- lamp_CHIP_DETECTOR
|
|
||||||
SendDataHW("110", string.format("%.1f", mainPanelDevice:get_argument_value(110))) -- lamp_IFF
|
|
||||||
-- M21
|
|
||||||
SendDataHW("254", string.format("%.1f", mainPanelDevice:get_argument_value(254))) -- lamp_M21_ARMED
|
|
||||||
SendDataHW("255", string.format("%.1f", mainPanelDevice:get_argument_value(255))) -- lamp_M21_SAFE
|
|
||||||
--
|
|
||||||
SendDataHW("76", string.format("%.1f", mainPanelDevice:get_argument_value(76))) -- lamp_IFF_REPLY
|
|
||||||
SendDataHW("77", string.format("%.1f", mainPanelDevice:get_argument_value(77))) -- lamp_IFF_TEST
|
|
||||||
--
|
|
||||||
SendDataHW("56", string.format("%.1f", mainPanelDevice:get_argument_value(56))) -- Marker_Beacon_Lamp
|
|
||||||
-- XM130 Chaff Flare
|
|
||||||
SendDataHW("458", string.format("%.1f", mainPanelDevice:get_argument_value(458))) -- XM130_ARMED_LAMP
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -874,54 +535,55 @@ end
|
|||||||
-- done every gExportLowTickInterval export events --
|
-- done every gExportLowTickInterval export events --
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
export in low tick interval to GlassCockpit
|
export in low tick interval to GlassCockpit
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Get Radio Frequencies
|
Get Radio Frequencies
|
||||||
get data from device
|
get data from device
|
||||||
local lUHFRadio = GetDevice(54)
|
local lUHFRadio = GetDevice(54)
|
||||||
SendData("ExportID", "Format")
|
ExportScript.Tools.SendData("ExportID", "Format")
|
||||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||||
--[[
|
--[[
|
||||||
export in low tick interval to hardware
|
export in low tick interval to hardware
|
||||||
Example from A-10C
|
Example from A-10C
|
||||||
Landing Gear
|
Landing Gear
|
||||||
mainPanelDevice, basis panel
|
mainPanelDevice, basis panel
|
||||||
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
|
ExportScript.Tools.SendDataDAC("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
|
||||||
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
|
ExportScript.Tools.SendDataDAC("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
|
||||||
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
|
ExportScript.Tools.SendDataDAC("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- Radio comunication
|
-- Radio comunication
|
||||||
-- UHF_ARC_51
|
-- UHF_ARC_51
|
||||||
local lUHF_ARC_51 = GetDevice(22)
|
local lUHF_ARC_51 = GetDevice(22)
|
||||||
SendDataHW("2000", string.format("%7.3f", lUHF_ARC_51:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lUHF_ARC_51:get_frequency()/1000000))
|
||||||
|
|
||||||
local lUHF_ARC_51_PRESET = {[0.00]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
local lUHF_ARC_51_PRESET = {[0.00]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
||||||
SendDataHW("2001", lUHF_ARC_51_PRESET[math.round(mainPanelDevice:get_argument_value(16), 2)])
|
ExportScript.Tools.SendDataDAC("2001", lUHF_ARC_51_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(16), 2)])
|
||||||
|
|
||||||
-- VHF_ARC_131
|
-- VHF_ARC_131
|
||||||
local lVHF_ARC_131 = GetDevice(23)
|
local lVHF_ARC_131 = GetDevice(23)
|
||||||
SendDataHW("2002", string.format("%7.3f", lVHF_ARC_131:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2002", string.format("%7.3f", lVHF_ARC_131:get_frequency()/1000000))
|
||||||
|
|
||||||
-- VHF_ARC_134
|
-- VHF_ARC_134
|
||||||
local lVHF_ARC_134 = GetDevice(20)
|
local lVHF_ARC_134 = GetDevice(20)
|
||||||
SendDataHW("2003", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
ExportScript.Tools.SendDataDAC("2003", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
||||||
|
|
||||||
-- ARN_82 VHF Navigation Set NOT FUNCTIONAL
|
-- ARN_82 VHF Navigation Set NOT FUNCTIONAL
|
||||||
--local lARN_82 = GetDevice(26)
|
--local lARN_82 = GetDevice(26)
|
||||||
--WriteToLog('lARN_82: '..dump(lARN_82))
|
--ExportScript.Tools.WriteToLog('lARN_82: '..ExportScript.Tools.dump(lARN_82))
|
||||||
--WriteToLog('lARN_82 (metatable): '..dump(getmetatable(lARN_82)))
|
--ExportScript.Tools.WriteToLog('lARN_82 (metatable): '..ExportScript.Tools.dump(getmetatable(lARN_82)))
|
||||||
--SendDataHW("2004", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
--ExportScript.Tools.SendDataDAC("2004", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
||||||
|
|
||||||
-- XM130 FLARE CHAFF
|
-- XM130 FLARE CHAFF
|
||||||
SendDataHW("2005", string.format("%1d", math.round(mainPanelDevice:get_argument_value(460) * 10, 0)..math.round(mainPanelDevice:get_argument_value(461) * 10, 0))) -- FLARE_Digit_1 -- FLARE_Digit_2
|
ExportScript.Tools.SendDataDAC("2005", string.format("%1d", ExportScript.Tools.round(mainPanelDevice:get_argument_value(460) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(461) * 10, 0))) -- FLARE_Digit_1 -- FLARE_Digit_2
|
||||||
SendDataHW("2006", string.format("%1d", math.round(mainPanelDevice:get_argument_value(462) * 10, 0)..math.round(mainPanelDevice:get_argument_value(463) * 10, 0))) -- CHAFF_Digit_1 -- CHAFF_Digit_2
|
ExportScript.Tools.SendDataDAC("2006", string.format("%1d", ExportScript.Tools.round(mainPanelDevice:get_argument_value(462) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(463) * 10, 0))) -- CHAFF_Digit_1 -- CHAFF_Digit_2
|
||||||
|
|
||||||
-- ADF_ARN83
|
-- ADF_ARN83
|
||||||
local lpos1, pos2, lpos3, pos4
|
local lpos1, pos2, lpos3, pos4
|
||||||
@ -936,11 +598,11 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|||||||
else
|
else
|
||||||
lADF_ARN83 = lCockpitParams:sub(pos2 + 1)
|
lADF_ARN83 = lCockpitParams:sub(pos2 + 1)
|
||||||
end
|
end
|
||||||
lADF_ARN83 = math.round(tonumber(lADF_ARN83) / 1000, 2)
|
lADF_ARN83 = ExportScript.Tools.round(tonumber(lADF_ARN83) / 1000, 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
SendDataHW("2007", string.format("%s", lADF_ARN83))
|
ExportScript.Tools.SendDataDAC("2007", string.format("%s", lADF_ARN83))
|
||||||
|
|
||||||
-- Radar Altimeter - AN/APN-209
|
-- Radar Altimeter - AN/APN-209
|
||||||
-- [468] = "%0.1f", -- RALT_Digit_1
|
-- [468] = "%0.1f", -- RALT_Digit_1
|
||||||
@ -953,79 +615,86 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|||||||
-- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' '
|
-- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' '
|
||||||
local lAN_APN_209_PRESET = {[0.0]="0",[0.1]="1",[0.2]="2",[0.3]="3",[0.4]="4",[0.5]="5",[0.6]="6",[0.7]="7",[0.8]="8",[0.9]="9",[1.0]=" "}
|
local lAN_APN_209_PRESET = {[0.0]="0",[0.1]="1",[0.2]="2",[0.3]="3",[0.4]="4",[0.5]="5",[0.6]="6",[0.7]="7",[0.8]="8",[0.9]="9",[1.0]=" "}
|
||||||
local lAN_APN_209 = ""
|
local lAN_APN_209 = ""
|
||||||
lAN_APN_209 = lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(468), 2)]
|
lAN_APN_209 = lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(468), 2)]
|
||||||
lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(469), 2)]
|
lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(469), 2)]
|
||||||
lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(470), 2)]
|
lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(470), 2)]
|
||||||
lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(471), 2)]
|
lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(471), 2)]
|
||||||
SendDataHW("2008", string.format("%s", lAN_APN_209))
|
ExportScript.Tools.SendDataDAC("2008", string.format("%s", lAN_APN_209))
|
||||||
|
|
||||||
-- generic Radio display and frequency rotarys
|
-- generic Radio display and frequency rotarys
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
genericRadio(nil, nil, gES_genericRadioHardwareID)
|
ExportScript.genericRadio(nil, nil, ExportScript.Config.genericRadioHardwareID)
|
||||||
|
|
||||||
|
|
||||||
|
ExportScript.Tools.WriteToLog('VHF_ARC_134: '..string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
||||||
|
ExportScript.Tools.WriteToLog('VHF_ARC134_Freq1: '..mainPanelDevice:get_argument_value(1))
|
||||||
|
ExportScript.Tools.WriteToLog('VHF_ARC134_Freq2: '..mainPanelDevice:get_argument_value(2))
|
||||||
|
ExportScript.Tools.WriteToLog('VHF_ARC134_Freq3: '..mainPanelDevice:get_argument_value(3))
|
||||||
|
ExportScript.Tools.WriteToLog('VHF_ARC134_Freq4: '..mainPanelDevice:get_argument_value(4))
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
-- ENGINE_INTERFACE
|
-- ENGINE_INTERFACE
|
||||||
local lENGINE_INTERFACE = GetDevice(3)
|
local lENGINE_INTERFACE = GetDevice(3)
|
||||||
WriteToLog('lENGINE_INTERFACE:get_eng_rpm '..dump(lENGINE_INTERFACE:get_eng_rpm()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_rpm '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_rpm()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_fire_lamp '..dump(lENGINE_INTERFACE:get_fire_lamp()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_fire_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_fire_lamp()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_gas_prod_tach '..dump(lENGINE_INTERFACE:get_gas_prod_tach()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_gas_prod_tach '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_gas_prod_tach()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_fire_test_lamp '..dump(lENGINE_INTERFACE:get_fire_test_lamp()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_fire_test_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_fire_test_lamp()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_trans_oil_temp '..dump(lENGINE_INTERFACE:get_trans_oil_temp()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_trans_oil_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_trans_oil_temp()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_eng_torq '..dump(lENGINE_INTERFACE:get_eng_torq()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_torq '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_torq()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_trans_oil_press '..dump(lENGINE_INTERFACE:get_trans_oil_press()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_trans_oil_press '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_trans_oil_press()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_exhaust_temp '..dump(lENGINE_INTERFACE:get_exhaust_temp()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_exhaust_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_exhaust_temp()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_low_rpm_lamp '..dump(lENGINE_INTERFACE:get_low_rpm_lamp()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_low_rpm_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_low_rpm_lamp()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_eng_oil_temp '..dump(lENGINE_INTERFACE:get_eng_oil_temp()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_oil_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_oil_temp()))
|
||||||
WriteToLog('lENGINE_INTERFACE:get_eng_oil_press '..dump(lENGINE_INTERFACE:get_eng_oil_press()))
|
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_oil_press '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_oil_press()))
|
||||||
|
|
||||||
-- ADI_PILOT
|
-- ADI_PILOT
|
||||||
local lADI_PILOT = GetDevice(6)
|
local lADI_PILOT = GetDevice(6)
|
||||||
WriteToLog('lADI_PILOT:get_sideslip '..dump(lADI_PILOT:get_sideslip()))
|
ExportScript.Tools.WriteToLog('lADI_PILOT:get_sideslip '..ExportScript.Tools.dump(lADI_PILOT:get_sideslip()))
|
||||||
WriteToLog('lADI_PILOT:get_bank '..dump(lADI_PILOT:get_bank()))
|
ExportScript.Tools.WriteToLog('lADI_PILOT:get_bank '..ExportScript.Tools.dump(lADI_PILOT:get_bank()))
|
||||||
WriteToLog('lADI_PILOT:get_pitch '..dump(lADI_PILOT:get_pitch()))
|
ExportScript.Tools.WriteToLog('lADI_PILOT:get_pitch '..ExportScript.Tools.dump(lADI_PILOT:get_pitch()))
|
||||||
|
|
||||||
-- RADAR_ALTIMETER
|
-- RADAR_ALTIMETER
|
||||||
local lRADAR_ALTIMETER = GetDevice(13)
|
local lRADAR_ALTIMETER = GetDevice(13)
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..dump(lRADAR_ALTIMETER:get_distance_limit()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_distance_limit()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..dump(lRADAR_ALTIMETER:get_aperture_size()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_aperture_size()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_mode '..dump(lRADAR_ALTIMETER:get_mode()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_mode '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_mode()))
|
||||||
WriteToLog('lRADAR_ALTIMETER:get_altitude '..dump(lRADAR_ALTIMETER:get_altitude()))
|
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_altitude '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_altitude()))
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
-- VHF_ARC_134
|
-- VHF_ARC_134
|
||||||
local lVHF_ARC_134 = GetDevice(20)
|
local lVHF_ARC_134 = GetDevice(20)
|
||||||
WriteToLog('lVHF_ARC_134:is_on '..dump(lVHF_ARC_134:is_on()))
|
ExportScript.Tools.WriteToLog('lVHF_ARC_134:is_on '..ExportScript.Tools.dump(lVHF_ARC_134:is_on()))
|
||||||
WriteToLog('lVHF_ARC_134:get_frequency '..dump(lVHF_ARC_134:get_frequency()))
|
ExportScript.Tools.WriteToLog('lVHF_ARC_134:get_frequency '..ExportScript.Tools.dump(lVHF_ARC_134:get_frequency()))
|
||||||
--WriteToLog('lVHF_ARC_134:set_frequency '..dump(lVHF_ARC_134:set_frequency())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_frequency '..ExportScript.Tools.dump(lVHF_ARC_134:set_frequency())) -- test parameters
|
||||||
--WriteToLog('lVHF_ARC_134:set_modulation '..dump(lVHF_ARC_134:set_modulation())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_modulation '..ExportScript.Tools.dump(lVHF_ARC_134:set_modulation())) -- test parameters
|
||||||
--WriteToLog('lVHF_ARC_134:set_channel '..dump(lVHF_ARC_134:set_channel())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_channel '..ExportScript.Tools.dump(lVHF_ARC_134:set_channel())) -- test parameters
|
||||||
|
|
||||||
-- INTERCOM
|
-- INTERCOM
|
||||||
local lINTERCOM = GetDevice(21)
|
local lINTERCOM = GetDevice(21)
|
||||||
WriteToLog('lINTERCOM:is_communicator_available '..dump(lINTERCOM:is_communicator_available()))
|
ExportScript.Tools.WriteToLog('lINTERCOM:is_communicator_available '..ExportScript.Tools.dump(lINTERCOM:is_communicator_available()))
|
||||||
WriteToLog('lINTERCOM:get_noise_level '..dump(lINTERCOM:get_noise_level()))
|
ExportScript.Tools.WriteToLog('lINTERCOM:get_noise_level '..ExportScript.Tools.dump(lINTERCOM:get_noise_level()))
|
||||||
WriteToLog('lINTERCOM:get_signal_level '..dump(lINTERCOM:get_signal_level()))
|
ExportScript.Tools.WriteToLog('lINTERCOM:get_signal_level '..ExportScript.Tools.dump(lINTERCOM:get_signal_level()))
|
||||||
--WriteToLog('lINTERCOM:set_communicator '..dump(lINTERCOM:set_communicator())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lINTERCOM:set_communicator '..ExportScript.Tools.dump(lINTERCOM:set_communicator())) -- test parameters
|
||||||
--WriteToLog('lINTERCOM:set_voip_mode '..dump(lINTERCOM:set_voip_mode())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lINTERCOM:set_voip_mode '..ExportScript.Tools.dump(lINTERCOM:set_voip_mode())) -- test parameters
|
||||||
|
|
||||||
-- UHF_ARC_51
|
-- UHF_ARC_51
|
||||||
local lUHF_ARC_51 = GetDevice(22)
|
local lUHF_ARC_51 = GetDevice(22)
|
||||||
WriteToLog('lUHF_ARC_51:is_on '..dump(lUHF_ARC_51:is_on()))
|
ExportScript.Tools.WriteToLog('lUHF_ARC_51:is_on '..ExportScript.Tools.dump(lUHF_ARC_51:is_on()))
|
||||||
WriteToLog('lUHF_ARC_51:get_frequency '..dump(lUHF_ARC_51:get_frequency()))
|
ExportScript.Tools.WriteToLog('lUHF_ARC_51:get_frequency '..ExportScript.Tools.dump(lUHF_ARC_51:get_frequency()))
|
||||||
--WriteToLog('lUHF_ARC_51:set_frequency '..dump(lUHF_ARC_51:set_frequency())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_frequency '..ExportScript.Tools.dump(lUHF_ARC_51:set_frequency())) -- test parameters
|
||||||
--WriteToLog('lUHF_ARC_51:set_modulation '..dump(lUHF_ARC_51:set_modulation())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_modulation '..ExportScript.Tools.dump(lUHF_ARC_51:set_modulation())) -- test parameters
|
||||||
--WriteToLog('lUHF_ARC_51:set_channel '..dump(lUHF_ARC_51:set_channel())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_channel '..ExportScript.Tools.dump(lUHF_ARC_51:set_channel())) -- test parameters
|
||||||
|
|
||||||
-- VHF_ARC_131
|
-- VHF_ARC_131
|
||||||
local lVHF_ARC_131 = GetDevice(23)
|
local lVHF_ARC_131 = GetDevice(23)
|
||||||
WriteToLog('lVHF_ARC_131:is_on '..dump(lVHF_ARC_131:is_on()))
|
ExportScript.Tools.WriteToLog('lVHF_ARC_131:is_on '..ExportScript.Tools.dump(lVHF_ARC_131:is_on()))
|
||||||
WriteToLog('lVHF_ARC_131:get_frequency '..dump(lVHF_ARC_131:get_frequency()))
|
ExportScript.Tools.WriteToLog('lVHF_ARC_131:get_frequency '..ExportScript.Tools.dump(lVHF_ARC_131:get_frequency()))
|
||||||
--WriteToLog('lVHF_ARC_131:set_frequency '..dump(lVHF_ARC_131:set_frequency())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_frequency '..ExportScript.Tools.dump(lVHF_ARC_131:set_frequency())) -- test parameters
|
||||||
--WriteToLog('lVHF_ARC_131:set_modulation '..dump(lVHF_ARC_131:set_modulation())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_modulation '..ExportScript.Tools.dump(lVHF_ARC_131:set_modulation())) -- test parameters
|
||||||
--WriteToLog('lVHF_ARC_131:set_channel '..dump(lVHF_ARC_131:set_channel())) -- test parameters
|
--ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_channel '..ExportScript.Tools.dump(lVHF_ARC_131:set_channel())) -- test parameters
|
||||||
|
|
||||||
WriteToLog('Frequency Mode Dial '..dump(mainPanelDevice:get_argument_value(15)))
|
ExportScript.Tools.WriteToLog('Frequency Mode Dial '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(15)))
|
||||||
WriteToLog('Function Dial '..dump(mainPanelDevice:get_argument_value(17)))
|
ExportScript.Tools.WriteToLog('Function Dial '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(17)))
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
Device test, Device 2 to 32
|
Device test, Device 2 to 32
|
||||||
@ -1033,18 +702,18 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
|||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 49, 1 do
|
for ltmp2 = 1, 49, 1 do
|
||||||
ltmp1 = GetDevice(ltmp2)
|
ltmp1 = GetDevice(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
--[[
|
--[[
|
||||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||||
|
|
||||||
local ltmp1 = 0
|
local ltmp1 = 0
|
||||||
for ltmp2 = 1, 8, 1 do
|
for ltmp2 = 1, 8, 1 do
|
||||||
ltmp1 = list_indication(ltmp2)
|
ltmp1 = list_indication(ltmp2)
|
||||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
@ -1053,7 +722,7 @@ end
|
|||||||
-- Custom functions --
|
-- Custom functions --
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
function genericRadio(key, value, hardware)
|
function ExportScript.genericRadio(key, value, hardware)
|
||||||
local lHardware = hardware or 1
|
local lHardware = hardware or 1
|
||||||
-- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben
|
-- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben
|
||||||
-- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden
|
-- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden
|
||||||
@ -1112,7 +781,7 @@ function genericRadio(key, value, hardware)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if gES_genericRadio > lMaxRadios then
|
if gES_genericRadio > lMaxRadios then
|
||||||
WriteToLog("Radio Nr. "..gES_genericRadio.." not defined.")
|
ExportScript.Tools.WriteToLog("Radio Nr. "..gES_genericRadio.." not defined.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1133,18 +802,18 @@ function genericRadio(key, value, hardware)
|
|||||||
gES_genericRadioPresetManual[gES_genericRadio] = 0 -- no preset channels
|
gES_genericRadioPresetManual[gES_genericRadio] = 0 -- no preset channels
|
||||||
end
|
end
|
||||||
if gES_genericRadioSquelch[gES_genericRadio] == nil then
|
if gES_genericRadioSquelch[gES_genericRadio] == nil then
|
||||||
gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(36), 1) == 0.1) and 0 or 1)
|
gES_genericRadioSquelch[gES_genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(36), 1) == 0.1) and 0 or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local lVHF_FM_RADIO_FREQUENCY = math.round(lVHF_FM_RADIO:get_frequency()/1000000 , 3, "floor")
|
local lVHF_FM_RADIO_FREQUENCY = ExportScript.Tools.round(lVHF_FM_RADIO:get_frequency()/1000000 , 3, "floor")
|
||||||
|
|
||||||
SendDataHW("3000", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware)
|
ExportScript.Tools.SendDataDAC("3000", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware)
|
||||||
SendDataHW("3001", string.format("-"), lHardware)
|
ExportScript.Tools.SendDataDAC("3001", string.format("-"), lHardware)
|
||||||
SendDataHW("3002", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware)
|
ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware)
|
||||||
|
|
||||||
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
||||||
|
|
||||||
local lFrequency = StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.")
|
local lFrequency = ExportScript.Tools.StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.")
|
||||||
|
|
||||||
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
||||||
lFrequency[1] = tonumber(lFrequency[1])
|
lFrequency[1] = tonumber(lFrequency[1])
|
||||||
@ -1176,13 +845,13 @@ function genericRadio(key, value, hardware)
|
|||||||
Frequency = ltempFrequency * 1000000}
|
Frequency = ltempFrequency * 1000000}
|
||||||
|
|
||||||
else
|
else
|
||||||
WriteToLog("1. genericUH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency)
|
ExportScript.Tools.WriteToLog("1. genericUH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
||||||
|
|
||||||
local lFrequency = StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.")
|
local lFrequency = ExportScript.Tools.StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.")
|
||||||
|
|
||||||
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
||||||
lFrequency[1] = tonumber(lFrequency[1])
|
lFrequency[1] = tonumber(lFrequency[1])
|
||||||
@ -1214,7 +883,7 @@ function genericRadio(key, value, hardware)
|
|||||||
Frequency = ltempFrequency * 1000000}
|
Frequency = ltempFrequency * 1000000}
|
||||||
|
|
||||||
else
|
else
|
||||||
WriteToLog("2. generic UH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency)
|
ExportScript.Tools.WriteToLog("2. generic UH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1302,24 +971,24 @@ function genericRadio(key, value, hardware)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if gES_genericRadioPresetManual[gES_genericRadio] == nil then
|
if gES_genericRadioPresetManual[gES_genericRadio] == nil then
|
||||||
gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(15), 1) == 0.1) and 0 or 1)
|
gES_genericRadioPresetManual[gES_genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(15), 1) == 0.1) and 0 or 1)
|
||||||
end
|
end
|
||||||
if gES_genericRadioSquelch[gES_genericRadio] == nil then
|
if gES_genericRadioSquelch[gES_genericRadio] == nil then
|
||||||
gES_genericRadioSquelch[gES_genericRadio] = math.round(lMainPanelDevice:get_argument_value(22), 1)
|
gES_genericRadioSquelch[gES_genericRadio] = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(22), 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local lPresetChannel = math.round(lMainPanelDevice:get_argument_value(16), 2)
|
local lPresetChannel = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(16), 2)
|
||||||
|
|
||||||
local lUHF_AM_RADIO_PRESET = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
local lUHF_AM_RADIO_PRESET = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
||||||
local lUHF_AM_RADIO_FREQUENCY = math.round(lUHF_AM_RADIO:get_frequency()/1000000 , 3, "floor")
|
local lUHF_AM_RADIO_FREQUENCY = ExportScript.Tools.round(lUHF_AM_RADIO:get_frequency()/1000000 , 3, "floor")
|
||||||
|
|
||||||
SendDataHW("3000", string.format("%s%.3f", lUHF_AM_RADIO_PRESET[lPresetChannel], lUHF_AM_RADIO_FREQUENCY), lHardware)
|
ExportScript.Tools.SendDataDAC("3000", string.format("%s%.3f", lUHF_AM_RADIO_PRESET[lPresetChannel], lUHF_AM_RADIO_FREQUENCY), lHardware)
|
||||||
SendDataHW("3001", string.format("%s", lUHF_AM_RADIO_PRESET[lPresetChannel]), lHardware)
|
ExportScript.Tools.SendDataDAC("3001", string.format("%s", lUHF_AM_RADIO_PRESET[lPresetChannel]), lHardware)
|
||||||
SendDataHW("3002", string.format("%.3f", lUHF_AM_RADIO_FREQUENCY), lHardware)
|
ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lUHF_AM_RADIO_FREQUENCY), lHardware)
|
||||||
|
|
||||||
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
||||||
|
|
||||||
local lFrequency = StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.")
|
local lFrequency = ExportScript.Tools.StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.")
|
||||||
|
|
||||||
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
||||||
lFrequency[1] = tonumber(lFrequency[1])
|
lFrequency[1] = tonumber(lFrequency[1])
|
||||||
@ -1351,13 +1020,13 @@ function genericRadio(key, value, hardware)
|
|||||||
Frequency = ltempFrequency * 1000000}
|
Frequency = ltempFrequency * 1000000}
|
||||||
|
|
||||||
else
|
else
|
||||||
WriteToLog("1. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency)
|
ExportScript.Tools.WriteToLog("1. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
||||||
|
|
||||||
local lFrequency = StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.")
|
local lFrequency = ExportScript.Tools.StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.")
|
||||||
|
|
||||||
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
||||||
lFrequency[1] = tonumber(lFrequency[1])
|
lFrequency[1] = tonumber(lFrequency[1])
|
||||||
@ -1389,7 +1058,7 @@ function genericRadio(key, value, hardware)
|
|||||||
Frequency = ltempFrequency * 1000000}
|
Frequency = ltempFrequency * 1000000}
|
||||||
|
|
||||||
else
|
else
|
||||||
WriteToLog("2. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency)
|
ExportScript.Tools.WriteToLog("2. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then
|
if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then
|
||||||
@ -1480,15 +1149,15 @@ function genericRadio(key, value, hardware)
|
|||||||
gES_genericRadioSquelch[gES_genericRadio] = 0.0 -- no Squelch
|
gES_genericRadioSquelch[gES_genericRadio] = 0.0 -- no Squelch
|
||||||
end
|
end
|
||||||
|
|
||||||
local lVHF_AM_RADIO_FREQUENCY = math.round(lVHF_AM_RADIO:get_frequency()/1000000 , 3, "floor")
|
local lVHF_AM_RADIO_FREQUENCY = ExportScript.Tools.round(lVHF_AM_RADIO:get_frequency()/1000000 , 3, "floor")
|
||||||
|
|
||||||
SendDataHW("3000", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware)
|
ExportScript.Tools.SendDataDAC("3000", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware)
|
||||||
SendDataHW("3001", string.format("-"), lHardware)
|
ExportScript.Tools.SendDataDAC("3001", string.format("-"), lHardware)
|
||||||
SendDataHW("3002", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware)
|
ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware)
|
||||||
|
|
||||||
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
||||||
|
|
||||||
local lFrequency = StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.")
|
local lFrequency = ExportScript.Tools.StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.")
|
||||||
|
|
||||||
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
||||||
lFrequency[1] = tonumber(lFrequency[1])
|
lFrequency[1] = tonumber(lFrequency[1])
|
||||||
@ -1520,13 +1189,13 @@ function genericRadio(key, value, hardware)
|
|||||||
Frequency = ltempFrequency * 1000000}
|
Frequency = ltempFrequency * 1000000}
|
||||||
|
|
||||||
else
|
else
|
||||||
WriteToLog("1. genericUH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency)
|
ExportScript.Tools.WriteToLog("1. genericUH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
||||||
|
|
||||||
local lFrequency = StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.")
|
local lFrequency = ExportScript.Tools.StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.")
|
||||||
|
|
||||||
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
if type(lFrequency) == "table" and lFrequency[1] ~= nil then
|
||||||
lFrequency[1] = tonumber(lFrequency[1])
|
lFrequency[1] = tonumber(lFrequency[1])
|
||||||
@ -1558,7 +1227,7 @@ function genericRadio(key, value, hardware)
|
|||||||
Frequency = ltempFrequency * 1000000}
|
Frequency = ltempFrequency * 1000000}
|
||||||
|
|
||||||
else
|
else
|
||||||
WriteToLog("2. generic UH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency)
|
ExportScript.Tools.WriteToLog("2. generic UH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1636,32 +1305,32 @@ function genericRadio(key, value, hardware)
|
|||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
SendDataHW("3000", "-", lHardware)
|
ExportScript.Tools.SendDataDAC("3000", "-", lHardware)
|
||||||
SendDataHW("3001", "-", lHardware)
|
ExportScript.Tools.SendDataDAC("3001", "-", lHardware)
|
||||||
SendDataHW("3002", "-", lHardware)
|
ExportScript.Tools.SendDataDAC("3002", "-", lHardware)
|
||||||
SendDataHW("3010", 0, lHardware)
|
ExportScript.Tools.SendDataDAC("3010", 0, lHardware)
|
||||||
SendDataHW("3011", 0, lHardware)
|
ExportScript.Tools.SendDataDAC("3011", 0, lHardware)
|
||||||
SendDataHW("3012", 0, lHardware)
|
ExportScript.Tools.SendDataDAC("3012", 0, lHardware)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
SendDataHW("3010", gES_genericRadioPower[gES_genericRadio], lHardware)
|
ExportScript.Tools.SendDataDAC("3010", gES_genericRadioPower[gES_genericRadio], lHardware)
|
||||||
SendDataHW("3011", gES_genericRadioPresetManual[gES_genericRadio], lHardware)
|
ExportScript.Tools.SendDataDAC("3011", gES_genericRadioPresetManual[gES_genericRadio], lHardware)
|
||||||
SendDataHW("3012", gES_genericRadioSquelch[gES_genericRadio], lHardware)
|
ExportScript.Tools.SendDataDAC("3012", gES_genericRadioSquelch[gES_genericRadio], lHardware)
|
||||||
|
|
||||||
if lClickAction ~= nil then
|
if lClickAction ~= nil then
|
||||||
lDevice = GetDevice(lClickAction.DeviceID)
|
lDevice = GetDevice(lClickAction.DeviceID)
|
||||||
if type(lDevice) == "table" then
|
if type(lDevice) == "table" then
|
||||||
--WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ")
|
--ExportScript.Tools.WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ")
|
||||||
lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value)
|
lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value)
|
||||||
end
|
end
|
||||||
elseif lSetFrequency ~= nil then
|
elseif lSetFrequency ~= nil then
|
||||||
lDevice = GetDevice(lSetFrequency.DeviceID)
|
lDevice = GetDevice(lSetFrequency.DeviceID)
|
||||||
if type(lDevice) == "table" and lDevice:is_on() then
|
if type(lDevice) == "table" and lDevice:is_on() then
|
||||||
--WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ")
|
--ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ")
|
||||||
lDevice:set_frequency(lSetFrequency.Frequency)
|
lDevice:set_frequency(lSetFrequency.Frequency)
|
||||||
else
|
else
|
||||||
WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on")
|
ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
429
Scripts/DCS-ExportScript/lib/Tools.lua
Normal file
429
Scripts/DCS-ExportScript/lib/Tools.lua
Normal file
@ -0,0 +1,429 @@
|
|||||||
|
-- Ikarus and D.A.C. Export Script
|
||||||
|
-- Version 1.0.0 BETA
|
||||||
|
--
|
||||||
|
-- Tools
|
||||||
|
--
|
||||||
|
-- Copyright by Michael aka McMicha 2014
|
||||||
|
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||||
|
|
||||||
|
ExportScript.Tools = {}
|
||||||
|
|
||||||
|
function ExportScript.Tools.WriteToLog(message)
|
||||||
|
if ExportScript.logFile then
|
||||||
|
local ltmp, lMiliseconds = math.modf(os.clock())
|
||||||
|
if lMiliseconds==0 then
|
||||||
|
lMiliseconds='000'
|
||||||
|
else
|
||||||
|
lMiliseconds=tostring(lMiliseconds):sub(3,5)
|
||||||
|
end
|
||||||
|
ExportScript.logFile:write(os.date("%X")..":"..lMiliseconds.." : "..message.."\r\n")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.ProcessInput()
|
||||||
|
local lCommand, lCommandArgs, lDevice
|
||||||
|
-- C1,3001,4
|
||||||
|
-- lComand = C
|
||||||
|
-- lCommandArgs[1] = 1 => lDevice
|
||||||
|
-- lCommandArgs[2] = 3001
|
||||||
|
-- lCommandArgs[3] = 4
|
||||||
|
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
local lInput,from,port = ExportScript.UDPsender:receivefrom()
|
||||||
|
|
||||||
|
if lInput then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.WriteToLog("lInput: "..lInput..", from: "..from..", port: "..port)
|
||||||
|
end
|
||||||
|
lCommand = string.sub(lInput,1,1)
|
||||||
|
|
||||||
|
if lCommand == "R" then
|
||||||
|
ExportScript.Tools.ResetChangeValues()
|
||||||
|
end
|
||||||
|
|
||||||
|
if (lCommand == "C") then
|
||||||
|
lCommandArgs = ExportScript.Tools.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 ExportScript.Config.DACExport then
|
||||||
|
local lInput2,from2,port2 = ExportScript.UDPListener:receivefrom() -- Hardware
|
||||||
|
|
||||||
|
if lInput2 then
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.WriteToLog("lInput2: "..lInput2..", from2: "..from2..", port2: "..port2)
|
||||||
|
end
|
||||||
|
lCommand = string.sub(lInput2,1,1)
|
||||||
|
|
||||||
|
if lCommand == "C" then
|
||||||
|
ExportScript.Tools.ResetChangeValuesDAC()
|
||||||
|
end
|
||||||
|
|
||||||
|
if (lCommand == "C") then
|
||||||
|
lCommandArgs = ExportScript.Tools.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
|
||||||
|
--ExportScript.genericRadio(key, value, hardware)
|
||||||
|
ExportScript.genericRadio(lCommandArgs[2],lCommandArgs[3], ExportScript.Config.genericRadioHardwareID)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.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 ExportScript.Tools.round(num, idp)
|
||||||
|
local lMult = 10^(idp or 0)
|
||||||
|
return math.floor(num * lMult + 0.5) / lMult
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Status Gathering Functions
|
||||||
|
function ExportScript.Tools.ProcessArguments(device, arguments)
|
||||||
|
local lArgument , lFormat , lArgumentValue
|
||||||
|
local lCounter = 0
|
||||||
|
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.WriteToLog("======Begin========")
|
||||||
|
end
|
||||||
|
|
||||||
|
for lArgument, lFormat in pairs(arguments) do
|
||||||
|
lArgumentValue = string.format(lFormat,device:get_argument_value(lArgument))
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
lCounter = lCounter + 1
|
||||||
|
ExportScript.Tools.WriteToLog(lCounter..". ID: "..lArgument..", Fromat: "..lFormat..", Value: "..lArgumentValue)
|
||||||
|
end
|
||||||
|
if ExportScript.Config.IkarusExport then
|
||||||
|
ExportScript.Tools.SendData(lArgument, lArgumentValue)
|
||||||
|
end
|
||||||
|
if ExportScript.Config.DACExport then
|
||||||
|
ExportScript.Tools.SendDataDAC(lArgument, lArgumentValue)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.WriteToLog("======End========")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Network Functions for GlassCockpit
|
||||||
|
function ExportScript.Tools.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 ExportScript.LastData[id] == nil or ExportScript.LastData[id] ~= value then
|
||||||
|
local ldata = id .. "=" .. value
|
||||||
|
local ldataLen = string.len(ldata)
|
||||||
|
|
||||||
|
if ldataLen + ExportScript.PacketSize > 576 then
|
||||||
|
ExportScript.Tools.FlushData()
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(ExportScript.SendStrings, ldata)
|
||||||
|
ExportScript.LastData[id] = value
|
||||||
|
ExportScript.PacketSize = ExportScript.PacketSize + ldataLen + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Network Functions for DAC
|
||||||
|
function ExportScript.Tools.SendDataDAC(id, value)
|
||||||
|
for hardware=1, #ExportScript.Config.DAC, 1 do
|
||||||
|
if ExportScript.Config.DAC[hardware] == nil then
|
||||||
|
ExportScript.Tools.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 ExportScript.LastDataDAC[hardware][id] == nil or ExportScript.LastDataDAC[hardware][id] ~= value then
|
||||||
|
local ldata = id .. "=" .. value
|
||||||
|
local ldataLen = string.len(ldata)
|
||||||
|
|
||||||
|
if ldataLen + ExportScript.PacketSizeDAC[hardware] > 576 then
|
||||||
|
ExportScript.Tools.FlushDataDAC(hardware)
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(ExportScript.SendStringsDAC[hardware], ldata)
|
||||||
|
ExportScript.LastDataDAC[hardware][id] = value
|
||||||
|
ExportScript.PacketSizeDAC[hardware] = ExportScript.PacketSizeDAC[hardware] + ldataLen + 1
|
||||||
|
--ExportScript.Tools.WriteToLog("id=ldata: "..ldata)
|
||||||
|
--ExportScript.Tools.WriteToLog("ExportScript.LastDataDAC["..hardware.."]: "..ExportScript.Tools.dump(ExportScript.LastDataDAC[hardware]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.FlushData()
|
||||||
|
if #ExportScript.SendStrings > 0 then
|
||||||
|
local lES_SimID = ""
|
||||||
|
if ExportScript.GlassCockpitType == 1 then
|
||||||
|
lES_SimID = ExportScript.SimID
|
||||||
|
elseif ExportScript.GlassCockpitType == 2 then
|
||||||
|
lES_SimID = ""
|
||||||
|
end
|
||||||
|
local lPacket = lES_SimID .. table.concat(ExportScript.SendStrings, ExportScript.Config.IkarusSeparator) .. "\n"
|
||||||
|
ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort))
|
||||||
|
ExportScript.SendStrings = {}
|
||||||
|
ExportScript.PacketSize = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.FlushDataDAC(hardware)
|
||||||
|
hardware = hardware or 1
|
||||||
|
|
||||||
|
if ExportScript.Config.DAC[hardware] == nil then
|
||||||
|
ExportScript.Tools.WriteToLog("unknown hardware ID '"..hardware.."'")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if #ExportScript.SendStringsDAC[hardware] > 0 then
|
||||||
|
local lPacket = ExportScript.SimID .. table.concat(ExportScript.SendStringsDAC[hardware], ExportScript.Config.DAC[hardware].Separator) .. "\n"
|
||||||
|
ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort))
|
||||||
|
ExportScript.SendStringsDAC[hardware] = {}
|
||||||
|
ExportScript.PacketSizeDAC[hardware] = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.ResetChangeValues()
|
||||||
|
ExportScript.LastData = {}
|
||||||
|
ExportScript.TickCount = 10
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.ResetChangeValuesDAC()
|
||||||
|
for i = 1, #ExportScript.Config.DAC, 1 do
|
||||||
|
ExportScript.LastDataDAC[i] = {}
|
||||||
|
end
|
||||||
|
ExportScript.TickCount = 10
|
||||||
|
ExportScript.TickCountDAC = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExportScript.Tools.SelectModule()
|
||||||
|
-- Select Module...
|
||||||
|
ExportScript.FoundDCSModule = false
|
||||||
|
ExportScript.FoundFCModule = false
|
||||||
|
ExportScript.FoundNoModul = true
|
||||||
|
|
||||||
|
local lMyInfo = LoGetSelfData()
|
||||||
|
if lMyInfo == nil then -- End SelectModule, if don't selected a aircraft
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
ExportScript.ModuleName = lMyInfo.Name
|
||||||
|
local lModuleName = ExportScript.ModuleName..".lua"
|
||||||
|
local lModuleFile = ""
|
||||||
|
|
||||||
|
ExportScript.FoundNoModul = false
|
||||||
|
|
||||||
|
for file in lfs.dir(ExportScript.Config.ExportModulePath) do
|
||||||
|
if lfs.attributes(ExportScript.Config.ExportModulePath..file,"mode") == "file" then
|
||||||
|
if file == lModuleName then
|
||||||
|
lModuleFile = ExportScript.Config.ExportModulePath..file
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
ExportScript.Tools.WriteToLog("File Path: "..lModuleFile)
|
||||||
|
|
||||||
|
if string.len(lModuleFile) > 1 then
|
||||||
|
ExportScript.Tools.ResetChangeValuesDAC()
|
||||||
|
|
||||||
|
-- load Aircraft File
|
||||||
|
dofile(lModuleFile)
|
||||||
|
ExportScript.Tools.SendDataDAC("File", lMyInfo.Name)
|
||||||
|
for i=1, #ExportScript.Config.DAC, 1 do
|
||||||
|
ExportScript.Tools.FlushDataDAC(i)
|
||||||
|
end
|
||||||
|
ExportScript.Tools.SendData("File", lMyInfo.Name)
|
||||||
|
ExportScript.Tools.FlushData()
|
||||||
|
|
||||||
|
ExportScript.Tools.WriteToLog("File '"..lModuleFile.."' loaded")
|
||||||
|
|
||||||
|
ExportScript.FirstNewDataSend = true
|
||||||
|
ExportScript.FirstNewDataSendCount = 5
|
||||||
|
|
||||||
|
if ExportScript.FoundDCSModule then
|
||||||
|
local lCounter = 0
|
||||||
|
for k, v in pairs(ExportScript.ConfigEveryFrameArguments) do
|
||||||
|
lCounter = lCounter + 1
|
||||||
|
end
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.WriteToLog("ExportScript.ConfigEveryFrameArguments Count: "..lCounter)
|
||||||
|
end
|
||||||
|
if lCounter > 0 then
|
||||||
|
ExportScript.EveryFrameArguments = ExportScript.ConfigEveryFrameArguments
|
||||||
|
else
|
||||||
|
-- no Arguments
|
||||||
|
ExportScript.EveryFrameArguments = {}
|
||||||
|
end
|
||||||
|
lCounter = 0
|
||||||
|
for k, v in pairs(ExportScript.ConfigArguments) do
|
||||||
|
lCounter = lCounter + 1
|
||||||
|
end
|
||||||
|
if ExportScript.Config.Debug then
|
||||||
|
ExportScript.Tools.WriteToLog("ExportScript.ConfigArguments Count: "..lCounter)
|
||||||
|
end
|
||||||
|
if lCounter > 0 then
|
||||||
|
ExportScript.Arguments = ExportScript.ConfigArguments
|
||||||
|
else
|
||||||
|
-- no Arguments
|
||||||
|
ExportScript.Arguments = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
ExportScript.ProcessIkarusDCSHighImportance = ExportScript.ProcessIkarusDCSConfigHighImportance
|
||||||
|
ExportScript.ProcessIkarusDCSLowImportance = ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||||
|
ExportScript.ProcessDACHighImportance = ExportScript.ProcessDACConfigHighImportance
|
||||||
|
ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACConfigLowImportance
|
||||||
|
|
||||||
|
elseif ExportScript.FoundFCModule then
|
||||||
|
ExportScript.ProcessIkarusFCHighImportance = ExportScript.ProcessIkarusFCHighImportanceConfig
|
||||||
|
ExportScript.ProcessIkarusFCLowImportance = ExportScript.ProcessIkarusFCLowImportanceConfig
|
||||||
|
ExportScript.ProcessDACHighImportance = ExportScript.ProcessDACConfigHighImportance
|
||||||
|
ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACConfigLowImportance
|
||||||
|
else
|
||||||
|
ExportScript.Tools.WriteToLog("Unknown Module Type: "..lMyInfo.Name)
|
||||||
|
end
|
||||||
|
|
||||||
|
else -- Unknown Module
|
||||||
|
ExportScript.ProcessIkarusDCSHighImportance = ExportScript.ProcessIkarusDCSHighImportanceNoConfig
|
||||||
|
ExportScript.ProcessIkarusDCSLowImportance = ExportScript.ProcessIkarusDCSLowImportanceNoConfig
|
||||||
|
ExportScript.ProcessIkarusFCHighImportance = ExportScript.ProcessIkarusFCHighImportanceNoConfig
|
||||||
|
ExportScript.ProcessIkarusFCLowImportance = ExportScript.ProcessIkarusFCLowImportanceNoConfig
|
||||||
|
ExportScript.ProcessDACHighImportance = ExportScript.ProcessDACHighImportanceNoConfig
|
||||||
|
ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACLowImportanceNoConfig
|
||||||
|
ExportScript.EveryFrameArguments = {}
|
||||||
|
ExportScript.Arguments = {}
|
||||||
|
ExportScript.Tools.WriteToLog("Unknown Module Name: "..lMyInfo.Name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The ExportScript.Tools.dump function show the content of the specified variable.
|
||||||
|
-- ExportScript.Tools.dump is similar to PHP function dump and show variables from type
|
||||||
|
-- "nil, "number", "string", "boolean, "table", "function", "thread" and "userdata"
|
||||||
|
function ExportScript.Tools.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.."] = " .. ExportScript.Tools.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 ExportScript.Tools.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 ExportScript.Tools.split(stringvalue, delimiter)
|
||||||
|
result = {};
|
||||||
|
for match in (stringvalue..delimiter):gmatch("(.-)"..delimiter) do
|
||||||
|
table.insert(result, match);
|
||||||
|
end
|
||||||
|
return result;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Pointed to by ExportScript.ProcessIkarusDCSHighImportance, if the player aircraft is something else
|
||||||
|
function ExportScript.ProcessIkarusDCSHighImportanceNoConfig(mainPanelDevice)
|
||||||
|
end
|
||||||
|
-- Pointed to by ExportScript.ProcessIkarusDCSLowImportance, if the player aircraft is something else
|
||||||
|
function ExportScript.ProcessIkarusDCSLowImportanceNoConfig(mainPanelDevice)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- the player aircraft is a Flaming Cliffs or similar aircraft
|
||||||
|
function ExportScript.ProcessIkarusFCHighImportanceNoConfig()
|
||||||
|
end
|
||||||
|
function ExportScript.ProcessIkarusFCLowImportanceNoConfig()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Hardware exports
|
||||||
|
function ExportScript.ProcessDACHighImportanceNoConfig(mainPanelDevice)
|
||||||
|
end
|
||||||
|
function ExportScript.ProcessDACLowImportanceNoConfig(mainPanelDevice)
|
||||||
|
end
|
||||||
@ -1,722 +1,3 @@
|
|||||||
-- 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
|
-- load the DCS ExportScript for DAC and Ikarus
|
||||||
|
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]])
|
||||||
----------
|
|
||||||
-- 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.05
|
|
||||||
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")
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user