mirror of
https://github.com/s-d-a/DCS-ExportScripts.git
synced 2026-07-17 17:27:42 +00:00
Compare commits
145 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e8a206d7a3 | |||
| 0665fc1a9f | |||
| 3ce5c2ab02 | |||
| 382eca5069 | |||
| 673f41b1ed | |||
| 174cd37009 | |||
| ce789cb0a8 | |||
| 6480fbac91 | |||
| a0db32902b | |||
| 4d2ed7e25a | |||
| 439db32160 | |||
| f06d1c491b | |||
| bc127a7f71 | |||
| 7b7e4de96c | |||
| 73bb5bc85d | |||
| e3536fbfa2 | |||
| 260fa80177 | |||
| 52d4b25f85 | |||
| 213d446ba3 | |||
| e28ae5f7d3 | |||
| bfe06b14c1 | |||
| b6009e5d33 | |||
| 2e88b87126 | |||
| c59ed2ba75 | |||
| 3189c90370 | |||
| 9b2b81f051 | |||
| a894ff698f | |||
| fc17982b01 | |||
| 3f19733f70 | |||
| 5bd0b6dd98 | |||
| 31c6538f23 | |||
| 15a33f7e4a | |||
| 464948c6a6 | |||
| 9846f7a5f6 | |||
| 2a1b27f684 | |||
| 944219abf2 | |||
| 1dc1549126 | |||
| 7ee857c7b2 | |||
| a1b9b865fd | |||
| 140bbd4c14 | |||
| b7ba440c63 | |||
| e9aaa38630 | |||
| 9b7de2e48d | |||
| 5e61332b33 | |||
| 6c6593ce91 | |||
| 14ff41b4ea | |||
| c7c0f2dc13 | |||
| c4ec33075c | |||
| 29037f8e3d | |||
| d6deebbdc5 | |||
| 7e3b9d17bf | |||
| 3516b6c81b | |||
| be1f2b8a39 | |||
| b406fbb253 | |||
| 0c249c14b6 | |||
| 100cfcfb15 | |||
| c06aa57912 | |||
| 64fc4773d3 | |||
| bfb0d75eb5 | |||
| 4d1a4c3e35 | |||
| 3987382c6a | |||
| d3b9c0405d | |||
| 2e1f8bb4ac | |||
| 6a8da731f4 | |||
| 446f2d6364 | |||
| e28f686b4b | |||
| ab420e35ab | |||
| 4995c73c65 | |||
| 702c0e1a18 | |||
| 80563c2627 | |||
| 0fa116a3b8 | |||
| f817820e7f | |||
| fae5e59f31 | |||
| 7b2193e753 | |||
| ac522ec636 | |||
| 06528fe19a | |||
| 05fec6b87f | |||
| 758fe85022 | |||
| 4b4a0d77a9 | |||
| 79079a6bb1 | |||
| b7007e88d6 | |||
| acc0c5d3ee | |||
| af3018e10c | |||
| 4e903e9cdd | |||
| 66e50bc076 | |||
| 105c05758d | |||
| 92033906bf | |||
| b30e99646e | |||
| b2a71bae0a | |||
| a696a4e129 | |||
| 59d19293b5 | |||
| caba9291c2 | |||
| 923cc06b00 | |||
| 6aea21b3bd | |||
| 76813bd080 | |||
| 42818767f7 | |||
| c966bcfad4 | |||
| cca970c1aa | |||
| 9cbf8c694f | |||
| b613fbd97e | |||
| c62dd06647 | |||
| e569ade723 | |||
| 225aa9e0d8 | |||
| f279b3d160 | |||
| e8ec661615 | |||
| b883746dfb | |||
| 766b17d85d | |||
| 0656844af8 | |||
| 3caa2066f5 | |||
| 2e5f545d4a | |||
| 560f107f65 | |||
| 69a8885ce4 | |||
| 72f34586a8 | |||
| 28f0506a38 | |||
| ab86ef90e2 | |||
| e2623ed6d2 | |||
| e15675c994 | |||
| a7ef9c554c | |||
| a6b982eac2 | |||
| f548703e67 | |||
| 25761e6578 | |||
| 06b33c4ed2 | |||
| 6644993e64 | |||
| 9504c76ab2 | |||
| c232c50949 | |||
| ea4cc43862 | |||
| c714588091 | |||
| 34f70051ab | |||
| 67d4069b58 | |||
| bcc0729b9f | |||
| d4a0a1ddf5 | |||
| 5809ab7a3c | |||
| 8a7989b10b | |||
| a9e7f4605d | |||
| d9f6ef0c17 | |||
| 51dc87a294 | |||
| 42b165c8b0 | |||
| 96dc09eaf3 | |||
| 542514a607 | |||
| 743acae7da | |||
| 096274b437 | |||
| 2f34eb09c3 | |||
| 63ed6bcb62 | |||
| d6302f1e70 | |||
| 3e545e6c53 |
@@ -39,3 +39,5 @@ luac.out
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# swap file
|
||||
*.*~
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,401 +0,0 @@
|
||||
-- Bf-109K-4 Kurfürst
|
||||
-- Version 0.9.9
|
||||
|
||||
gES_FoundDCSModule = true
|
||||
|
||||
gES_GlassCockpitConfigEveryFrameArguments =
|
||||
{
|
||||
[1] = "%.4f", -- MW50 pressure {0.0, 3.0}kg/cm2 = {0.0, 1.0}
|
||||
[2] = "%.4f", -- Airspeed Gauge {0, 100, 150, 200, 700, 750, 900, 1000} = {0.0, 0.1, 0.15, 0.2, 0.7, 0.75, 0.9, 1.0}
|
||||
-- Artificial horizon Fl_22415
|
||||
[3] = "%.4f", -- turn indicator {-1.0, 1.0}
|
||||
[4] = "%.4f", -- Bank {1.0, -1.0}
|
||||
[5] = "%.4f", -- Pitch {1.0, -1.0}
|
||||
[6] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||
[7] = "%.4f", -- Caged {0.0, 1.0}
|
||||
--Altitude Gauge
|
||||
[8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0}
|
||||
[9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0}
|
||||
[10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0}
|
||||
--[11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0}
|
||||
-- AN5730 remote compass
|
||||
[13] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||||
--[12] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||||
-- AFN2 blind landing system
|
||||
[14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0}
|
||||
[15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0}
|
||||
[16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0}
|
||||
--Dual-Range Pressure Gauge
|
||||
[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0}
|
||||
[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0}
|
||||
[27] = "%.4f", -- Coolant_Temperature {-1, 0, 130} = {-1, 0, 1}
|
||||
[28] = "%.4f", -- Oil_Temperature {-1, 0, 130} = {-1, 0, 1}
|
||||
[29] = "%.4f", -- Engine_RPM {400.0, 3600.0} = {0.0, 1.0}
|
||||
-- propeller pitch indicator, changed 1hour every 6degrees of pitch change
|
||||
[30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0}
|
||||
[31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0}
|
||||
-- Manifold_Pressure
|
||||
[32] = "%.4f", -- Manifold_Pressure {0.6, 1.8} = {0.0, 1.0}
|
||||
--fuel system
|
||||
[33] = "%.4f", -- Fuel_Tank_Fuselage {-1.0, 0.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0} -- Liters = {-1.0, 0.0, 0.07, 0.175, 0.31, 0.52, 0.73, 0.88, 1.0}
|
||||
--oxygen pressure indicator
|
||||
[34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
||||
[35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
-- Variometer
|
||||
[36] = "%.2f", -- Variometer {-30, -10, -5, 0, 5, 10, 30} = {-0.3, -0.1, -0.05, 0.0, 0.05, 0.1, 0.3}
|
||||
--Weapon gauges
|
||||
[40] = "%.4f", -- MG131_0_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
|
||||
[41] = "%.4f", -- MG131_1_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
|
||||
[42] = "%.4f", -- MG131_0_Klappanker {0.0, 60.0} = {0.0, 1.0}
|
||||
[43] = "%.4f", -- MG131_1_Klappanker {0.0, 60.0} = {0.0, 1.0}
|
||||
[44] = "%1d", -- LeftWing_MG151_Control_Lamp {0.0, 1.0}
|
||||
[45] = "%1d", -- RightWing_MG151_Control_Lamp {0.0, 1.0}
|
||||
-- Landing Gear Light
|
||||
[56] = "%1d", -- LandingGearRedLight {0.0, 1.0}
|
||||
[57] = "%1d", -- LandingGearGreenLightLeft {0.0, 1.0}
|
||||
[58] = "%1d", -- LandingGearGreenLightRight {0.0, 1.0}
|
||||
-- Pitot_Heat_Lamp
|
||||
[135] = "%1d" -- Pitot_Heat_Lamp {0.0, 29.0} = {0.0, 1.0}
|
||||
-- Fuel_Reserve_Lamp
|
||||
--???[135] = "%1d" -- Fuel_Reserve_Lamp
|
||||
}
|
||||
gES_GlassCockpitConfigArguments =
|
||||
{
|
||||
-- FuseBox Controls - Electrical Switches
|
||||
-- RH Fuse Box Circuit Breakers
|
||||
-- Left Row
|
||||
-- A 100 - Generator Cut-Off Relay
|
||||
[114] = "%1d", -- Generator On {0, 1}
|
||||
[151] = "%1d", -- Generator OFF {0, 1}
|
||||
-- D 100 - Heating CB
|
||||
[115] = "%1d", -- Pitot/Windscreen Heating On {0, 1}
|
||||
[152] = "%1d", -- Pitot/Windscreen Heating OFF {0, 1}
|
||||
-- C 100 - Navigation Lights CB
|
||||
[116] = "%1d", -- Nav. Lights On {0, 1}
|
||||
[153] = "%1d", -- Nav. Lights OFF {0, 1}
|
||||
-- C 101 - Instrument Panel Illumination CB {0, 1}
|
||||
[117] = "%1d", -- UV Lights On {0, 1}
|
||||
[154] = "%1d", -- UV Lights Off {0, 1}
|
||||
-- V 101 - Drop Ordnance & Optional Armament CB
|
||||
[118] = "%1d", -- Wing / Drop Ordnance On {0, 1}
|
||||
[155] = "%1d", -- Wing / Drop Ordnance Off {0, 1}
|
||||
-- V 100 - Systematic & Ignition CB
|
||||
[119] = "%1d", -- Ignition On {0, 1}
|
||||
[156] = "%1d", -- Ignition Off {0, 1}
|
||||
-- Spotlights CB - TODO implement when landing lights rustsatz is available
|
||||
--[] = "%1d", -- Spotlights On {0, 1}
|
||||
--[] = "%1d", -- Spotlights Off {0, 1}
|
||||
-- Right Row
|
||||
-- A 101 - Battery Cut-Off Relay
|
||||
[120] = "%1d", -- Battery On {0, 1}
|
||||
[157] = "%1d", -- Battery Off {0, 1}
|
||||
-- F 135 - Radio CB - Labelled "FuG 16"
|
||||
[121] = "%1d", -- Radio On {0, 1}
|
||||
[158] = "%1d", -- Radio Off {0, 1}
|
||||
-- F 211 - IFF CB - Labelled "FuG 25a"
|
||||
[122] = "%1d", -- IFF On {0, 1}
|
||||
[159] = "%1d", -- IFF Off {0, 1}
|
||||
-- E 101 - Fuel Pump CB - Labelled "Tankpumpe"
|
||||
[123] = "%1d", -- Fuel Pump On {0, 1}
|
||||
[160] = "%1d", -- Fuel Pump Off {0, 1}
|
||||
-- Ignition Controls and Starter and Motor-Related Switches
|
||||
-- Magneto Selector
|
||||
[59] = "%.1f", -- Magnetos (Off, M1, M2, M1+M2) {0.0, 0.1, 0.2, 0.3}
|
||||
-- Starter Handle Cover
|
||||
[51] = "%.1d", -- Starter Handle Cover {0, 1}
|
||||
-- Starter Turn Handle
|
||||
[52] = "%.1d", -- Starter {0, 1}
|
||||
-- WM-Kommandgerat Toggle
|
||||
[62] = "%.1d", -- Governor Automation {0, 1}
|
||||
-- Dashboard and Secondary Switches
|
||||
-- A 104 - Kill Switch
|
||||
[49] = "%.1d", -- Kill Switch {0, 1}
|
||||
-- Button T - Gun Camera Trigger
|
||||
[149] = "%.1d", -- Button T {0, 1}
|
||||
-- SZKK3 Weapons Control Master Switch
|
||||
[37] = "%.1d", -- Weapons Master {0, 1}
|
||||
-- LH SZ 500 Ammo Counter
|
||||
[38] = "%.1f", -- Left Ammo Counter Setter Pinion (axis) {0.0 - 0.0}
|
||||
-- RH SZ 500 Ammo Counter
|
||||
[39] = "%.1f", -- Right Ammo Counter Setter Pinion (axis) {0.0 - 0.0}
|
||||
-- MW50 Operational Toggle
|
||||
[60] = "%.1d", -- MW50 Boost {0, 1}
|
||||
-- Wing Cannons Toggle
|
||||
[61] = "%.1d", -- Wing Cannons {0, 1}
|
||||
-- MK 108 / Wing Guns Toggle
|
||||
[62] = "%.1d", -- MK 108 / R 21 {0, 1}
|
||||
-- R 101 ZSK 244 A Bomb Panel Master Switch
|
||||
-- Operated internally via ZSK 244 A Mode Control
|
||||
-- R 101 ZSK 244 A Mode Selector
|
||||
[64] = "%.1f", -- Bomb Fusing Selector (DIVE (INSTANT), DIVE (DELAYED), OFF, LEVEL (DELAYED), LEVEL (INSTANT)) {0.0, 0.25, 0.5, 0.75, 1.0}
|
||||
-- Illumination Controls
|
||||
-- C 102 LH UV Lamp Rheostat
|
||||
[80] = "%.1f", -- Left UV Lamp Brightness (axis) {0.0 - 0.5}
|
||||
-- C 103 RH UV Lamp Rheostat
|
||||
[82] = "%.1f", -- Right UV Lamp Brightness (axis) {0.0 - 0.5}
|
||||
-- Oxygen Apparatus Controls
|
||||
-- Apparatus Connecting Valve
|
||||
[127] = "%.1d", -- Oxygen Operating Valve {0, 1}
|
||||
[126] = "%.1d", -- Oxygen Emergency By-Pass {0, 1}
|
||||
-- Main Panel Controls
|
||||
-- Undercarriage Controls
|
||||
-- U/C Plungers Cover
|
||||
[53] = "%.1d", -- Undercarriage Controls Cover {0, 1}
|
||||
[54] = "%.1d", -- Undercarriage Raise {1.0, 1.0}
|
||||
[55] = "%.1d", -- Undercarriage Lower {1.0, 1.0}
|
||||
[63] = "%.1d", -- Undercarriage Emergency Release
|
||||
-- Fuel and MW50 Systems Controls
|
||||
-- Fuel Primer Hand Pump
|
||||
[140] = "%.1d", -- Fuel Priming Pump {0, 1}
|
||||
-- Schnellstop Lever
|
||||
[88] = "%.1d", -- Engine Stop {0, 1}
|
||||
-- Booster Pumps Lever
|
||||
[87] = "%.1f", -- Booster Pumps (Off, P1, P2, P1+P2) {0.0, 0.1, 0.2, 0.3}
|
||||
-- Stoff-Kraftstoff Ventilbatterie Lever
|
||||
[96] = "%.1d", -- MW / Fuel {0, 1}
|
||||
-- Fuel Jettison Knob
|
||||
[112] = "%.1d", -- "Fuel / MW Jettison {0, 1}
|
||||
-- Coolant System Controls
|
||||
-- Radiator Mode Lever {0, 1}
|
||||
[113] = "%.1f", -- Radiators Mode (Drive Off, Open, Automatic, Close) {0.0, 0.1, 0.2, 0.3}
|
||||
-- LH Radiator Hose Cut-Off Pull Handle
|
||||
[90] = "%.1d", -- LH Radiator Cut-Off {0, 1}
|
||||
-- RH Radiator Hose Cut-Off Pull Handle
|
||||
[91] = "%.1d", -- RH Radiator Cut-Off {0, 1}
|
||||
-- Navigation Instruments
|
||||
-- Altimeter
|
||||
[11] = "%.2f", -- Altimeter Pressure Set (axis) 1.0 in 0.04 steps
|
||||
-- Artificial Horizon
|
||||
[7] = "%.2f", -- Horizon Cage (axis) {0.0, 0.511} in 0.04 steps
|
||||
-- Repeater Compass
|
||||
[12] = "%.2f", -- Course Set (axis) 0.0 in 0.04 steps
|
||||
-- Instruments
|
||||
-- Clock Scale
|
||||
[21] = "%.8f", -- Scale Set (axis) 0.0 in 0.01612434 steps
|
||||
-- Clock Setter Pinion
|
||||
[22] = "%.1f", -- Adjusting Knob (axis) 0.0 in 0.1 steps
|
||||
-- Clock Freeze Lever
|
||||
[23] = "%.1d", -- Time Setting Lever {0, 1}
|
||||
-- Clock Stopwatch Button
|
||||
[24] = "%.1d", -- Start/Stop/Reset Chronometer
|
||||
-- P 112 Gun Sight Brightness Rheostat {0, 1}
|
||||
[48] = "%.1f", -- Gun Sight Brightness (axis) 0.5 in 0.1 steps
|
||||
-- P 112 Gun Sight Folding Controls
|
||||
[139] = "%.1d", -- Gunsight Fold {0, 1}
|
||||
-- P 112 Gun Sight Smoked Screen Controls
|
||||
[47] = "%.1d", -- Gunsight Smoked Screen {0, 1}
|
||||
-- Radio Controls
|
||||
-- FUG16
|
||||
[128] = "%.1f", -- FuG16ZY Preset Selector (1, 2, TR, SQ) {0.0, 0.1, 0.2, 0.3}
|
||||
[129] = "%.2f", -- FuG16 ZY Fine Tune (axis) 0.5 in 0.05 steps
|
||||
[130] = "%.2f", -- FuG16 ZY Volume (axis) 0.0 in 0.04 steps
|
||||
[131] = "%.1d", -- "Mic. On/Off {0, 1}
|
||||
-- FUG25
|
||||
[132] = "%.1f", -- FuG25 Mode Selector (1, 2) {0.0, 1.0}
|
||||
[133] = "%.1d", -- FuG25 Test {0, 1}
|
||||
-- Left Wall Controls
|
||||
-- Tail Wheel Lock Handle
|
||||
[97] = "%.1d", -- Tail Wheel Lock {0, 1}
|
||||
-- Cockpit Open/Close Control
|
||||
[136] = "%.1d", -- Canopy (Open/Close) {0, 1}
|
||||
-- Cockpit Jettison Pull Handle
|
||||
[83] = "%.1d", -- Jettison Canopy {0, 1}
|
||||
-- Trim Wheel
|
||||
[141] = "%.1d", -- Stabilizer Trim Nose Up {0, 1}
|
||||
[142] = "%.1d", -- Stabilizer Trim Nose Down {0, 1}
|
||||
-- Flaps Wheel
|
||||
[143] = "%.1d", -- Extend Flaps {0, 1}
|
||||
[144] = "%.1d", -- Retract Flaps {0, 1}
|
||||
-- Notwurf / Ordinance Dump
|
||||
[92] = "%.1d", -- Ordinance Emergency Release
|
||||
-- Right Wall Controls
|
||||
-- RH Cockpit Vent
|
||||
--[99] = "%.1d", -- Cockpit Vent {0, 1}
|
||||
-- Flare Gun Trigger
|
||||
[72] = "%.1d", -- Fire Flare Gun
|
||||
-- Engine Controls & Quadrant
|
||||
-- Ground Crew Signal -- TODO remove
|
||||
[145] = "%.1d", -- Signal Starter Crew {0, 1}
|
||||
-- Propellor Control Rocker
|
||||
[85] = "%.1f", -- Decrease RPM {1.0, -1.0}
|
||||
-- Radio Transmit Button
|
||||
[150] = "%.1d", -- Microphone On {0, 1}
|
||||
-- E 103 Propellor Automation Switch
|
||||
[89] = "%.1d", -- Governor Automation {0, 1}
|
||||
-- Cold Weather Start Valve Handle
|
||||
[86] = "%.1d" -- Cold Weather Start {0, 1}
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
-- LwMW50P
|
||||
--SendData("1", string.format("%0.4f", mainPanelDevice:get_argument_value(1)))
|
||||
-- LwASI
|
||||
--SendData("2", string.format("%0.4f", mainPanelDevice:get_argument_value(2)))
|
||||
-- ME4KH2OTemp
|
||||
--SendData("27", string.format("%0.4f", mainPanelDevice:get_argument_value(27)))
|
||||
-- ME4KOilTemp
|
||||
--SendData("28", string.format("%0.4f", mainPanelDevice:get_argument_value(28)))
|
||||
-- LwMAP
|
||||
--SendData("32", string.format("%0.4f", mainPanelDevice:get_argument_value(32)))
|
||||
-- ME4KFuel
|
||||
--SendData("33", string.format("%0.4f", mainPanelDevice:get_argument_value(33)))
|
||||
-- LwO2P
|
||||
--SendData("34", string.format("%0.4f", mainPanelDevice:get_argument_value(34)))
|
||||
-- LwBlink
|
||||
--SendData("35", string.format("%0.4f", mainPanelDevice:get_argument_value(35)))
|
||||
-- LwVSI
|
||||
--SendData("36", string.format("%0.4f", mainPanelDevice:get_argument_value(36)))
|
||||
-- LwALT
|
||||
--Altimeter_km, Altimeter_m, Altimeter_Pressure
|
||||
--[8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0}
|
||||
--[9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0}
|
||||
--[10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0}
|
||||
--[11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0}
|
||||
SendData("2000", string.format("%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(9),
|
||||
mainPanelDevice:get_argument_value(8),
|
||||
mainPanelDevice:get_argument_value(10)))
|
||||
-- LwAtt
|
||||
--AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball
|
||||
--[3] = "%.4f", -- turn indicator {-1.0, 1.0}
|
||||
--[4] = "%.4f", -- Bank {1.0, -1.0}
|
||||
--[5] = "%.4f", -- Pitch {1.0, -1.0}
|
||||
--[6] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||
--[7] = "%.4f", -- Caged {0.0, 1.0}
|
||||
SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(4),
|
||||
mainPanelDevice:get_argument_value(5),
|
||||
mainPanelDevice:get_argument_value(3),
|
||||
mainPanelDevice:get_argument_value(6)))
|
||||
-- LwHead
|
||||
--CompassHeading, CommandedCourse
|
||||
--[13] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||||
--[12] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||||
SendData("2002", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(13),
|
||||
mainPanelDevice:get_argument_value(12)))
|
||||
-- LwClock,
|
||||
-- No Id for Clock
|
||||
--CLOCK_currtime_hours, CLOCK_currtime_minutes, CLOCK_currtime_seconds, CLOCK_chrono_minutes
|
||||
--SendData("2003", string.format("%0.2f;%0.2f;%0.2f;%0.2f", mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value()))
|
||||
-- LwDblP
|
||||
--Oil_Pressure; Fuel_Pressure;
|
||||
--[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0}
|
||||
--[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0}
|
||||
SendData("2004", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(26),
|
||||
mainPanelDevice:get_argument_value(25)))
|
||||
-- LwAFN2
|
||||
--AFN2_Horizontal_Needle, AFN2_Vertical_Needle, AFN2_Signal_Lamp
|
||||
--[14] = "%.4f", -- AFN2_Horizontal_Needle {0.0, 1.0}
|
||||
--[15] = "%.4f", -- AFN2_Vertical_Needle {-1.0, 1.0}
|
||||
--[16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0}
|
||||
SendData("2005", string.format("%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(14),
|
||||
mainPanelDevice:get_argument_value(15),
|
||||
mainPanelDevice:get_argument_value(16)))
|
||||
-- LwProp
|
||||
--Propeller_Pitch_Hour; Propeller_Pitch_Minute
|
||||
--[30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0}
|
||||
--[31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0}
|
||||
SendData("2006", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(30),
|
||||
mainPanelDevice:get_argument_value(31)))
|
||||
end
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll
|
||||
-- In der Regel sind das die Statusanzeigen
|
||||
|
||||
-- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware
|
||||
-- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen
|
||||
-- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der übergeben DCS ID aus dem Spiel ausliest
|
||||
-- 178 ist die DCS ID von dem man die Werte haben will
|
||||
-- Description
|
||||
--SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE
|
||||
--SendDataHW("", mainPanelDevice:get_argument_value()) --
|
||||
|
||||
SendDataHW("16", mainPanelDevice:get_argument_value(16)) -- AFN2_Signal_Lamp
|
||||
SendDataHW("35", mainPanelDevice:get_argument_value(35) > 0.8 and 1 or 0) -- Oxygen_Flow_Blinker
|
||||
SendDataHW("42", mainPanelDevice:get_argument_value(42) > 0.8 and 1 or 0) -- MG131_0_Klappanker
|
||||
SendDataHW("43", mainPanelDevice:get_argument_value(43) > 0.8 and 1 or 0) -- MG131_1_Klappanker
|
||||
SendDataHW("44", mainPanelDevice:get_argument_value(44)) -- LeftWing_MG151_Control_Lamp
|
||||
SendDataHW("45", mainPanelDevice:get_argument_value(45)) -- RightWing_MG151_Control_Lamp
|
||||
SendDataHW("56", mainPanelDevice:get_argument_value(56)) -- LandingGearRedLight
|
||||
SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- LandingGearGreenLightLeft
|
||||
SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- LandingGearGreenLightRight
|
||||
SendDataHW("135", mainPanelDevice:get_argument_value(135) > 0.8 and 1 or 0) -- Pitot_Heat_Lamp
|
||||
-- ??? SendDataHW("135", mainPanelDevice:get_argument_value(135)) -- Fuel_Reserve_Lamp
|
||||
-- Bomb lamps ????
|
||||
--[[
|
||||
WriteToLog('AFN2_Signal_Lamp: '..dump(mainPanelDevice:get_argument_value(16)))
|
||||
WriteToLog('Oxygen_Flow_Blinker: '..dump(mainPanelDevice:get_argument_value(mainPanelDevice:get_argument_value(35))))
|
||||
WriteToLog('MG131_0_Klappanker: '..dump(mainPanelDevice:get_argument_value(42)))
|
||||
WriteToLog('MG131_1_Klappanker: '..dump(mainPanelDevice:get_argument_value(43)))
|
||||
WriteToLog('LeftWing_MG151_Control_Lamp: '..dump(mainPanelDevice:get_argument_value(44)))
|
||||
WriteToLog('RightWing_MG151_Control_Lamp: '..dump(mainPanelDevice:get_argument_value(46)))
|
||||
WriteToLog('LandingGearRedLight: '..dump(mainPanelDevice:get_argument_value(56)))
|
||||
WriteToLog('LandingGearGreenLightLeft: '..dump(mainPanelDevice:get_argument_value(57)))
|
||||
WriteToLog('LandingGearGreenLightRight: '..dump(mainPanelDevice:get_argument_value(58)))
|
||||
WriteToLog('Pitot_Heat_Lamp: '..dump(mainPanelDevice:get_argument_value(135)))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to hardware
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
SendDataHW("ExportID", "Format")
|
||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
|
||||
local lRADIO = GetDevice(14)
|
||||
SendDataHW("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000))
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
||||
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 13, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 16, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function genericRadio(key, value, hardware)
|
||||
end
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,454 +0,0 @@
|
||||
-- MiG-15Bis
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundDCSModule = true
|
||||
|
||||
gES_GlassCockpitConfigEveryFrameArguments =
|
||||
{
|
||||
-- arguments for export every frame
|
||||
-- based of "mainpanel_init.lua"
|
||||
|
||||
[225] = "%.4f", -- Canopy
|
||||
[223] = "%.4f", -- LeftCanopyLever
|
||||
[222] = "%.4f", -- RightCanopyLever
|
||||
[224] = "%.4f", -- AftCanopyLever
|
||||
[14] = "%.4f", -- Variometer
|
||||
[28] = "%.4f", -- Altimeter_km
|
||||
[29] = "%.4f", -- Altimeter_m
|
||||
[31] = "%.4f", -- Altimeter_Pressure
|
||||
[15] = "%.4f", -- CLOCK_currtime_hours
|
||||
[16] = "%.4f", -- CLOCK_currtime_minutes
|
||||
[22] = "%.4f", -- CLOCK_flight_time_meter_status
|
||||
[18] = "%.4f", -- CLOCK_flight_hours
|
||||
[19] = "%.4f", -- CLOCK_flight_minutes
|
||||
[20] = "%.4f", -- CLOCK_seconds_meter_time_minutes
|
||||
[17] = "%.4f", -- CLOCK_seconds_meter_time_seconds
|
||||
[4] = "%.4f", -- IAS
|
||||
[5] = "%.4f", -- TAS
|
||||
[27] = "%.4f", -- MACH
|
||||
[6] = "%.4f", -- AGK_47B_roll
|
||||
[7] = "%.4f", -- AGK_47B_pitch
|
||||
[11] = "%.4f", -- AGK_47B_failure_flag
|
||||
[8] = "%.4f", -- AGK_47B_sideslip
|
||||
[9] = "%.4f", -- AGK_47B_turn
|
||||
[10] = "%.4f", -- AGK_47B_horizon
|
||||
[35] = "%.4f", -- PRV_46_RAlt
|
||||
[32] = "%.4f", -- PDK-45 HeadingScale
|
||||
[33] = "%.4f", -- PDK-45 Heading
|
||||
-- Weapon System
|
||||
[95] = "%.4f", -- N37D_Ready_Lamp
|
||||
[93] = "%.4f", -- NR23_TOP_Ready_Lamp
|
||||
[94] = "%.4f", -- NR23_BOTTOM_Ready_Lamp
|
||||
[100] = "%.4f", -- Tactical_Rel_Lamp
|
||||
[98] = "%.4f", -- LEFT_BOMB_Lamp
|
||||
[99] = "%.4f", -- RIGHT_BOMB_Lamp
|
||||
-- electric system
|
||||
[83] = "%.4f", -- VoltAmperMeter
|
||||
[244] = "%.4f", -- lamps_lightness
|
||||
-- hydraulic system
|
||||
[168] = "%.4f", -- HydraulicPressureMain
|
||||
[139] = "%.4f", -- HydraulicPressureGain
|
||||
[169] = "%.4f", -- HydraulicPressureAirFlaps
|
||||
[165] = "%.4f", -- HydraulicPressureAirGears
|
||||
[172] = "%.4f", -- HydraulicPressureMainAir
|
||||
-- gear system
|
||||
[121] = "%.4f", -- LeftBrakePressure
|
||||
[122] = "%.4f", -- RightBrakePressure
|
||||
-- fuel system
|
||||
[47] = "%.4f", -- FuelQuantity
|
||||
-- air system
|
||||
[188] = "%.4f", -- CanopyAirValveIndication
|
||||
[39] = "%.4f", -- CockpitAltitude
|
||||
[40] = "%.4f", -- PressureDifference
|
||||
-- oxygen system
|
||||
[48] = "%.4f", -- OxygenPressure
|
||||
[60] = "%.4f", -- FlowBlinker
|
||||
[49] = "%.4f", -- FlowPressure
|
||||
-- Engine
|
||||
[42] = "%.4f", -- EngineTachometer
|
||||
[41] = "%.4f", -- EngineTemperature
|
||||
[45] = "%.4f", -- OilTemperature
|
||||
[44] = "%.4f", -- OilPressure
|
||||
[43] = "%.4f", -- EngineFuelPressure
|
||||
[46] = "%.4f", -- FuelPressure
|
||||
-- radio compass
|
||||
[238] = "%.4f", -- ARC5_Band
|
||||
[176] = "%.4f", -- ARC5_TuningMeter
|
||||
[175] = "%.4f", -- ARC5_Tuning
|
||||
[38] = "%.4f", -- ARC5_Bearing
|
||||
[239] = "%.4f", -- ARC5_FreqScale
|
||||
-- Radio RSI-6K
|
||||
[235] = "%.4f", -- RadioAntennaPower
|
||||
[128] = "%.4f", -- RadioReceiverKnob
|
||||
[127] = "%.4f", -- RadioReceiverInd
|
||||
[144] = "%.4f", -- RadioReceiverGauge
|
||||
[245] = "%.4f", -- ASP_3N_Range
|
||||
-- Lamps
|
||||
-- electric system
|
||||
[57] = "%.4f", -- lamp_GeneratorOff
|
||||
[58] = "%.4f", -- lamp_Ignition
|
||||
-- power plant
|
||||
[119] = "%.4f", -- lamp_IsolatingValve
|
||||
-- gear system
|
||||
[75] = "%.4f", -- lamp_LeftGearExt
|
||||
[74] = "%.4f", -- lamp_LeftGearRet
|
||||
[79] = "%.4f", -- lamp_RightGearExt
|
||||
[78] = "%.4f", -- lamp_RightGearRet
|
||||
[77] = "%.4f", -- lamp_NoseGearExt
|
||||
[76] = "%.4f", -- lamp_NoseGearRet
|
||||
[53] = "%.4f", -- lamp_ExtendGears
|
||||
-- fuel system
|
||||
[56] = "%.4f", -- lamp_Remain300
|
||||
[50] = "%.4f", -- lamp_AftEmpty
|
||||
[52] = "%.4f", -- lamp_DropTanks
|
||||
[51] = "%.4f", -- lamp_BoostPressure
|
||||
-- control system
|
||||
[113] = "%.4f", -- lamp_TrimmerNeutral
|
||||
[59] = "%.4f", -- lamp_FlapsExt
|
||||
[124] = "%.4f", -- lamp_AirBrakeExt
|
||||
-- fire extinguisher system
|
||||
[135] = "%.4f", -- lamp_FireDetected
|
||||
-- ARC-5
|
||||
[183] = "%.4f", -- lamp_ARC_5
|
||||
[218] = "%.4f", -- light_ARC_5_scale
|
||||
-- MRP-48P
|
||||
[54] = "%.4f", -- lamp_Marker
|
||||
-- Light System
|
||||
[226] = "%.4f", -- light_LeftUV
|
||||
[215] = "%.4f", -- light_CenterUV
|
||||
[227] = "%.4f", -- light_RightUV
|
||||
[217] = "%.4f", -- light_Panels
|
||||
[216] = "%.4f", -- light_AuxLeftPanel
|
||||
-- Gun Camera
|
||||
[55] = "%.4f" -- lamp_GunCamera
|
||||
}
|
||||
gES_GlassCockpitConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
|
||||
-- Cockpit mechanics
|
||||
[221] = "%.4f", -- Emergency Canopy Jettison - Pull to jettison
|
||||
[222] = "%.4f", -- Right Canopy Lever, OPEN/CLOSE
|
||||
[224] = "%.4f", -- Aft Canopy Lever, OPEN/CLOSE
|
||||
-- Control system
|
||||
[114] = "%.4f", -- Elevator Trimmer Switch, PULL(CLIMB)/OFF/PUSH(DESCEND)
|
||||
[142] = "%.4f", -- Aileron Trimmer Switch, LEFT/OFF/RIGHT
|
||||
[207] = "%.4f", -- Wing Flaps Handle, RETRACT/NEUTRAL/20 degrees/55 degrees
|
||||
[125] = "%.4f", -- Airbrake Switch, CLOSE/OPEN
|
||||
[203] = "%.4f", -- Hydro Booster Lever, ON/OFF
|
||||
[204] = "%.4f", -- Throttle Friction Lever
|
||||
[198] = "%.4f", -- Airbrake Button, Hold to extend
|
||||
-- Electric system
|
||||
[84] = "%.4f", -- Ampere- & Voltmeter - Push to view Volts
|
||||
[149] = "%.4f", -- Air Start Switch, ON/OFF
|
||||
[81] = "%.4f", -- Pitot and Clock Heater Switch, ON/OFF
|
||||
[200] = "%.4f", -- Engine Start Button - Push to start
|
||||
[214] = "%.4f", -- Engine Start Button Cover
|
||||
-- Circuit Breakers
|
||||
[117] = "%.4f", -- Transfer Pump Switch, ON/OFF
|
||||
[115] = "%.4f", -- Booster Pump Switch, ON/OFF
|
||||
[120] = "%.4f", -- Ignition Switch, ON/OFF
|
||||
[116] = "%.4f", -- Instruments and Lights Switch, ON/OFF
|
||||
-- Right Panel
|
||||
[152] = "%.4f", -- Accumulator Switch, ON/OFF
|
||||
[153] = "%.4f", -- Generator Switch, ON/OFF
|
||||
[151] = "%.4f", -- Nose Light Master Switch, ON/OFF
|
||||
[154] = "%.4f", -- Trim Master Switch, ON/OFF
|
||||
[155] = "%.4f", -- AGK-47B Artificial Horizon + DGMK-3 Switch, ON/OFF
|
||||
[158] = "%.4f", -- Radio Switch, ON/OFF
|
||||
[157] = "%.4f", -- Bombs Switch, ON/OFF
|
||||
[156] = "%.4f", -- Emergency Drop Switch, ON/OFF
|
||||
[159] = "%.4f", -- ARC Switch, ON/OFF
|
||||
[160] = "%.4f", -- RV-2 Radio Altimeter Switch, ON/OFF
|
||||
[161] = "%.4f", -- NR-23 Cannon Switch, ON/OFF
|
||||
[162] = "%.4f", -- N-37D Cannon Switch, ON/OFF
|
||||
[163] = "%.4f", -- ASP-3N Gunsight Switch, ON/OFF
|
||||
[164] = "%.4f", -- S-13 Gun Camera Switch, ON/OFF
|
||||
-- HydroSystem
|
||||
[171] = "%.4f", -- Emergency Flaps Valve
|
||||
[167] = "%.4f", -- Emergency Gears Valve
|
||||
[170] = "%.4f", -- Emergency Flaps Valve Cover
|
||||
[166] = "%.4f", -- Emergency Gears Valve Cover
|
||||
[186] = "%.4f", -- Emergency System Filling Valve
|
||||
[242] = "%.4f", -- Air Net Valve
|
||||
[241] = "%.4f", -- Cockpit Filling Valve
|
||||
-- Gear System
|
||||
[71] = "%.4f", -- Landing Gear Handle, UP/DOWN
|
||||
[72] = "%.4f", -- Gear Lamps Test Button - Push to test
|
||||
[210] = "%.4f", -- Right Emergency Gear Release Handle
|
||||
[209] = "%.4f", -- Left Emergency Gear Release Handle
|
||||
[85] = "%.4f", -- Landing Gear Handle Lock, Lock/Unlock
|
||||
-- Fuel System
|
||||
[82] = "%.4f", -- Drop Tank Signal Switch, ON/OFF
|
||||
[141] = "%.4f", -- Oxygen Supply Valve
|
||||
[143] = "%.4f", -- Air Valve
|
||||
[243] = "%.4f", -- Oxygen Emergency Valve
|
||||
-- Conditioning and Heating System
|
||||
[187] = "%.4f", -- Cockpit Air Valve
|
||||
[86] = "%.4f", -- Ventilation Valve
|
||||
-- Internal Lights System
|
||||
[184] = "%.4f", -- Left UV Light Rheostat
|
||||
[185] = "%.4f", -- Right UV Light Rheostat
|
||||
[220] = "%.4f", -- Panels Light Rheostat
|
||||
-- Nav Lights System
|
||||
[111] = "%.4f", -- External Lights Switch, ON/OFF
|
||||
[80] = "%.4f", -- Nose Light Switch, ON/OFF
|
||||
-- Power Plant
|
||||
[208] = "%.4f", -- Engine Stop, CLOSE/OPEN
|
||||
[118] = "%.4f", -- Isolating Valve Switch, ON/OFF
|
||||
-- Fire Extinguisher System
|
||||
[136] = "%.4f", -- Engine Fire Extinguisher Button Cover
|
||||
[137] = "%.4f", -- Engine Fire Extinguisher Button
|
||||
[138] = "%.4f", -- Engine Fire Warning Light Test Button - Push to test
|
||||
-- Signal Flares
|
||||
[129] = "%.4f", -- Signal Flare Switch, ON/OFF
|
||||
[130] = "%.4f", -- Signal Flare Yellow Button
|
||||
[131] = "%.4f", -- Signal Flare Green Button
|
||||
[132] = "%.4f", -- Signal Flare Red Button
|
||||
[133] = "%.4f", -- Signal Flare White Button
|
||||
----------------------------------------------------
|
||||
-- Devices
|
||||
-- AGK-47B
|
||||
[12] = "%.4f", -- AGK-47B Artificial Horizon Cage - Pull to cage
|
||||
[13] = "%.4f", -- AGK-47B Artificial Horizon Zero Pitch Trim Knob
|
||||
--VD-15
|
||||
[30] = "%.4f", -- Barometric Pressure QFE Knob
|
||||
--PRV-46
|
||||
[36] = "%.4f", -- PRV-46 Radar Altimeter Indicator Range Switch, 120m/1200m AGL
|
||||
[37] = "%.4f", -- PRV-46 Radar Altimeter Indicator Power Switch, ON/OFF
|
||||
--PDK-45
|
||||
[34] = "%.4f", -- Heading Knob
|
||||
[61] = "%.4f", -- Fast Slave Button
|
||||
-- CLOCK
|
||||
[23] = "%.4f", -- AChS-1 Cockpit Chronograph Left Knob
|
||||
[25] = "%.4f", -- AChS-1 Cockpit Chronograph Right Knob
|
||||
-- Weapon System
|
||||
[92] = "%.4f", -- N-37D Cannon Reload Button
|
||||
[90] = "%.4f", -- NR-23 (Top) Cannon Reload Button
|
||||
[91] = "%.4f", -- NR-23 (Bottom) Cannon Reload Button
|
||||
[96] = "%.4f", -- Tactical Release Switch, ON/OFF
|
||||
[97] = "%.4f", -- Emergency Release Button
|
||||
[104] = "%.4f", -- Emergency Release Button Cover
|
||||
--ASP-3N Gunsight
|
||||
[101] = "%.4f", -- ASP-3N Gunsight Mode, GYRO/FIXED
|
||||
[106] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever
|
||||
[103] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever
|
||||
[102] = "%.4f", -- ASP-3N Gunsight Brightness Knob
|
||||
[201] = "%.4f", -- ASP-3N Gunsight Target Distance
|
||||
[105] = "%.4f", -- ASP-3N Gunsight Color Filter, ON/OFF
|
||||
-- ARC-5 radio compass
|
||||
[180] = "%.4f", -- ARC-5 Audio Volume Control
|
||||
[177] = "%.4f", -- ARC-5 Frequency Band Switch
|
||||
[174] = "%.4f", -- ARC-5 Function Selector Switch, OFF/COMP/ANT./LOOP
|
||||
[178] = "%.4f", -- ARC-5 LOOP L-R Switch
|
||||
[175] = "%.4f", -- ARC-5 Tuning Crank
|
||||
[181] = "%.4f", -- ARC-5 Scale Light Control
|
||||
[173] = "%.4f", -- ARC-5 TLG-TLF Switch
|
||||
[182] = "%.4f", -- ARC-5 Take Control Button
|
||||
[123] = "%.4f", -- ARC-5 Near/Far NDB Switch
|
||||
[146] = "%.4f", -- ARC-5 NDB 1 Switch
|
||||
[147] = "%.4f", -- ARC-5 NDB 2 Switch
|
||||
[148] = "%.4f", -- ARC-5 NDB 3 Switch
|
||||
-- RSI-6K radio
|
||||
[126] = "%.4f", -- RSI-6K Audio Volume Control
|
||||
[232] = "%.4f", -- RSI-6K Wave Control
|
||||
[230] = "%.4f", -- RSI-6K Antenna Control
|
||||
[231] = "%.4f", -- RSI-6K Wave Lock
|
||||
[233] = "%.4f", -- RSI-6K Antenna Lock
|
||||
[128] = "%.4f", -- RSI-6K Receiver Tuning
|
||||
[140] = "%.4f", -- RSI-6K Receive/ARC
|
||||
[240] = "%.4f", -- RSI-6K Forced Mode, ON/OFF
|
||||
[202] = "%.4f", -- Microphone Button
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
-- ADI
|
||||
-- AGK_47B_roll;AGK_47B_pitch;AGK_47B_failure_flag;AGK_47B_sideslip;
|
||||
-- AGK_47B_turn;AGK_47B_horizon
|
||||
SendData(2001, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.1f",
|
||||
mainPanelDevice:get_argument_value(6),
|
||||
mainPanelDevice:get_argument_value(7),
|
||||
mainPanelDevice:get_argument_value(11),
|
||||
mainPanelDevice:get_argument_value(8),
|
||||
mainPanelDevice:get_argument_value(9),
|
||||
mainPanelDevice:get_argument_value(10)))
|
||||
-- Altimeter
|
||||
-- Altimeter_km;Altimeter_m;Altimeter_Pressure
|
||||
SendData(2002, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(28),
|
||||
mainPanelDevice:get_argument_value(29),
|
||||
mainPanelDevice:get_argument_value(31)))
|
||||
-- Airspeed
|
||||
-- IAS;TAS
|
||||
SendData(2003, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(4),
|
||||
mainPanelDevice:get_argument_value(5)))
|
||||
-- Brake
|
||||
-- LeftBrakePressure;RightBrakePressure
|
||||
SendData(2004, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(121),
|
||||
mainPanelDevice:get_argument_value(122)))
|
||||
-- Cockpit
|
||||
-- CockpitAltitude;PressureDifference;
|
||||
SendData(2005, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(39),
|
||||
mainPanelDevice:get_argument_value(40)))
|
||||
-- FuelFlow
|
||||
-- OilTemperature;OilPressure;EngineFuelPressure;
|
||||
SendData(2006, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(45),
|
||||
mainPanelDevice:get_argument_value(44),
|
||||
mainPanelDevice:get_argument_value(43)))
|
||||
-- Gear
|
||||
-- lamp_LeftGearExt;lamp_LeftGearRet;lamp_RightGearExt;lamp_RightGearRet;lamp_NoseGearExt;
|
||||
-- lamp_NoseGearRet;lamp_ExtendGears
|
||||
SendData(2007, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f;%.3f",
|
||||
mainPanelDevice:get_argument_value(75),
|
||||
mainPanelDevice:get_argument_value(74),
|
||||
mainPanelDevice:get_argument_value(79),
|
||||
mainPanelDevice:get_argument_value(78),
|
||||
mainPanelDevice:get_argument_value(77),
|
||||
mainPanelDevice:get_argument_value(76),
|
||||
mainPanelDevice:get_argument_value(53)))
|
||||
-- GyroCompass
|
||||
-- HeadingScale;Heading
|
||||
SendData(2008, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(32),
|
||||
mainPanelDevice:get_argument_value(33)))
|
||||
-- VoltAmpMeter
|
||||
-- VoltAmperMeter; lamps_lightness;
|
||||
SendData(2009, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(83),
|
||||
mainPanelDevice:get_argument_value(244)))
|
||||
-- Clock
|
||||
-- CLOCK_currtime_hours;CLOCK_currtime_minutes;CLOCK_flight_time_meter_status;
|
||||
-- CLOCK_flight_hours; CLOCK_flight_minutes;CLOCK_seconds_meter_time_minutes;
|
||||
-- CLOCK_seconds_meter_time_seconds
|
||||
SendData(2010, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f;%.3f",
|
||||
mainPanelDevice:get_argument_value(15),
|
||||
mainPanelDevice:get_argument_value(16),
|
||||
mainPanelDevice:get_argument_value(22),
|
||||
mainPanelDevice:get_argument_value(18),
|
||||
mainPanelDevice:get_argument_value(19),
|
||||
mainPanelDevice:get_argument_value(20),
|
||||
mainPanelDevice:get_argument_value(17)))
|
||||
-- Compass
|
||||
-- heading, pitch, bank
|
||||
SendData(2011, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(33),
|
||||
mainPanelDevice:get_argument_value(7),
|
||||
mainPanelDevice:get_argument_value(6)))
|
||||
end
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
-- SendDataHW("", mainPanelDevice:get_argument_value()) --
|
||||
-- Lamps
|
||||
-- electric system
|
||||
SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- lamp_GeneratorOff
|
||||
SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- lamp_Ignition
|
||||
-- power plant
|
||||
SendDataHW("119", mainPanelDevice:get_argument_value(119)) -- lamp_IsolatingValve
|
||||
-- gear system
|
||||
SendDataHW("75", mainPanelDevice:get_argument_value(75)) -- lamp_LeftGearExt
|
||||
SendDataHW("74", mainPanelDevice:get_argument_value(74)) -- lamp_LeftGearRet
|
||||
SendDataHW("79", mainPanelDevice:get_argument_value(79)) -- lamp_RightGearExt
|
||||
SendDataHW("78", mainPanelDevice:get_argument_value(78)) -- lamp_RightGearRet
|
||||
SendDataHW("77", mainPanelDevice:get_argument_value(77)) -- lamp_NoseGearExt
|
||||
SendDataHW("76", mainPanelDevice:get_argument_value(76)) -- lamp_NoseGearRet
|
||||
SendDataHW("53", mainPanelDevice:get_argument_value(53)) -- lamp_ExtendGears
|
||||
-- fuel system
|
||||
SendDataHW("56", mainPanelDevice:get_argument_value(56)) -- lamp_Remain300
|
||||
SendDataHW("50", mainPanelDevice:get_argument_value(50)) -- lamp_AftEmpty
|
||||
SendDataHW("52", mainPanelDevice:get_argument_value(52)) -- lamp_DropTanks
|
||||
SendDataHW("51", mainPanelDevice:get_argument_value(51)) -- lamp_BoostPressure
|
||||
-- control system
|
||||
SendDataHW("113", mainPanelDevice:get_argument_value(113)) -- lamp_TrimmerNeutral
|
||||
SendDataHW("59", mainPanelDevice:get_argument_value(59)) -- lamp_FlapsExt
|
||||
SendDataHW("124", mainPanelDevice:get_argument_value(124)) -- lamp_AirBrakeExt
|
||||
-- fire extinguisher system
|
||||
SendDataHW("135", mainPanelDevice:get_argument_value(135)) -- lamp_FireDetected
|
||||
-- ARC-5
|
||||
SendDataHW("183", mainPanelDevice:get_argument_value(183)) -- lamp_ARC_5
|
||||
SendDataHW("218", mainPanelDevice:get_argument_value(218)) -- light_ARC_5_scale
|
||||
-- MRP-48P
|
||||
SendDataHW("54", mainPanelDevice:get_argument_value(54)) -- lamp_Marker
|
||||
-- Light System
|
||||
SendDataHW("226", mainPanelDevice:get_argument_value(226)) -- light_LeftUV
|
||||
SendDataHW("215", mainPanelDevice:get_argument_value(215)) -- light_CenterUV
|
||||
SendDataHW("227", mainPanelDevice:get_argument_value(227)) -- light_RightUV
|
||||
SendDataHW("217", mainPanelDevice:get_argument_value(217)) -- light_Panels
|
||||
SendDataHW("216", mainPanelDevice:get_argument_value(216)) -- light_AuxLeftPanel
|
||||
-- Gun Camera
|
||||
SendDataHW("55", mainPanelDevice:get_argument_value(55)) -- lamp_GunCamera
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
end
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to hardware
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
SendDataHW("ExportID", "Format")
|
||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
||||
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 13, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 73, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function genericRadio(key, value, hardware)
|
||||
end
|
||||
@@ -1,841 +0,0 @@
|
||||
-- MiG-29A Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundFCModule = true
|
||||
|
||||
-- auxiliary function
|
||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / MiG-29A --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
||||
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- customizing for HELOS
|
||||
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
|
||||
lBank = math.deg(lBank) -- BANK (Radian to Grad)
|
||||
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
|
||||
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
|
||||
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
|
||||
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
|
||||
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
|
||||
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
|
||||
lHSI_RMI = 360 - lHSI_RMI
|
||||
lIAS = lIAS * 3.6 -- change from m/s to km/h
|
||||
|
||||
SendData("1", string.format("%.2f", lPitch) )
|
||||
SendData("2", string.format("%.2f", lBank) )
|
||||
SendData("3", string.format("%.2f", lYaw) )
|
||||
SendData("4", string.format("%.2f", lAltBar) )
|
||||
SendData("5", string.format("%.2f", lAltRad) )
|
||||
SendData("6", string.format("%.2f", lHSI_ADF) )
|
||||
SendData("7", string.format("%.2f", lHSI_RMI) )
|
||||
SendData("8", string.format("%.2f", lHeading) )
|
||||
SendData("9", string.format("%.2f", lEngineRPMleft) )
|
||||
SendData("10", string.format("%.2f", lEngineRPMright) )
|
||||
SendData("11", string.format("%.2f", lEngineTempLeft) )
|
||||
SendData("12", string.format("%.2f", lEngineTempRight) )
|
||||
SendData("13", string.format("%.2f", lVVI) )
|
||||
SendData("14", string.format("%.2f", lIAS) )
|
||||
SendData("15", string.format("%.2f", lDistanceToWay) )
|
||||
SendData("16", string.format("%.2f", lAoA) )
|
||||
SendData("17", string.format("%.2f", lGlide) )
|
||||
SendData("18", string.format("%.2f", lSide) )
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
local lRadToDCSsignd = math.pi
|
||||
local lRadToDCSunsignd = math.pi * 2
|
||||
local lDefaultNull = 0.0
|
||||
local lDefaultOne = 1.0
|
||||
|
||||
-- IAS Indicator (IAS, Thousend) {"%.4f;%.4f"}
|
||||
FC_Russian_AirSpeed_1000hkm(1)
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
FC_Russian_AOA_MiG29(3)
|
||||
|
||||
-- ADI
|
||||
FC_Russian_ADI_Old(4)
|
||||
|
||||
-- HSI
|
||||
FC_Russian_HSI(lDistanceToWay, 5)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
|
||||
FC_Russian_VVI_Old(6)
|
||||
|
||||
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
|
||||
FC_Russian_RadarAltimeter_1000m(100, 7)
|
||||
|
||||
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
|
||||
FC_Russian_BarometricAltimeter_30000(8)
|
||||
|
||||
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
|
||||
FC_Russian_EngineRPM(9)
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempLeft + 80, 10) -- differenc fromtechnical temperature to showing temperature
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempRight + 80, 11)
|
||||
|
||||
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
|
||||
FC_Russian_Clock_ACS1(12)
|
||||
|
||||
-- Mach {max, Mach}
|
||||
local lMachTmp = 0
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0.0 -- minimaler Eingangswert
|
||||
x_max = 3.0 -- maximaler Eingangswert
|
||||
x = 1.65 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1.0 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 3.0 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 0.33333333333333333333333333333333 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.00000000000000000000000000000001 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.55 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lMachTmp = 0.33333333333333333333333333333333 * lMachNumber + 0.00000000000000000000000000000001
|
||||
|
||||
SendData("13", string.format("%0.4f;%0.4f", lMachTmp, 0.0))
|
||||
end
|
||||
else
|
||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
end
|
||||
|
||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
FC_RadarWarning_SPO15(14)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal + lEngineInfo.fuel_external
|
||||
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lTotalFuel_7_5 = 0
|
||||
local lTotalFuel_5_0 = 0
|
||||
|
||||
if lTotalFuel < 7500 then
|
||||
if lTotalFuel > 5000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 5000 -- minimaler Eingangswert
|
||||
x_max = 7500 -- maximaler Eingangswert
|
||||
x = 6000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 2500 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 0.0004 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -2.0 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.4 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_7_5 = 0.0004 * lTotalFuel + -2.0
|
||||
else
|
||||
lTotalFuel_7_5 = 0.0
|
||||
end
|
||||
else
|
||||
lTotalFuel_7_5 = 1.0
|
||||
end
|
||||
if lTotalFuel < 5000 then
|
||||
--[[
|
||||
y_min = 0.04 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0 -- minimaler Eingangswert
|
||||
x_max = 5000 -- maximaler Eingangswert
|
||||
x = 3000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 0.96 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 5000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 0.000192 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.04 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.616 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_5_0 = 0.000192 * lTotalFuel + 0.04
|
||||
else
|
||||
lTotalFuel_5_0 = 1.0
|
||||
end
|
||||
|
||||
-- TotalFuel_5_0
|
||||
-- TotalFuel_7_5
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- BingoLight
|
||||
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
|
||||
lTotalFuel_5_0,
|
||||
lTotalFuel_7_5,
|
||||
0,
|
||||
(lEngineInfo.fuel_internal < 3200.0 and 1 or 0), -- Tank warning 1
|
||||
(lEngineInfo.fuel_internal < 2800.0 and 1 or 0), -- Tank warning 2
|
||||
(lEngineInfo.fuel_internal < 1400.0 and 1 or 0), -- Tank warning 3
|
||||
(lEngineInfo.fuel_internal < 800.0 and 1 or 0))) -- Tank warning 4
|
||||
|
||||
-- Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
FC_EKRAN(16)
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
--WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
local lWarningLight = 0.0
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
if lTrueAirSpeed ~= nil then
|
||||
--WriteToLog('lTrueAirSpeed: '..dump(lTrueAirSpeed))
|
||||
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
end
|
||||
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
|
||||
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
|
||||
|
||||
-- left gear {0, 1}
|
||||
-- right gear {0, 1}
|
||||
-- nose gear {0, 1}
|
||||
-- WarningLight
|
||||
-- Flap 1
|
||||
-- Flap 2
|
||||
-- Nose Flap
|
||||
-- Speedbreakes on {0, 1}
|
||||
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d",
|
||||
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
|
||||
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
|
||||
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
|
||||
lWarningLight,
|
||||
-- (lMechInfo.flaps.value > 0.47 and 1 or 0), -- flap 1
|
||||
-- (lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap 2
|
||||
(lMechInfo.flaps.status == 1 and 1 or 0), -- flap 1
|
||||
(lMechInfo.flaps.status == 2 and 1 or 0), -- flap 2
|
||||
(lMechInfo.noseflap.value > 0.1 and 1 or 0), -- noseflap
|
||||
(lMechInfo.speedbrakes.status == 1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
FC_Russian_AirIntake(21)
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
||||
WeaponStatusPanel()
|
||||
MechanicalDevicesIndicator()
|
||||
StatusLamp()
|
||||
FuelQuantityIndicator()
|
||||
SightingSystem()
|
||||
SPO15RWR()
|
||||
FlareChaff()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function SightingSystem(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
|
||||
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||
end
|
||||
|
||||
function FlareChaff(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
--WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
--[chaff] = number: "30"
|
||||
--[flare] = number: "30"
|
||||
|
||||
SendDataHW("800", lSnares.chaff + lSnares.flare, lHardware )
|
||||
end
|
||||
|
||||
function StatusLamp(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
|
||||
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
|
||||
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
|
||||
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
|
||||
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
|
||||
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
|
||||
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
|
||||
|
||||
SendDataHW("730", (lEngineInfo.RPM.left > 100.0 and 1 or 0), lHardware ) -- lamp after burner left engine
|
||||
SendDataHW("731", (lEngineInfo.RPM.right > 100.0 and 1 or 0), lHardware ) -- lam after burner right engine
|
||||
end
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
|
||||
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function WeaponStatusPanel(hardware)
|
||||
local lHardware = hardware or 1
|
||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||
gES_PayloadInfo = LoGetPayloadInfo()
|
||||
if gES_PayloadInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
||||
--[[ exsample
|
||||
[Stations] = {
|
||||
[1] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[2] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[3] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[4] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[5] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[6] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[7] = {
|
||||
[CLSID] = string: "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "43"
|
||||
[level1] = number: "1"
|
||||
[level4] = number: "17"
|
||||
[level2] = number: "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
[CurrentStation] = number: "3"
|
||||
[Cannon] = {
|
||||
[shells] = number: "150"
|
||||
}
|
||||
]]
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
-------------------------------
|
||||
| | | | | | |
|
||||
1 2 3 C 4 5 6
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells ) -- count cannon shells
|
||||
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||
SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
|
||||
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||
SendDataHW("103", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||
SendDataHW("104", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||
SendDataHW("105", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||
--SendDataHW("106", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
|
||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation )
|
||||
|
||||
-- defination
|
||||
gES_TmpStationToPanel = {}
|
||||
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
|
||||
gES_TmpStationToPanel[2] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware } -- right
|
||||
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[4] = {Panel = 5, StationID = 103, CurrentID = 203, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 104, CurrentID = 204, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[6] = {Panel = 4, StationID = 105, CurrentID = 205, HardwareID = lHardware }
|
||||
|
||||
if gES_PayloadInfo.CurrentStation ~= 0 then -- gegebenenfalls prüfen ob sich CurrentStation geändert hat
|
||||
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl
|
||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||
end
|
||||
end
|
||||
|
||||
function FuelQuantityIndicator(hardware)
|
||||
local lHardware = hardware or 1
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[7].CLSID == 2BEC576B-CDF5-4B7F-961F-B0FA4312B841 -- ext 1500l Fuel Tank
|
||||
]]
|
||||
|
||||
SendDataHW("300", string.format("%d", math.round(((lEngineInfo.fuel_internal + lEngineInfo.fuel_external) / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- internal fuel in kg
|
||||
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[7].CLSID == "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}" then -- center tanks presend and full
|
||||
SendDataHW("303", ((lEngineInfo.fuel_external < 1200.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
end
|
||||
if lPayloadInfo.Stations[3].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" or
|
||||
lPayloadInfo.Stations[4].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" then -- external tank presend and full (panel 2 and 5)
|
||||
SendDataHW("304", ((lEngineInfo.fuel_internal < 2830.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end]]
|
||||
|
||||
SendDataHW("304", (lEngineInfo.fuel_internal < 3200.0 and 1 or 0), lHardware ) -- Tank warning 1
|
||||
SendDataHW("305", (lEngineInfo.fuel_internal < 2800.0 and 1 or 0), lHardware ) -- Tank warning 2
|
||||
SendDataHW("306", (lEngineInfo.fuel_internal < 1390.0 and 1 or 0), lHardware ) -- Tank warning 3
|
||||
SendDataHW("307", (lEngineInfo.fuel_internal < 760.0 and 1 or 0), lHardware ) -- Tank warning 4
|
||||
--SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
|
||||
|
||||
end
|
||||
|
||||
function MechanicalDevicesIndicator(hardware)
|
||||
local lHardware = hardware or 1
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--SendDataHW("500", lMechInfo.gear.status )
|
||||
--SendDataHW("501", lMechInfo.gear.value )
|
||||
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
|
||||
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
|
||||
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
|
||||
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
|
||||
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
|
||||
|
||||
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
|
||||
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
--SendDataHW("520", lMechInfo.wheelbrakes.status ) -- not in use
|
||||
--SendDataHW("521", lMechInfo.wheelbrakes.value ) -- not in use
|
||||
|
||||
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
|
||||
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
|
||||
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
|
||||
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
|
||||
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
SendDataHW("534", (lMechInfo.gear.status > 1.0 and 1 or 0), lHardware ) -- Intake FOD shields
|
||||
|
||||
--SendDataHW("540", lMechInfo.parachute.status )
|
||||
SendDataHW("541", (lMechInfo.parachute.value < 0.5 and 1 or 0), lHardware )
|
||||
|
||||
--SendDataHW("550", lMechInfo.noseflap.status )
|
||||
SendDataHW("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0), lHardware )
|
||||
|
||||
SendDataHW("560", lMechInfo.airintake.status, lHardware )
|
||||
--SendDataHW("561", lMechInfo.airintake.value )
|
||||
end
|
||||
@@ -1,840 +0,0 @@
|
||||
-- MiG-29S Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundFCModule = true
|
||||
|
||||
-- auxiliary function
|
||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / MiG-29S --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
||||
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- customizing for HELOS
|
||||
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
|
||||
lBank = math.deg(lBank) -- BANK (Radian to Grad)
|
||||
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
|
||||
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
|
||||
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
|
||||
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
|
||||
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
|
||||
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
|
||||
lHSI_RMI = 360 - lHSI_RMI
|
||||
lIAS = lIAS * 3.6 -- change from m/s to km/h
|
||||
|
||||
SendData("1", string.format("%.2f", lPitch) )
|
||||
SendData("2", string.format("%.2f", lBank) )
|
||||
SendData("3", string.format("%.2f", lYaw) )
|
||||
SendData("4", string.format("%.2f", lAltBar) )
|
||||
SendData("5", string.format("%.2f", lAltRad) )
|
||||
SendData("6", string.format("%.2f", lHSI_ADF) )
|
||||
SendData("7", string.format("%.2f", lHSI_RMI) )
|
||||
SendData("8", string.format("%.2f", lHeading) )
|
||||
SendData("9", string.format("%.2f", lEngineRPMleft) )
|
||||
SendData("10", string.format("%.2f", lEngineRPMright) )
|
||||
SendData("11", string.format("%.2f", lEngineTempLeft) )
|
||||
SendData("12", string.format("%.2f", lEngineTempRight) )
|
||||
SendData("13", string.format("%.2f", lVVI) )
|
||||
SendData("14", string.format("%.2f", lIAS) )
|
||||
SendData("15", string.format("%.2f", lDistanceToWay) )
|
||||
SendData("16", string.format("%.2f", lAoA) )
|
||||
SendData("17", string.format("%.2f", lGlide) )
|
||||
SendData("18", string.format("%.2f", lSide) )
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
local lRadToDCSsignd = math.pi
|
||||
local lRadToDCSunsignd = math.pi * 2
|
||||
local lDefaultNull = 0.0
|
||||
local lDefaultOne = 1.0
|
||||
|
||||
-- IAS Indicator (IAS, Thousend) {"%.4f;%.4f"}
|
||||
FC_Russian_AirSpeed_1000hkm(1)
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
FC_Russian_AOA_MiG29(3)
|
||||
|
||||
-- ADI
|
||||
FC_Russian_ADI_Old(4)
|
||||
|
||||
-- HSI
|
||||
FC_Russian_HSI(lDistanceToWay, 5)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
|
||||
FC_Russian_VVI_Old(6)
|
||||
|
||||
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
|
||||
FC_Russian_RadarAltimeter_1000m(100, 7)
|
||||
|
||||
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
|
||||
FC_Russian_BarometricAltimeter_30000(8)
|
||||
|
||||
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
|
||||
FC_Russian_EngineRPM(9)
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempLeft + 80, 10) -- differenc fromtechnical temperature to showing temperature
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempRight + 80, 11)
|
||||
|
||||
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
|
||||
FC_Russian_Clock_ACS1(12)
|
||||
|
||||
-- Mach {max, Mach}
|
||||
local lMachTmp = 0
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0.0 -- minimaler Eingangswert
|
||||
x_max = 3.0 -- maximaler Eingangswert
|
||||
x = 1.65 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1.0 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 3.0 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 0.33333333333333333333333333333333 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.00000000000000000000000000000001 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.55 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lMachTmp = 0.33333333333333333333333333333333 * lMachNumber + 0.00000000000000000000000000000001
|
||||
|
||||
SendData("13", string.format("%0.4f;%0.4f", lMachTmp, 0.0))
|
||||
end
|
||||
else
|
||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
end
|
||||
|
||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
FC_RadarWarning_SPO15(14)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal + lEngineInfo.fuel_external
|
||||
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lTotalFuel_7_5 = 0
|
||||
local lTotalFuel_5_0 = 0
|
||||
|
||||
if lTotalFuel < 7500 then
|
||||
if lTotalFuel > 5000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 5000 -- minimaler Eingangswert
|
||||
x_max = 7500 -- maximaler Eingangswert
|
||||
x = 6000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 2500 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 0.0004 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -2.0 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.4 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_7_5 = 0.0004 * lTotalFuel + -2.0
|
||||
else
|
||||
lTotalFuel_7_5 = 0.0
|
||||
end
|
||||
else
|
||||
lTotalFuel_7_5 = 1.0
|
||||
end
|
||||
if lTotalFuel < 5000 then
|
||||
--[[
|
||||
y_min = 0.04 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0 -- minimaler Eingangswert
|
||||
x_max = 5000 -- maximaler Eingangswert
|
||||
x = 3000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 0.96 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 5000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 0.000192 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.04 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.616 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_5_0 = 0.000192 * lTotalFuel + 0.04
|
||||
else
|
||||
lTotalFuel_5_0 = 1.0
|
||||
end
|
||||
|
||||
-- TotalFuel_5_0
|
||||
-- TotalFuel_7_5
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- BingoLight
|
||||
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
|
||||
lTotalFuel_5_0,
|
||||
lTotalFuel_7_5,
|
||||
0,
|
||||
(lEngineInfo.fuel_internal < 3200.0 and 1 or 0), -- Tank warning 1
|
||||
(lEngineInfo.fuel_internal < 2800.0 and 1 or 0), -- Tank warning 2
|
||||
(lEngineInfo.fuel_internal < 1400.0 and 1 or 0), -- Tank warning 3
|
||||
(lEngineInfo.fuel_internal < 800.0 and 1 or 0))) -- Tank warning 4
|
||||
|
||||
-- Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
FC_EKRAN(16)
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
--WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
local lWarningLight = 0.0
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
if lTrueAirSpeed ~= nil then
|
||||
--WriteToLog('lTrueAirSpeed: '..dump(lTrueAirSpeed))
|
||||
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
end
|
||||
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
|
||||
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
|
||||
|
||||
-- left gear {0, 1}
|
||||
-- right gear {0, 1}
|
||||
-- nose gear {0, 1}
|
||||
-- WarningLight
|
||||
-- Flap 1
|
||||
-- Flap 2
|
||||
-- Nose Flap
|
||||
-- Speedbreakes on {0, 1}
|
||||
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d",
|
||||
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
|
||||
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
|
||||
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
|
||||
lWarningLight,
|
||||
-- (lMechInfo.flaps.value > 0.47 and 1 or 0), -- flap 1
|
||||
-- (lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap 2
|
||||
(lMechInfo.flaps.status == 1 and 1 or 0), -- flap 1
|
||||
(lMechInfo.flaps.status == 2 and 1 or 0), -- flap 2
|
||||
(lMechInfo.noseflap.value > 0.1 and 1 or 0), -- noseflap
|
||||
(lMechInfo.speedbrakes.status == 1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
FC_Russian_AirIntake(21)
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
||||
WeaponStatusPanel()
|
||||
MechanicalDevicesIndicator()
|
||||
StatusLamp()
|
||||
FuelQuantityIndicator()
|
||||
SightingSystem()
|
||||
SPO15RWR()
|
||||
FlareChaff()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function SightingSystem(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
|
||||
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||
end
|
||||
|
||||
function FlareChaff(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
--WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
--[chaff] = number: "30"
|
||||
--[flare] = number: "30"
|
||||
|
||||
SendDataHW("800", lSnares.chaff + lSnares.flare, lHardware )
|
||||
end
|
||||
|
||||
function StatusLamp(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
|
||||
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
|
||||
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
|
||||
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
|
||||
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
|
||||
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
|
||||
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
|
||||
|
||||
SendDataHW("730", (lEngineInfo.RPM.left > 100.0 and 1 or 0), lHardware ) -- lamp after burner left engine
|
||||
SendDataHW("731", (lEngineInfo.RPM.right > 100.0 and 1 or 0), lHardware ) -- lam after burner right engine
|
||||
end
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
|
||||
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function WeaponStatusPanel(hardware)
|
||||
local lHardware = hardware or 1
|
||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||
gES_PayloadInfo = LoGetPayloadInfo()
|
||||
if gES_PayloadInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
||||
--[[ exsample
|
||||
[Stations] = {
|
||||
[1] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[2] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[3] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[4] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[5] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[6] = {
|
||||
[CLSID] = string: "{B4C01D60-A8A3-4237-BD72-CA7655BC0FE9}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "19"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[7] = {
|
||||
[CLSID] = string: "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "43"
|
||||
[level1] = number: "1"
|
||||
[level4] = number: "17"
|
||||
[level2] = number: "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
[CurrentStation] = number: "3"
|
||||
[Cannon] = {
|
||||
[shells] = number: "150"
|
||||
}
|
||||
]]
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
-------------------------------
|
||||
| | | | | | |
|
||||
1 2 3 C 4 5 6
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells ) -- count cannon shells
|
||||
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||
SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
|
||||
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||
SendDataHW("103", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||
SendDataHW("104", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||
SendDataHW("105", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||
--SendDataHW("106", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
|
||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation )
|
||||
|
||||
-- defination
|
||||
gES_TmpStationToPanel = {}
|
||||
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
|
||||
gES_TmpStationToPanel[2] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware } -- right
|
||||
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[4] = {Panel = 5, StationID = 103, CurrentID = 203, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 104, CurrentID = 204, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[6] = {Panel = 4, StationID = 105, CurrentID = 205, HardwareID = lHardware }
|
||||
|
||||
if gES_PayloadInfo.CurrentStation ~= 0 then -- gegebenenfalls prüfen ob sich CurrentStation geändert hat
|
||||
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl
|
||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||
end
|
||||
end
|
||||
|
||||
function FuelQuantityIndicator(hardware)
|
||||
local lHardware = hardware or 1
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[7].CLSID == 2BEC576B-CDF5-4B7F-961F-B0FA4312B841 -- ext 1500l Fuel Tank
|
||||
]]
|
||||
|
||||
SendDataHW("300", string.format("%d", math.round(((lEngineInfo.fuel_internal + lEngineInfo.fuel_external) / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- internal fuel in kg
|
||||
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[7].CLSID == "{2BEC576B-CDF5-4B7F-961F-B0FA4312B841}" then -- center tanks presend and full
|
||||
SendDataHW("303", ((lEngineInfo.fuel_external < 1200.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
end
|
||||
if lPayloadInfo.Stations[3].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" or
|
||||
lPayloadInfo.Stations[4].CLSID == "{C0FF4842-FBAC-11d5-9190-00A0249B6F00}" then -- external tank presend and full (panel 2 and 5)
|
||||
SendDataHW("304", ((lEngineInfo.fuel_internal < 2830.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end]]
|
||||
|
||||
SendDataHW("304", (lEngineInfo.fuel_internal < 3200.0 and 1 or 0), lHardware ) -- Tank warning 1
|
||||
SendDataHW("305", (lEngineInfo.fuel_internal < 2800.0 and 1 or 0), lHardware ) -- Tank warning 2
|
||||
SendDataHW("306", (lEngineInfo.fuel_internal < 1390.0 and 1 or 0), lHardware ) -- Tank warning 3
|
||||
SendDataHW("307", (lEngineInfo.fuel_internal < 760.0 and 1 or 0), lHardware ) -- Tank warning 4
|
||||
--SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
|
||||
|
||||
end
|
||||
|
||||
function MechanicalDevicesIndicator(hardware)
|
||||
local lHardware = hardware or 1
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--SendDataHW("500", lMechInfo.gear.status )
|
||||
--SendDataHW("501", lMechInfo.gear.value )
|
||||
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
|
||||
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
|
||||
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
|
||||
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
|
||||
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
|
||||
|
||||
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
|
||||
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
--SendDataHW("520", lMechInfo.wheelbrakes.status ) -- not in use
|
||||
--SendDataHW("521", lMechInfo.wheelbrakes.value ) -- not in use
|
||||
|
||||
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
|
||||
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
|
||||
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
|
||||
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
|
||||
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
|
||||
--SendDataHW("540", lMechInfo.parachute.status )
|
||||
SendDataHW("541", (lMechInfo.parachute.value < 0.5 and 1 or 0), lHardware )
|
||||
|
||||
--SendDataHW("550", lMechInfo.noseflap.status )
|
||||
SendDataHW("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0), lHardware )
|
||||
|
||||
SendDataHW("560", lMechInfo.airintake.status, lHardware )
|
||||
--SendDataHW("561", lMechInfo.airintake.value )
|
||||
end
|
||||
@@ -1,559 +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
|
||||
[29] = "%.4f", -- Variometer
|
||||
-- Altimeter
|
||||
[97] = "%.4f", -- Altimeter_Pressure
|
||||
[96] = "%.41f", -- Altimeter_10000_footPtr
|
||||
[24] = "%.4f", -- Altimeter_1000_footPtr
|
||||
[25] = "%.4f", -- Altimeter_100_footPtr
|
||||
-- Artificial horizon
|
||||
[15] = "%.4f", -- AHorizon_Pitch
|
||||
[14] = "%.4f", -- AHorizon_Bank
|
||||
[16] = "%.1f", -- AHorizon_PitchShift
|
||||
[20] = "%.1f", -- AHorizon_Caged
|
||||
-- directional gyro
|
||||
[12] = "%.4f", -- GyroHeading
|
||||
-- turn indicator
|
||||
[27] = "%.4f", -- TurnNeedle
|
||||
[28] = "%.4f", -- Slipball
|
||||
-- oxygen pressure indicator
|
||||
[34] = "%.4f", -- Oxygen_Pressure
|
||||
[33] = "%.4f", -- Oxygen_Flow_Blinker
|
||||
-- fuel system
|
||||
[155] = "%.4f", -- Fuel_Tank_Left
|
||||
[156] = "%.4f", -- Fuel_Tank_Right
|
||||
[160] = "%.4f", -- Fuel_Tank_Fuselage
|
||||
[32] = "%.4f", -- Fuel_Pressure
|
||||
-- A-11 clock
|
||||
[4] = "%.4f", -- CLOCK_currtime_hours
|
||||
[5] = "%.4f", -- CLOCK_currtime_minutes
|
||||
[6] = "%.4f", -- CLOCK_currtime_seconds
|
||||
-- AN5730 remote compass
|
||||
[1] = "%.4f", -- CompassHeading
|
||||
[2] = "%.4f", -- CommandedCourse
|
||||
[3] = "%.4f", -- CommandedCourseKnob
|
||||
-- TailRadarWarning
|
||||
[161] = "%.1f", -- Lamp TailRadarWarning
|
||||
-- SCR-522A Control panel
|
||||
[122] = "%.1f", -- A_channel_light
|
||||
[123] = "%.1f", -- B_channel_light
|
||||
[124] = "%.1f", -- C_channel_light
|
||||
[125] = "%.1f", -- D_channel_light
|
||||
[126] = "%.1f", -- Transmit_light
|
||||
-- hydraulic pressure
|
||||
[78] = "%.4f", -- Hydraulic_Pressure
|
||||
-- Landing gears handle
|
||||
[150] = "%.4f", -- Landing_Gear_Handle
|
||||
[151] = "%.4f", -- Landing_Gear_Handle_Indoor
|
||||
[80] = "%.1f", -- LandingGearGreenLight
|
||||
[82] = "%.1f", -- LandingGearRedLight
|
||||
-- gauges
|
||||
[10] = "%.4f", -- Manifold_Pressure
|
||||
[23] = "%.4f", -- Engine_RPM
|
||||
[9] = "%.4f", -- Vacuum_Suction
|
||||
[21] = "%.4f", -- Carb_Temperature
|
||||
[22] = "%.4f", -- Coolant_Temperature
|
||||
[30] = "%.4f", -- Oil_Temperature
|
||||
[31] = "%.4f", -- Oil_Pressure
|
||||
[164] = "%.1f", -- Left_Fluor_Light
|
||||
[165] = "%.1f", -- Right_Fluor_Light
|
||||
[59] = "%.1f", -- Hight_Blower_Lamp
|
||||
-- Trimmer
|
||||
[170] = "%.4f", -- Aileron_Trimmer
|
||||
[172] = "%.4f", -- Rudder_Trimmer
|
||||
[171] = "%.4f", -- Elevator_Trimmer
|
||||
[174] = "%.4f", -- Control_Lock_Bracket
|
||||
[175] = "%.4f", -- Accelerometer_main
|
||||
[177] = "%.4f", -- Accelerometer_min
|
||||
[178] = "%.4f", -- Accelerometer_max
|
||||
[101] = "%.4f", -- Ammeter
|
||||
-- light
|
||||
[185] = "%.1f", -- Left_cockpit_light
|
||||
[186] = "%.1f", -- Right_cockpit_light
|
||||
[190] = "%.4f", -- warEmergencyPowerLimWire
|
||||
-------------
|
||||
[181] = "%.4f", -- Panel_Shake_Z
|
||||
[180] = "%.4f", -- Panel_Shake_Y
|
||||
[189] = "%.4f", -- Panel_Rot_X
|
||||
[162] = "%.1f", -- Canopy_Trucks
|
||||
[163] = "%.1f", -- Canopy_Visibility
|
||||
-- Stick
|
||||
[50] = "%.4f", -- StickPitch
|
||||
[51] = "%.4f", -- StickBank
|
||||
-- RudderPedals
|
||||
[54] = "%.4f", -- RudderPedals
|
||||
[55] = "%.4f", -- Left_Wheel_Brake
|
||||
[56] = "%.4f", -- Right_Wheel_Brake
|
||||
-- K-14 gunsight
|
||||
[36] = "%.4f", -- sightRange
|
||||
[188] = "%.4f", -- K_14_Shake_Z
|
||||
[187] = "%.4f", -- K_14_Shake_Y
|
||||
-------------
|
||||
[45] = "%.4f", -- ThrottleTwistGrip
|
||||
-------------
|
||||
[77] = "%.4f" -- Rocket_Counter
|
||||
}
|
||||
|
||||
gES_GlassCockpitConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Right Swich Panel
|
||||
[102] = "%d", -- Generator Connect/Disconnect
|
||||
[103] = "%d", -- Battery Connect/Disconnect
|
||||
[104] = "%d", -- Gun Heating ON/OFF
|
||||
[105] = "%d", -- Pitot Heating ON/OFF
|
||||
[106] = "%d", -- Wing Position Lights Bright/Off/Dim
|
||||
[107] = "%d", -- Tail Position Lights Bright/Off/Dim
|
||||
[108] = "%d", -- Red Recognition Light Key/Off/Steady
|
||||
[109] = "%d", -- Green Recognition Light Key/Off/Steady
|
||||
[110] = "%d", -- Amber Recognition Light Key/Off/Steady
|
||||
[111] = "%d", -- Recognition Lights Key
|
||||
[112] = "%d", -- Circuit Protectors Reset
|
||||
[100] = "%d", -- Right Fluorescent Light
|
||||
[90] = "%d", -- Left Fluorescent Light
|
||||
-- Flight Instrument panel
|
||||
[3] = "%.4f", -- Course Set
|
||||
[179] = "%.4f", -- Heading Set/Cage
|
||||
[13] = "%d", -- Heading Set/Cage Button
|
||||
[17] = "%.4f", -- Pitch Adjustment
|
||||
[19] = "%.4f", -- Cage
|
||||
[18] = "%d", -- Cage Button
|
||||
[8] = "%d", -- Winding/Adjustment Clock ??
|
||||
[7] = "%d", -- Winding/Adjustment Clock ??
|
||||
[26] = "%.4f", -- Set Pressure
|
||||
-- SCR-522A Control panel
|
||||
[117] = "%d", -- Radio ON/OFF
|
||||
[118] = "%d", -- A Channel Activate
|
||||
[119] = "%d", -- B Channel Activate
|
||||
[120] = "%d", -- C Channel Activate
|
||||
[121] = "%d", -- D Channel Activate
|
||||
[127] = "%.4f", -- Radio Lights Dimmer
|
||||
[116] = "%.4f", -- Radio Audio Volume
|
||||
[44] = "%d", -- Microphone On
|
||||
[129] = "%d", -- Switch Locking Lever
|
||||
[128] = "%.4f", -- Radio Mode Transmit/Receive/Remote
|
||||
-------------
|
||||
[71] = "%.4f", -- Cockpit Lights
|
||||
[66] = "%0.1f", -- Ignition Off/Right/Left/Both
|
||||
[67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On
|
||||
[72] = "%d", -- Silence Landing Gear Warning Horn Cut Off
|
||||
-- Bomb Arm/Chemical
|
||||
[69] = "%d", -- Left Bomb Arm/Chemical
|
||||
[70] = "%d", -- Right Bomb Arm/Chemical
|
||||
-- Release Mode
|
||||
[68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm
|
||||
[73] = "%0.1f", -- Rockets Release Mode Off/Single/Auto
|
||||
[74] = "%d", -- Rockets Delay Switch Delay/Int
|
||||
[75] = "%0.1f", -- Rockets Counter Control
|
||||
-- Engine Control Panel
|
||||
[58] = "%d", -- Supercharger Switch Cover
|
||||
[57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH
|
||||
[60] = "%d", -- High Blower Lamp Test
|
||||
[61] = "%d", -- Fuel Booster On/Off
|
||||
[62] = "%d", -- Oil Dilute Activate
|
||||
[63] = "%d", -- Starter Activate
|
||||
[64] = "%d", -- Starter Switch Cover
|
||||
[65] = "%d", -- Primer Activate
|
||||
-- Oxygen Regulator
|
||||
[131] = "%d", -- Auto-Mix On-Off
|
||||
[130] = "%0.4f", -- Oxygen Emergency By-pass
|
||||
-- Fuel system
|
||||
[85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank
|
||||
[86] = "%d", -- Fuel Shut-Off Valve ON/OFF
|
||||
-- AN/APS-13
|
||||
[114] = "%d", -- ail Warning Radar Power ON/OFF
|
||||
[115] = "%d", -- Tail Warning Radar Test
|
||||
[113] = "%.4f", -- Tail Warning Radar Light Control
|
||||
-------------
|
||||
[79] = "%.4f", -- Hydraulic Release Knob
|
||||
[94] = "%.4f", -- Flaps Control Handle
|
||||
[84] = "%d", -- Parking Brake Handle
|
||||
[81] = "%d", -- Safe Landing Gear Light Test
|
||||
[83] = "%d", -- Unsafe Landing Gear Light Test
|
||||
-- Detrola receiver
|
||||
[137] = "%0.4f", -- Detrola Frequency Selector
|
||||
[138] = "%0.4f", -- Detrola Volume
|
||||
-- canopy
|
||||
[147] = "%.4f", -- Canopy Hand Crank
|
||||
[149] = "%d", -- Canopy Emergency Release Handle
|
||||
-- AN/ARA-8
|
||||
[152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING
|
||||
[153] = "%d", -- Homing Adapter Power On/Off
|
||||
[154] = "%d", -- Homing Adapter's Circuit Breaker
|
||||
-- SCR-695
|
||||
[139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6
|
||||
[140] = "%d", -- IFF Power On/Off
|
||||
[141] = "%d", -- IFF TIME/OFF/ON
|
||||
[142] = "%d", -- IFF Detonator Circuit On/Off
|
||||
[143] = "%d", -- IFF Distress Signal On/Off
|
||||
[145] = "%d", -- IFF Detonator Left
|
||||
[146] = "%d", -- IFF Detonator Right
|
||||
-- Trimmers
|
||||
[91] = "%.4f", -- Aileron Trim
|
||||
[92] = "%.4f", -- Elevator Trim
|
||||
[93] = "%.4f", -- Rudder Trim
|
||||
-------------
|
||||
[157] = "%.4f", -- Defroster
|
||||
[158] = "%.4f", -- Cold Air
|
||||
[159] = "%.4f", -- Hot Air
|
||||
-------------
|
||||
[89] = "%d", -- Landing Light On/Off
|
||||
[168] = "%d", -- Coolant Control Cover
|
||||
[87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control
|
||||
[169] = "%d", -- Oil Control Cover
|
||||
[88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control
|
||||
[134] = "%0.1f", -- Carburetor Cold Air Control
|
||||
[135] = "%0.1f", -- Carburetor Warm Air Control
|
||||
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
|
||||
[43] = "%.4f", -- Throttle
|
||||
[46] = "%.4f", -- Propeller RPM
|
||||
[173] = "%.4f", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
|
||||
[48] = "%.4f", -- Lock Throttle
|
||||
[49] = "%.4f", -- Lock Propeller & Mixture
|
||||
[176] = "%.4f", -- G-meter reset
|
||||
[183] = "%.4f", -- Mirror
|
||||
--Gunsight Selector
|
||||
[41] = "%d", -- Sight On/Off
|
||||
[39] = "%d", -- Fixed Reticle Mask Lever
|
||||
[40] = "%0.1f", -- Sight Mode, Fixed Sight/Fixed-Gyro Sight/Gyro Sight
|
||||
[42] = "%.4f", -- Gun Sight Brightness
|
||||
[35] = "%.4f", -- Wing Span Selector
|
||||
-------------
|
||||
[132] = "%.4f", -- Left Payload Salvo
|
||||
[133] = "%.4f" -- Right Payload Salvo
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to GlassCockpit
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
SendData("ExportID", "Format")
|
||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||
]]
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HELIOS: '..t)
|
||||
local MainPanel = GetDevice(0)
|
||||
local AirspeedNeedle = MainPanel:get_argument_value(11)*1000
|
||||
local Altimeter_10000_footPtr = MainPanel:get_argument_value(96)*100000
|
||||
local Variometer = MainPanel:get_argument_value(29)
|
||||
local TurnNeedle = MainPanel:get_argument_value(27)
|
||||
local Slipball = MainPanel:get_argument_value(28)
|
||||
local CompassHeading = MainPanel:get_argument_value(1)
|
||||
local CommandedCourse = MainPanel:get_argument_value(2)
|
||||
local Manifold_Pressure = MainPanel:get_argument_value(10)
|
||||
local Engine_RPM = MainPanel:get_argument_value(23)
|
||||
local AHorizon_Pitch = MainPanel:get_argument_value(15)
|
||||
local AHorizon_Bank = MainPanel:get_argument_value(14)
|
||||
local AHorizon_PitchShift = MainPanel:get_argument_value(16) * 10.0 * math.pi/180.0
|
||||
local AHorizon_Caged = MainPanel:get_argument_value(20)
|
||||
local GyroHeading = MainPanel:get_argument_value(12)
|
||||
local vaccum_suction = MainPanel:get_argument_value(9)
|
||||
local carburator_temp = MainPanel:get_argument_value(21)
|
||||
local coolant_temp = MainPanel:get_argument_value(22)
|
||||
local Acelerometer = MainPanel:get_argument_value(175)
|
||||
local OilTemperature = MainPanel:get_argument_value(30)
|
||||
local OilPressure = MainPanel:get_argument_value(31)
|
||||
local FuelPressure = MainPanel:get_argument_value(32)
|
||||
local Clock_hours = MainPanel:get_argument_value(4)
|
||||
local Clock_minutes = MainPanel:get_argument_value(5)
|
||||
local Clock_seconds = MainPanel:get_argument_value(6)
|
||||
local LandingGearGreenLight = MainPanel:get_argument_value(80)
|
||||
local LandingGearRedLight = MainPanel:get_argument_value(82)
|
||||
local Hight_Blower_Lamp = MainPanel:get_argument_value(59)
|
||||
local Acelerometer_Min = MainPanel:get_argument_value(177)
|
||||
local Acelerometer_Max = MainPanel:get_argument_value(178)
|
||||
local Ammeter = MainPanel:get_argument_value(101)
|
||||
local hydraulic_Pressure = MainPanel:get_argument_value(78)
|
||||
local Oxygen_Flow_Blinker = MainPanel:get_argument_value(33)
|
||||
local Oxygen_Pressure = MainPanel:get_argument_value(34)
|
||||
local Fuel_Tank_Left = MainPanel:get_argument_value(155)
|
||||
local Fuel_Tank_Right = MainPanel:get_argument_value(156)
|
||||
local Fuel_Tank_Fuselage = MainPanel:get_argument_value(160)
|
||||
local Tail_radar_warning = MainPanel:get_argument_value(161)
|
||||
local Channel_A = MainPanel:get_argument_value(122)
|
||||
local Channel_B = MainPanel:get_argument_value(123)
|
||||
local Channel_C = MainPanel:get_argument_value(124)
|
||||
local Channel_D = MainPanel:get_argument_value(125)
|
||||
local transmit_light = MainPanel:get_argument_value(126)
|
||||
local RocketCounter = MainPanel:get_argument_value(77)
|
||||
|
||||
--- preparing landing gear and High Blower lights, all together, in only one value
|
||||
local gear_lights = 0
|
||||
if LandingGearGreenLight > 0 then gear_lights = gear_lights +100 end
|
||||
if LandingGearRedLight > 0 then gear_lights = gear_lights +10 end
|
||||
if Hight_Blower_Lamp > 0 then gear_lights = gear_lights +1 end
|
||||
------------------------------------------------------------
|
||||
|
||||
--- preparing radio lights, all together, in only one value
|
||||
local radio_active = 0
|
||||
if Channel_A > 0 then radio_active = 1 end
|
||||
if Channel_B >0 then radio_active= 2 end
|
||||
if Channel_C >0 then radio_active= 3 end
|
||||
if Channel_D >0 then radio_active= 4 end
|
||||
if transmit_light >0 then radio_active = radio_active + 10 end
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
---- sending P51 and tf51 data across fc2 interface
|
||||
----Please comment out the appropriate entries in the table 'gES_GlassCockpitConfigEveryFrameArguments'.
|
||||
|
||||
SendData("1", string.format("%.5f", math.floor((AHorizon_Pitch+1)*1000) + ((AHorizon_Bank+1)/100) ) ) -- pitch
|
||||
SendData("2", string.format("%.3f", math.floor(Oxygen_Flow_Blinker*100) + (Oxygen_Pressure/100) ) ) -- bank
|
||||
SendData("3", string.format("%.4f", math.floor(OilTemperature*100) + (vaccum_suction/100) ) ) -- yaw
|
||||
SendData("4", string.format("%.3f", math.floor(Altimeter_10000_footPtr) + (AHorizon_Caged/100) ) ) -- barometric altitude
|
||||
SendData("5", string.format("%.5f", math.floor(Clock_hours*1000000) + (Tail_radar_warning/100) ) ) -- radar altitude
|
||||
SendData("6", string.format("%.5f", math.floor(CompassHeading*1000) + (CommandedCourse/100) ) ) -- adf
|
||||
SendData("7", string.format("%.4f", math.floor(Clock_seconds*100) + (hydraulic_Pressure/100) ) ) -- rmi
|
||||
SendData("8", string.format("%.2f", math.floor(GyroHeading*1000) + (radio_active/100) ) ) -- heading
|
||||
SendData("9", string.format("%.4f", math.floor(Engine_RPM*100) + (Manifold_Pressure/100) ) ) -- left rpm
|
||||
SendData("10", string.format("%.4f", math.floor(Fuel_Tank_Left*100) + (Fuel_Tank_Right/100) ) ) -- right rpm
|
||||
SendData("11", string.format("%.4f", math.floor(carburator_temp*100) + (coolant_temp/100) ) ) -- left temp
|
||||
SendData("12", string.format("%.4f", math.floor(gear_lights) + (Acelerometer_Min/100 ) ) ) -- right temp
|
||||
SendData("13", string.format("%.2f", Variometer) ) -- vvi
|
||||
SendData("14", string.format("%.5f", math.floor(AirspeedNeedle)+ (RocketCounter/100) ) ) -- ias
|
||||
SendData("15", string.format("%.4f", math.floor(OilPressure*100) + (FuelPressure/100) ) ) -- distance to way
|
||||
SendData("16", string.format("%.3f", math.floor(Acelerometer*1000) + (Acelerometer_Max/100 ) ) ) -- aoa
|
||||
SendData("17", string.format("%.4f", math.floor((TurnNeedle+1)*100) + ((Slipball+1)/100) ) ) -- glide
|
||||
SendData("18", string.format("%.4f", math.floor(Fuel_Tank_Fuselage*100) + (Ammeter/100) ) ) -- side
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
-- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HawgTouch: '..t)
|
||||
-- ADI AN5736
|
||||
-- Artificial horizon
|
||||
--[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0}
|
||||
--[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0}
|
||||
--[16] = "%.1f", -- AHorizon_PitchShift
|
||||
--[20] = "%.1f", -- AHorizon_Caged
|
||||
SendData(2000, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(15),
|
||||
mainPanelDevice:get_argument_value(14)))
|
||||
-- turn indicator AN5820
|
||||
--[27] = "%.4f", -- TurnNeedle {-1.0, 1.0}
|
||||
--[28] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||
SendData(2001, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(27),
|
||||
mainPanelDevice:get_argument_value(28)))
|
||||
-- directional gyro AN5735
|
||||
--[12] = "%.1f", -- GyroHeading {0.0, 1.0}
|
||||
-- Vacuum_Suction AN5771-5
|
||||
--[9] = "%.4f", -- Vacuum_Suction {0.0, 1.0}
|
||||
-- F-2 Airspeed Indicator
|
||||
-- [11] = "%.2f", -- AirspeedNeedle {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700} {0.0, 0.05, 0.10, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7}
|
||||
-- Altimeter AN5760-2
|
||||
--[96] = "%.1f", -- Altimeter_10000_footPtr {0.0, 1.0}
|
||||
--[24] = "%.1f", -- Altimeter_1000_footPtr {0.0, 1.0}
|
||||
--[25] = "%.1f", -- Altimeter_100_footPtr {0.0, 1.0}
|
||||
--[97] = "%.1f", -- Altimeter_Pressure {28.1, 31.0} {0.0, 1.0}
|
||||
SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(96),
|
||||
mainPanelDevice:get_argument_value(24),
|
||||
mainPanelDevice:get_argument_value(25),
|
||||
mainPanelDevice:get_argument_value(97)))
|
||||
-- Rate of Climb Indicator AN5825
|
||||
--[29] = "%.1f", -- Variometer {0.0, 1.0}
|
||||
-- D-10 Manifold Pressure Indicator
|
||||
--[10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0}
|
||||
-- Tachometer
|
||||
--[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0}
|
||||
-- AN5790-6 Carburetor Air Temperature Indicator
|
||||
--[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
|
||||
-- Coolant Temperature Indicator
|
||||
--[22] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1}
|
||||
-- Engine Gauge
|
||||
--[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0.0, 1.0}
|
||||
--[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0.0, 1.0}
|
||||
--[32] = "%.1f", -- Fuel_Pressure {0.0, 25.0} -- PSI {0.0, 1.0}
|
||||
SendData(2003, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(30),
|
||||
mainPanelDevice:get_argument_value(31),
|
||||
mainPanelDevice:get_argument_value(32)))
|
||||
-- Remote Indicator Compass
|
||||
-- AN5730 remote compass
|
||||
--[1] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||||
--[2] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||||
SendData(2004, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(1),
|
||||
mainPanelDevice:get_argument_value(2)))
|
||||
-- A-11 clock
|
||||
--[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 1.0}
|
||||
--[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 1.0}
|
||||
--[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 1.0}
|
||||
SendData(2005, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(4),
|
||||
mainPanelDevice:get_argument_value(5),
|
||||
mainPanelDevice:get_argument_value(6)))
|
||||
-- Oxygen Flow Indicator
|
||||
--[33] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
-- Oxygen Pressure Gauge
|
||||
--[34] = "%.1f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0}
|
||||
-- Hydraulic Pressure Gauge
|
||||
--[78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} -- PSI {0.0, 1.0}
|
||||
-- Fuel Gauges
|
||||
-- Left Wing Main Tank
|
||||
--[155] = "%.2f", -- Fuel_Tank_Left {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0}
|
||||
-- Fuselage Tank
|
||||
--[160] = "%.2f", -- Fuel_Tank_Fuselage {0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 85.0} -- US GAL {0.0, 0.12, 0.28, 0.40, 0.51, 0.62, 0.72, 0.83, 0.96, 1.0}
|
||||
-- Right Wing Main Tank
|
||||
--[156] = "%.2f", -- Fuel_Tank_Right {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0}
|
||||
-- AN-5745 accelerometer indicator
|
||||
--[175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0}
|
||||
--[177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0}
|
||||
--[178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0}
|
||||
SendData(2006, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(175),
|
||||
mainPanelDevice:get_argument_value(177),
|
||||
mainPanelDevice:get_argument_value(178)))
|
||||
-- Landing Gear Warning Lights
|
||||
--[80] = "%.1f", -- LandingGearGreenLight
|
||||
--[82] = "%.1f", -- LandingGearRedLight
|
||||
SendData(2007, string.format("%.1f;%.1f",
|
||||
mainPanelDevice:get_argument_value(80),
|
||||
mainPanelDevice:get_argument_value(82)))
|
||||
-- AMMETER
|
||||
--[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0}
|
||||
end
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to hardware
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
SendDataHW("ExportID", "Format")
|
||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
-- no dimming lights
|
||||
-- TailRadarWarning
|
||||
SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.3 and 1 or 0) -- Lamp TailRadarWarning
|
||||
-- SCR-522A Control panel
|
||||
SendDataHW("122", mainPanelDevice:get_argument_value(122) > 0.3 and 1 or 0) -- A_channel_light
|
||||
SendDataHW("123", mainPanelDevice:get_argument_value(123) > 0.3 and 1 or 0) -- B_channel_light
|
||||
SendDataHW("124", mainPanelDevice:get_argument_value(124) > 0.3 and 1 or 0) -- C_channel_light
|
||||
SendDataHW("125", mainPanelDevice:get_argument_value(125) > 0.3 and 1 or 0) -- D_channel_light
|
||||
SendDataHW("126", mainPanelDevice:get_argument_value(126) > 0.3 and 1 or 0) -- Transmit_light
|
||||
-- Landing gears
|
||||
SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- LandingGearGreenLight
|
||||
SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- LandingGearRedLight
|
||||
-- Engine
|
||||
SendDataHW("59", mainPanelDevice:get_argument_value(59) > 0.3 and 1 or 0) -- Hight_Blower_Lamp
|
||||
-- Cockpit Lights
|
||||
SendDataHW("164", mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Left_Fluor_Light
|
||||
SendDataHW("165", mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Right_Fluor_Light
|
||||
SendDataHW("185", mainPanelDevice:get_argument_value(185) > 0.3 and 1 or 0) -- Left_cockpit_light
|
||||
SendDataHW("186", mainPanelDevice:get_argument_value(186) > 0.3 and 1 or 0) -- Right_cockpit_light
|
||||
|
||||
--[[
|
||||
-- dimming lights
|
||||
-- TailRadarWarning
|
||||
SendDataHW("161", string.format("%.1f", mainPanelDevice:get_argument_value(161))) -- Lamp TailRadarWarning
|
||||
-- SCR-522A Control panel
|
||||
SendDataHW("122", string.format("%.1f", mainPanelDevice:get_argument_value(122))) -- A_channel_light
|
||||
SendDataHW("123", string.format("%.1f", mainPanelDevice:get_argument_value(123))) -- B_channel_light
|
||||
SendDataHW("124", string.format("%.1f", mainPanelDevice:get_argument_value(124))) -- C_channel_light
|
||||
SendDataHW("125", string.format("%.1f", mainPanelDevice:get_argument_value(125))) -- D_channel_light
|
||||
SendDataHW("126", string.format("%.1f", mainPanelDevice:get_argument_value(126))) -- Transmit_light
|
||||
-- Landing gears
|
||||
SendDataHW("80", string.format("%.1f", mainPanelDevice:get_argument_value(80))) -- LandingGearGreenLight
|
||||
SendDataHW("82", string.format("%.1f", mainPanelDevice:get_argument_value(82))) -- LandingGearRedLight
|
||||
-- Engine
|
||||
SendDataHW("59", string.format("%.1f", mainPanelDevice:get_argument_value(59))) -- Hight_Blower_Lamp
|
||||
-- Cockpit Lights
|
||||
SendDataHW("164", string.format("%.1f", mainPanelDevice:get_argument_value(164))) -- Left_Fluor_Light
|
||||
SendDataHW("165", string.format("%.1f", mainPanelDevice:get_argument_value(165))) -- Right_Fluor_Light
|
||||
SendDataHW("185", string.format("%.1f", mainPanelDevice:get_argument_value(185))) -- Left_cockpit_light
|
||||
SendDataHW("186", string.format("%.1f", mainPanelDevice:get_argument_value(186))) -- Right_cockpit_light
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to GlassCockpit
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
SendData("ExportID", "Format")
|
||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||
]]
|
||||
|
||||
--[[
|
||||
local lDETROLA = GetDevice(24)
|
||||
WriteToLog('lDETROLA: '..dump(lDETROLA:is_on()))
|
||||
WriteToLog('lDETROLA: '..dump(lDETROLA:get_frequency()))
|
||||
--SendData(2000, string.format("%7.3f", lDETROLA:get_frequency()/1000000))
|
||||
|
||||
local lINTERCOM = GetDevice(31)
|
||||
WriteToLog('lINTERCOM: '..dump(lINTERCOM:is_communicator_available()))
|
||||
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_noise_level()))
|
||||
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_signal_level()))
|
||||
]]
|
||||
--[[
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 35, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to hardware
|
||||
Example from A-10C
|
||||
Landing Gear
|
||||
mainPanelDevice, basis panel
|
||||
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
|
||||
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
|
||||
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
|
||||
]]
|
||||
|
||||
--[[
|
||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||||
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 10, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
@@ -1,948 +0,0 @@
|
||||
-- Su-25A Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundFCModule = true
|
||||
|
||||
-- auxiliary function
|
||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-25A --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
||||
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- customizing for HELOS
|
||||
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
|
||||
lBank = math.deg(lBank) -- BANK (Radian to Grad)
|
||||
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
|
||||
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
|
||||
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
|
||||
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
|
||||
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
|
||||
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
|
||||
lHSI_RMI = 360 - lHSI_RMI
|
||||
lIAS = lIAS * 3.6 -- change from m/s to km/h
|
||||
|
||||
SendData("1", string.format("%.2f", lPitch) )
|
||||
SendData("2", string.format("%.2f", lBank) )
|
||||
SendData("3", string.format("%.2f", lYaw) )
|
||||
SendData("4", string.format("%.2f", lAltBar) )
|
||||
SendData("5", string.format("%.2f", lAltRad) )
|
||||
SendData("6", string.format("%.2f", lHSI_ADF) )
|
||||
SendData("7", string.format("%.2f", lHSI_RMI) )
|
||||
SendData("8", string.format("%.2f", lHeading) )
|
||||
SendData("9", string.format("%.2f", lEngineRPMleft) )
|
||||
SendData("10", string.format("%.2f", lEngineRPMright) )
|
||||
SendData("11", string.format("%.2f", lEngineTempLeft) )
|
||||
SendData("12", string.format("%.2f", lEngineTempRight) )
|
||||
SendData("13", string.format("%.2f", lVVI) )
|
||||
SendData("14", string.format("%.2f", lIAS) )
|
||||
SendData("15", string.format("%.2f", lDistanceToWay) )
|
||||
SendData("16", string.format("%.2f", lAoA) )
|
||||
SendData("17", string.format("%.2f", lGlide) )
|
||||
SendData("18", string.format("%.2f", lSide) )
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
local lRadToDCSsignd = math.pi
|
||||
local lRadToDCSunsignd = math.pi * 2
|
||||
local lDefaultNull = 0.0
|
||||
local lDefaultOne = 1.0
|
||||
|
||||
-- IAS-TAS Indicator (IAS, TAS) {"%.4f;%.4f"}
|
||||
FC_Russian_AirSpeed_1100hkm(1)
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
FC_Russian_AOA_Su25(3)
|
||||
|
||||
-- ADI
|
||||
FC_Russian_ADI_Old(4)
|
||||
|
||||
-- HSI
|
||||
FC_Russian_HSI_old(5)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
|
||||
FC_Russian_VVI_Old(6)
|
||||
|
||||
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
|
||||
FC_Russian_RadarAltimeter_1500m(100, 7)
|
||||
|
||||
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
|
||||
FC_Russian_BarometricAltimeter_late(8)
|
||||
|
||||
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
|
||||
FC_Russian_EngineRPM(9)
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempLeft, 10)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempRight, 11)
|
||||
|
||||
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
|
||||
FC_Russian_Clock_late(12)
|
||||
|
||||
-- HSI Distance
|
||||
FC_Russian_HSI_Distance_old(lDistanceToWay, 21)
|
||||
|
||||
-- Mach {max, Mach}
|
||||
local lMachTmp = 0
|
||||
if lMachNumber > 0.475 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0.475 -- minimaler Eingangswert
|
||||
x_max = 1.0 -- maximaler Eingangswert
|
||||
x = 0.65 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 0.525 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 1.9047619047619047619047619047619 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0.9047619047619047619047619047619 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0,333333333333333333333333333334 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lMachTmp = 1.9047619047619047619047619047619 * lMachNumber + -0.9047619047619047619047619047619
|
||||
else
|
||||
lMachTmp = 0
|
||||
end
|
||||
|
||||
SendData("22", string.format("%0.4f;%0.4f", 0.665, lMachTmp))
|
||||
end
|
||||
else
|
||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance()
|
||||
end
|
||||
|
||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
FC_WeaponPanel_SU25(13)
|
||||
|
||||
FC_RadarWarning_SPO15(14)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
local lFuel_leftbar = 1.0
|
||||
local lFuel_rightbar = 1.0
|
||||
local lExtTank1 = 1.0 -- external tanks
|
||||
local lExtTank2 = 1.0 -- inner tanks
|
||||
|
||||
if lTotalFuel < 5000 then
|
||||
if lTotalFuel > 1500 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 1500 -- minimaler Eingangswert
|
||||
x_max = 5000 -- maximaler Eingangswert
|
||||
x = 3500 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 3500 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 2.8571428571428571428571428571429e-4 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0.42857142857142857142857142857143 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0,57142857142857142857142857142857 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lFuel_leftbar = 2.8571428571428571428571428571429e-4 * lTotalFuel + -0.42857142857142857142857142857143
|
||||
else
|
||||
lFuel_leftbar = 0.0
|
||||
end
|
||||
else
|
||||
lFuel_leftbar = 1.0
|
||||
end
|
||||
if lTotalFuel < 1200 then
|
||||
lFuel_rightbar = lTotalFuel / 1200
|
||||
else
|
||||
lFuel_rightbar = 1.0
|
||||
end
|
||||
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
|
||||
lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8)
|
||||
lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
end
|
||||
-- Fuel_leftbar
|
||||
-- Fuel_rightbar
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- Light5
|
||||
-- BingoLight
|
||||
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
|
||||
lFuel_leftbar,
|
||||
lFuel_rightbar,
|
||||
lExtTank1, -- external tanks
|
||||
lExtTank2, -- inner tanks
|
||||
(lEngineInfo.fuel_internal < 2790.0 and 1 or 0), -- Interne Flügeltanks
|
||||
(lEngineInfo.fuel_internal < 1840.0 and 1 or 0), -- Interne Rumpftanks
|
||||
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
|
||||
|
||||
-- Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
FC_EKRAN(16)
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
|
||||
FC_Russian_MDI_SU25(2)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
|
||||
end
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance()
|
||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
||||
WeaponStatusPanel()
|
||||
MechanicalDevicesIndicator()
|
||||
StatusLamp()
|
||||
FuelQuantityIndicator()
|
||||
SightingSystem()
|
||||
SPO15RWR()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function SightingSystem(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
|
||||
--SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
|
||||
--SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||
end
|
||||
|
||||
function FlareChaff(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
--[chaff] = number: "128"
|
||||
--[flare] = number: "128"
|
||||
end
|
||||
|
||||
function StatusLamp(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
|
||||
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
|
||||
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
|
||||
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
|
||||
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
|
||||
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
|
||||
end
|
||||
|
||||
local lAoA = LoGetAngleOfAttack()
|
||||
if lAoA ~= nil then
|
||||
lAoA = lAoA * 57.3
|
||||
SendDataHW("730", (lAoA > 20.0 and 1 or 0), lHardware ) -- lamp start AOA warning (0|1)
|
||||
end
|
||||
end
|
||||
|
||||
function WeaponStatusPanel(hardware)
|
||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||
local lHardware = hardware or 1
|
||||
gES_PayloadInfo = LoGetPayloadInfo()
|
||||
if gES_PayloadInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
||||
--[[ exsample
|
||||
[Stations] = {
|
||||
[1] = {
|
||||
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "10"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[2] = {
|
||||
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "10"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[3] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
[count] = number: "20"
|
||||
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "33"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "32"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
}
|
||||
[4] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
[count] = number: "20"
|
||||
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "33"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "32"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
}
|
||||
[5] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "99"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "1"
|
||||
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "45"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[6] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "99"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "1"
|
||||
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "45"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[7] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "47"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "8"
|
||||
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "58"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[8] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "47"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "8"
|
||||
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "58"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[9] = {
|
||||
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "20"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[10] = {
|
||||
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "20"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[11] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
[CurrentStation] = number: "0"
|
||||
[Cannon] = {
|
||||
[shells] = number: "250"
|
||||
}
|
||||
]]
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
---------------------------------------------------
|
||||
| | | | | | | | | | |
|
||||
1 2 3 4 5 C 6 7 8 9 10
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
|
||||
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||
SendDataHW("110", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
||||
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||
SendDataHW("109", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
||||
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||
SendDataHW("108", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
||||
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||
SendDataHW("107", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
||||
SendDataHW("105", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||
SendDataHW("106", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
|
||||
--SendDataHW("110", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
|
||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
|
||||
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
|
||||
-- CurrentStation 5, panel 3
|
||||
-- CurrentStation 3, panel 2
|
||||
-- CurrentStation 7, panel 4
|
||||
-- CurrentStation 4, panel 9
|
||||
-- CurrentStation 9, panel 5
|
||||
-- CurrentStation 10, panel 6
|
||||
-- CurrentStation 8, panel 7
|
||||
-- CurrentStation 6, panel 8
|
||||
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
|
||||
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
|
||||
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
|
||||
|
||||
-- defination
|
||||
if gES_CurrentStationTmp == nil then
|
||||
gES_CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if gES_PayloadInfo.CurrentStation > 0 and
|
||||
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
|
||||
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
|
||||
|
||||
gES_TmpStationToPanel = {}
|
||||
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
|
||||
gES_TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware } -- right
|
||||
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
|
||||
|
||||
WeaponStatusPanel_Reset(201, 210, lHardware)
|
||||
|
||||
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
|
||||
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
|
||||
|
||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function FuelQuantityIndicator(hardware)
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lHardware = hardware or 1
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
|
||||
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
|
||||
SendDataHW("303", ((lEngineInfo.fuel_external < 1240.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
end
|
||||
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tank presend and full (panel 3 and 8)
|
||||
SendDataHW("304", ((lEngineInfo.fuel_external < 1.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end
|
||||
SendDataHW("305", (lEngineInfo.fuel_internal < 2790.0 and 1 or 0), lHardware ) -- Interne Flügeltanks
|
||||
SendDataHW("306", (lEngineInfo.fuel_internal < 1840.0 and 1 or 0), lHardware ) -- Interne Rumpftanks
|
||||
--SendDataHW("307", (lEngineInfo.fuel_internal < 1.0 and 1 or 0), lHardware ) -- Zentraler Rumpftanks
|
||||
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
|
||||
|
||||
end
|
||||
|
||||
function MechanicalDevicesIndicator(hardware)
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lHardware = hardware or 1
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--SendDataHW("500", lMechInfo.gear.status )
|
||||
--SendDataHW("501", lMechInfo.gear.value )
|
||||
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
|
||||
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
|
||||
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
|
||||
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
|
||||
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
|
||||
|
||||
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
|
||||
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
|
||||
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
|
||||
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
|
||||
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
|
||||
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
|
||||
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
|
||||
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
end
|
||||
@@ -1,899 +0,0 @@
|
||||
-- Su-25T Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundFCModule = true
|
||||
|
||||
-- auxiliary function
|
||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
||||
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
--local lMachNumber = LoGetMachNumber -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- customizing for HELOS
|
||||
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
|
||||
lBank = math.deg(lBank) -- BANK (Radian to Grad)
|
||||
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
|
||||
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
|
||||
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
|
||||
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
|
||||
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
|
||||
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
|
||||
lHSI_RMI = 360 - lHSI_RMI
|
||||
lIAS = lIAS * 3.6 -- change from m/s to km/h
|
||||
|
||||
SendData("1", string.format("%.2f", lPitch) )
|
||||
SendData("2", string.format("%.2f", lBank) )
|
||||
SendData("3", string.format("%.2f", lYaw) )
|
||||
SendData("4", string.format("%.2f", lAltBar) )
|
||||
SendData("5", string.format("%.2f", lAltRad) )
|
||||
SendData("6", string.format("%.2f", lHSI_ADF) )
|
||||
SendData("7", string.format("%.2f", lHSI_RMI) )
|
||||
SendData("8", string.format("%.2f", lHeading) )
|
||||
SendData("9", string.format("%.2f", lEngineRPMleft) )
|
||||
SendData("10", string.format("%.2f", lEngineRPMright) )
|
||||
SendData("11", string.format("%.2f", lEngineTempLeft) )
|
||||
SendData("12", string.format("%.2f", lEngineTempRight) )
|
||||
SendData("13", string.format("%.2f", lVVI) )
|
||||
SendData("14", string.format("%.2f", lIAS) )
|
||||
SendData("15", string.format("%.2f", lDistanceToWay) )
|
||||
SendData("16", string.format("%.2f", lAoA) )
|
||||
SendData("17", string.format("%.2f", lGlide) )
|
||||
SendData("18", string.format("%.2f", lSide) )
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
local lRadToDCSsignd = math.pi
|
||||
local lRadToDCSunsignd = math.pi * 2
|
||||
local lDefaultNull = 0.0
|
||||
local lDefaultOne = 1.0
|
||||
|
||||
-- IAS-TAS Indicator (IAS, TAS) {"%.4f;%.4f"}
|
||||
FC_Russian_AirSpeed_1100hkm(1)
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
FC_Russian_AOA_Su25(3)
|
||||
|
||||
-- ADI
|
||||
FC_Russian_ADI_Old(4)
|
||||
|
||||
-- HSI
|
||||
FC_Russian_HSI(lDistanceToWay, 5)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
|
||||
FC_Russian_VVI_Old(6)
|
||||
|
||||
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
|
||||
FC_Russian_RadarAltimeter_1500m(100, 7)
|
||||
|
||||
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
|
||||
FC_Russian_BarometricAltimeter_late(8)
|
||||
|
||||
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
|
||||
FC_Russian_EngineRPM(9)
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempLeft, 10)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_Russian_EGT_1000gc(lEngineTempRight, 11)
|
||||
|
||||
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
|
||||
FC_Russian_Clock_late(12)
|
||||
end
|
||||
else
|
||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance()
|
||||
end
|
||||
|
||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
FC_WeaponPanel_SU25(13)
|
||||
|
||||
FC_RadarWarning_SPO15(14)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lFuelCounter = {[0] = 0.0, [1] = 0.11, [2] = 0.22, [3] = 0.33, [4] = 0.44, [5] = 0.55, [6] = 0.66, [7] = 0.77, [8] = 0.88, [9] = 0.99}
|
||||
lTotalFuel = string.format("%03d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil")) -- auf drei stellen bringen
|
||||
|
||||
local lExtTank1 = 1.0 -- external tanks
|
||||
local lExtTank2 = 1.0 -- inner tanks
|
||||
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
|
||||
lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8)
|
||||
lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
end
|
||||
-- TotalFuel_100
|
||||
-- TotalFuel_10
|
||||
-- TotalFuel_1
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- Light5
|
||||
-- BingoLight
|
||||
SendData("15", string.format("%0.2f;%0.2f;%0.2f;%d;%d;%d;%d;%d;%d",
|
||||
lFuelCounter[tonumber(string.sub(lTotalFuel, 1, 1))],
|
||||
lFuelCounter[tonumber(string.sub(lTotalFuel, 2, 2))],
|
||||
lFuelCounter[tonumber(string.sub(lTotalFuel, 3, 3))],
|
||||
lExtTank1, -- external tanks
|
||||
lExtTank2, -- inner tanks
|
||||
(lEngineInfo.fuel_internal < 2800.0 and 1 or 0), -- Interne Flügeltanks
|
||||
(lEngineInfo.fuel_internal < 1840.0 and 1 or 0), -- Interne Rumpftanks
|
||||
(lEngineInfo.fuel_internal < 1.0 and 1 or 0), -- Zentraler Rumpftanks
|
||||
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
|
||||
|
||||
-- Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
FC_EKRAN(16)
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
|
||||
FC_Russian_MDI_SU25(2)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
|
||||
end
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance()
|
||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
||||
WeaponStatusPanel()
|
||||
MechanicalDevicesIndicator()
|
||||
StatusLamp()
|
||||
FuelQuantityIndicator()
|
||||
SightingSystem()
|
||||
SPO15RWR()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function SightingSystem(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
|
||||
--SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||
end
|
||||
|
||||
function FlareChaff(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
--[chaff] = number: "128"
|
||||
--[flare] = number: "128"
|
||||
end
|
||||
|
||||
function StatusLamp(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
|
||||
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
|
||||
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
|
||||
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
|
||||
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
|
||||
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
|
||||
end
|
||||
|
||||
local lAoA = LoGetAngleOfAttack()
|
||||
if lAoA ~= nil then
|
||||
lAoA = lAoA * 57.3
|
||||
SendDataHW("730", (lAoA > 20.0 and 1 or 0), lHardware ) -- lamp start AOA warning (0|1)
|
||||
end
|
||||
end
|
||||
|
||||
function WeaponStatusPanel(hardware)
|
||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||
local lHardware = hardware or 1
|
||||
gES_PayloadInfo = LoGetPayloadInfo()
|
||||
if gES_PayloadInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
||||
--[[ exsample
|
||||
[Stations] = {
|
||||
[1] = {
|
||||
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "10"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[2] = {
|
||||
[CLSID] = string: "{682A481F-0CB5-4693-A382-D00DD4A156D7}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "10"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[3] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
[count] = number: "20"
|
||||
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "33"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "32"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
}
|
||||
[4] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
[count] = number: "20"
|
||||
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "33"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "32"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
}
|
||||
[5] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "99"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "1"
|
||||
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "45"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[6] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "99"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "1"
|
||||
[CLSID] = string: "{79D73885-0801-45a9-917F-C90FE1CE3DFC}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "45"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[7] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "47"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "8"
|
||||
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "58"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[8] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "47"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
[count] = number: "8"
|
||||
[CLSID] = string: "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "8"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "58"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[9] = {
|
||||
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "20"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[10] = {
|
||||
[CLSID] = string: "{D5435F26-F120-4FA3-9867-34ACE562EF1B}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "20"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[11] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
[CurrentStation] = number: "0"
|
||||
[Cannon] = {
|
||||
[shells] = number: "250"
|
||||
}
|
||||
]]
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
---------------------------------------------------
|
||||
| | | | | | | | | | |
|
||||
1 2 3 4 5 C 6 7 8 9 10
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
|
||||
SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||
SendDataHW("110", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
||||
SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||
SendDataHW("109", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
||||
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||
SendDataHW("108", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
||||
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||
SendDataHW("107", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
||||
SendDataHW("105", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||
SendDataHW("106", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
|
||||
--SendDataHW("110", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0) ) -- weapon presend > 0 center station, not visible
|
||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
|
||||
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
|
||||
-- CurrentStation 5, panel 3
|
||||
-- CurrentStation 3, panel 2
|
||||
-- CurrentStation 7, panel 4
|
||||
-- CurrentStation 4, panel 9
|
||||
-- CurrentStation 9, panel 5
|
||||
-- CurrentStation 10, panel 6
|
||||
-- CurrentStation 8, panel 7
|
||||
-- CurrentStation 6, panel 8
|
||||
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
|
||||
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
|
||||
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
|
||||
|
||||
-- defination
|
||||
if gES_CurrentStationTmp == nil then
|
||||
gES_CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if gES_PayloadInfo.CurrentStation > 0 and
|
||||
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
|
||||
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
|
||||
|
||||
gES_TmpStationToPanel = {}
|
||||
gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware } -- left
|
||||
gES_TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware } -- right
|
||||
gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
|
||||
|
||||
WeaponStatusPanel_Reset(201, 210, lHardware)
|
||||
|
||||
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
|
||||
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
|
||||
|
||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function FuelQuantityIndicator(hardware)
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lHardware = hardware or 1
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
|
||||
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
|
||||
SendDataHW("303", ((lEngineInfo.fuel_external < 1240.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
end
|
||||
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tank presend and full (panel 3 and 8)
|
||||
SendDataHW("304", ((lEngineInfo.fuel_external < 1.0 ) and 1 or 0), lHardware )
|
||||
else
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end
|
||||
else
|
||||
SendDataHW("303", 1, lHardware )
|
||||
SendDataHW("304", 1, lHardware )
|
||||
end
|
||||
SendDataHW("305", (lEngineInfo.fuel_internal < 2800.0 and 1 or 0), lHardware ) -- Interne Flügeltanks
|
||||
SendDataHW("306", (lEngineInfo.fuel_internal < 1840.0 and 1 or 0), lHardware ) -- Interne Rumpftanks
|
||||
SendDataHW("307", (lEngineInfo.fuel_internal < 1.0 and 1 or 0), lHardware ) -- Zentraler Rumpftanks
|
||||
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
|
||||
|
||||
end
|
||||
|
||||
function MechanicalDevicesIndicator(hardware)
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lHardware = hardware or 1
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--SendDataHW("500", lMechInfo.gear.status )
|
||||
--SendDataHW("501", lMechInfo.gear.value )
|
||||
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
|
||||
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
|
||||
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
|
||||
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
|
||||
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
|
||||
|
||||
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
|
||||
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
|
||||
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
|
||||
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
|
||||
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
|
||||
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
|
||||
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
|
||||
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
end
|
||||
@@ -1,884 +0,0 @@
|
||||
-- Su-27 Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundFCModule = true
|
||||
|
||||
-- auxiliary function
|
||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-27 --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
||||
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
--local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- customizing for HELOS
|
||||
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
|
||||
lBank = math.deg(lBank) -- BANK (Radian to Grad)
|
||||
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
|
||||
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
|
||||
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
|
||||
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
|
||||
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
|
||||
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
|
||||
lHSI_RMI = 360 - lHSI_RMI
|
||||
lIAS = lIAS * 3.6 -- change from m/s to km/h
|
||||
|
||||
SendData("1", string.format("%.2f", lPitch) )
|
||||
SendData("2", string.format("%.2f", lBank) )
|
||||
SendData("3", string.format("%.2f", lYaw) )
|
||||
SendData("4", string.format("%.2f", lAltBar) )
|
||||
SendData("5", string.format("%.2f", lAltRad) )
|
||||
SendData("6", string.format("%.2f", lHSI_ADF) )
|
||||
SendData("7", string.format("%.2f", lHSI_RMI) )
|
||||
SendData("8", string.format("%.2f", lHeading) )
|
||||
SendData("9", string.format("%.2f", lEngineRPMleft) )
|
||||
SendData("10", string.format("%.2f", lEngineRPMright) )
|
||||
SendData("11", string.format("%.2f", lEngineTempLeft) )
|
||||
SendData("12", string.format("%.2f", lEngineTempRight) )
|
||||
SendData("13", string.format("%.2f", lVVI) )
|
||||
SendData("14", string.format("%.2f", lIAS) )
|
||||
SendData("15", string.format("%.2f", lDistanceToWay) )
|
||||
SendData("16", string.format("%.2f", lAoA) )
|
||||
SendData("17", string.format("%.2f", lGlide) )
|
||||
SendData("18", string.format("%.2f", lSide) )
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
local lRadToDCSsignd = math.pi
|
||||
local lRadToDCSunsignd = math.pi * 2
|
||||
local lDefaultNull = 0.0
|
||||
local lDefaultOne = 1.0
|
||||
|
||||
-- IAS-MACH Indicator (IAS, MACH) {"%.4f;%.4f"}
|
||||
FC_Russian_AirSpeed_1600hkm(1)
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
FC_Russian_AOA_Su2733(3)
|
||||
|
||||
-- ADI
|
||||
FC_Russian_ADI_Old(4)
|
||||
|
||||
-- HSI
|
||||
FC_Russian_HSI(lDistanceToWay, 5)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
|
||||
FC_Russian_VVI_Old(6)
|
||||
|
||||
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
|
||||
FC_Russian_RadarAltimeter_1500m(100, 7)
|
||||
|
||||
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
|
||||
FC_Russian_BarometricAltimeter_20000(8)
|
||||
|
||||
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
|
||||
FC_Russian_EngineRPM(9)
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 10)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 11)
|
||||
|
||||
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
|
||||
FC_Russian_Clock_late(12)
|
||||
end
|
||||
else
|
||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
end
|
||||
|
||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
FC_WeaponPanel_SU2733(13)
|
||||
|
||||
FC_RadarWarning_SPO15(14)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
--local lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lTotalFuel_9_3 = 0
|
||||
local lTotalFuel_5_0 = 0
|
||||
|
||||
if lTotalFuel < 9000 then
|
||||
if lTotalFuel > 3000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 3000 -- minimaler Eingangswert
|
||||
x_max = 9000 -- maximaler Eingangswert
|
||||
x = 8000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 6000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 1.66666666666666666666666666667e-4 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0,5 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.83333 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_9_3 = 1.6666666666666666666666666666667e-4 * lTotalFuel + -0.5
|
||||
else
|
||||
lTotalFuel_9_3 = 0.0
|
||||
end
|
||||
else
|
||||
lTotalFuel_9_3 = 1.0
|
||||
end
|
||||
if lTotalFuel < 5000 then
|
||||
lTotalFuel_5_0 = lTotalFuel / 5000
|
||||
else
|
||||
lTotalFuel_5_0 = 1.0
|
||||
end
|
||||
|
||||
-- TotalFuel_5_0
|
||||
-- TotalFuel_9_3
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- BingoLight
|
||||
SendData("15", string.format("%0.4f;%0.4f;%d;%d;%d;%d;%d",
|
||||
lTotalFuel_5_0,
|
||||
lTotalFuel_9_3,
|
||||
(lEngineInfo.fuel_internal < 5000.0 and 1 or 0), -- Tank warning 1
|
||||
(lEngineInfo.fuel_internal < 4000.0 and 1 or 0), -- Tank warning 2
|
||||
(lEngineInfo.fuel_internal < 1500.0 and 1 or 0), -- Tank warning 3
|
||||
(lEngineInfo.fuel_internal < 1000.0 and 1 or 0), -- Tank warning 4
|
||||
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
|
||||
|
||||
-- Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 17)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 18)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
FC_EKRAN(16)
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
local lWarningLight = 0.0
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
if lTrueAirSpeed ~= nil then
|
||||
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
end
|
||||
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
|
||||
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
|
||||
|
||||
-- left gear {0, 1}
|
||||
-- right gear {0, 1}
|
||||
-- nose gear {0, 1}
|
||||
-- WarningLight
|
||||
-- Flap
|
||||
-- Intake FOD shields
|
||||
-- Speedbreakes on {0, 1}
|
||||
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d",
|
||||
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
|
||||
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
|
||||
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
|
||||
lWarningLight,
|
||||
(lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap
|
||||
(lMechInfo.gear.value > 0.5 and 1 or 0), -- Intake FOD shields
|
||||
(lMechInfo.speedbrakes.value > 0.1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 19)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 20)
|
||||
|
||||
--WriteToLog('lMechInfo.noseflap.value: '..dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
FC_Russian_AirIntake(21)
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
||||
WeaponStatusPanel()
|
||||
MechanicalDevicesIndicator()
|
||||
StatusLamp()
|
||||
FuelQuantityIndicator()
|
||||
SightingSystem()
|
||||
SPO15RWR()
|
||||
PPDSPPanel()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function SightingSystem(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
|
||||
--SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
|
||||
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||
end
|
||||
|
||||
function PPDSPPanel(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
--[chaff] = number: "96"
|
||||
--[flare] = number: "96"
|
||||
|
||||
local lChaffLED = math.round(lSnares.chaff / 12, 0, "ceil") + 1
|
||||
local lFlareLED = math.round(lSnares.flare / 12, 0, "ceil") + 1
|
||||
|
||||
SendDataHW("800", (lChaffLED <= 1 and 0 or 1), lHardware )
|
||||
SendDataHW("801", (lChaffLED <= 2 and 0 or 1), lHardware )
|
||||
SendDataHW("802", (lChaffLED <= 3 and 0 or 1), lHardware )
|
||||
SendDataHW("803", (lChaffLED <= 4 and 0 or 1), lHardware )
|
||||
SendDataHW("804", (lChaffLED <= 5 and 0 or 1), lHardware )
|
||||
SendDataHW("805", (lChaffLED <= 6 and 0 or 1), lHardware )
|
||||
SendDataHW("806", (lChaffLED <= 7 and 0 or 1), lHardware )
|
||||
SendDataHW("807", (lChaffLED <= 8 and 0 or 1), lHardware )
|
||||
|
||||
SendDataHW("810", (lFlareLED <= 1 and 0 or 1), lHardware )
|
||||
SendDataHW("811", (lFlareLED <= 2 and 0 or 1), lHardware )
|
||||
SendDataHW("812", (lFlareLED <= 3 and 0 or 1), lHardware )
|
||||
SendDataHW("813", (lFlareLED <= 4 and 0 or 1), lHardware )
|
||||
SendDataHW("814", (lFlareLED <= 5 and 0 or 1), lHardware )
|
||||
SendDataHW("815", (lFlareLED <= 6 and 0 or 1), lHardware )
|
||||
SendDataHW("816", (lFlareLED <= 7 and 0 or 1), lHardware )
|
||||
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
|
||||
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
|
||||
end
|
||||
|
||||
function StatusLamp(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
|
||||
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
|
||||
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
|
||||
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
|
||||
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
|
||||
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
|
||||
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
|
||||
|
||||
SendDataHW("730", (lEngineInfo.RPM.left > 99.95 and 1 or 0), lHardware ) -- lamp after burner left engine
|
||||
SendDataHW("731", (lEngineInfo.RPM.right > 99.95 and 1 or 0), lHardware ) -- lam after burner right engine
|
||||
end
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
|
||||
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function WeaponStatusPanel(hardware)
|
||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||
local lHardware = hardware or 1
|
||||
gES_PayloadInfo = LoGetPayloadInfo()
|
||||
if gES_PayloadInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
||||
--[[ exsample
|
||||
[Stations] = {
|
||||
[1] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[2] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[3] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[4] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[5] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
[count] = number: "20"
|
||||
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "33"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "32"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
}
|
||||
[6] = {
|
||||
[wstype] = {
|
||||
[level3] = number: "32"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
[count] = number: "20"
|
||||
[CLSID] = string: "{F72F47E5-C83A-4B85-96ED-D3E46671EE9A}"
|
||||
[adapter] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
[container] = boolean: "true"
|
||||
[weapon] = {
|
||||
[level3] = number: "33"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "32"
|
||||
[level2] = number: "7"
|
||||
}
|
||||
}
|
||||
[7] = {
|
||||
[CLSID] = string: "{4203753F-8198-4E85-9924-6F8FF679F9FF}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[8] = {
|
||||
[CLSID] = string: "{4203753F-8198-4E85-9924-6F8FF679F9FF}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[9] = {
|
||||
[CLSID] = string: "{7AEC222D-C523-425e-B714-719C0D1EB14D}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "91"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[10] = {
|
||||
[CLSID] = string: "{7AEC222D-C523-425e-B714-719C0D1EB14D}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "38"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "91"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
}
|
||||
[CurrentStation] = number: "0"
|
||||
[Cannon] = {
|
||||
[shells] = number: "250"
|
||||
}
|
||||
]]
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
-------------------------------------------
|
||||
| | | | | | | | | |
|
||||
1 2 3 4 5 6 7 8 9 10 -- Panel ID
|
||||
2 4 5 7 10 9 8 6 3 1 -- gES_PayloadInfo.Station.ID
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
|
||||
SendDataHW("110", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||
SendDataHW("101", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
||||
SendDataHW("109", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||
SendDataHW("102", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
||||
SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||
SendDataHW("108", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
||||
SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||
SendDataHW("107", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
||||
SendDataHW("106", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||
SendDataHW("105", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
|
||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
|
||||
-- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on
|
||||
|
||||
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
|
||||
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
|
||||
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
|
||||
|
||||
-- defination
|
||||
if gES_CurrentStationTmp == nil then
|
||||
gES_CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if gES_PayloadInfo.CurrentStation > 0 and
|
||||
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
|
||||
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
|
||||
|
||||
gES_TmpStationToPanel = {}
|
||||
gES_TmpStationToPanel[1] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[2] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[3] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[4] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[9] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[10] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
|
||||
|
||||
WeaponStatusPanel_Reset(201, 210, lHardware)
|
||||
|
||||
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
|
||||
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
|
||||
|
||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function FuelQuantityIndicator(hardware)
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lHardware = hardware or 1
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
|
||||
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
SendDataHW("304", (lEngineInfo.fuel_internal < 5000.0 and 1 or 0), lHardware ) -- Tank warning 1
|
||||
SendDataHW("305", (lEngineInfo.fuel_internal < 4000.0 and 1 or 0), lHardware ) -- Tank warning 2
|
||||
SendDataHW("306", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0), lHardware ) -- Tank warning 3
|
||||
SendDataHW("307", (lEngineInfo.fuel_internal < 1000.0 and 1 or 0), lHardware ) -- Tank warning 4
|
||||
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
|
||||
|
||||
end
|
||||
|
||||
function MechanicalDevicesIndicator(hardware)
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lHardware = hardware or 1
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--SendDataHW("500", lMechInfo.gear.status )
|
||||
--SendDataHW("501", lMechInfo.gear.value )
|
||||
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
|
||||
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
|
||||
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
|
||||
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
|
||||
SendDataHW("503", (lMechInfo.gear.value > 0.97 and 1 or 0), lHardware ) -- right gear
|
||||
|
||||
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
|
||||
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
|
||||
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
|
||||
|
||||
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
|
||||
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
|
||||
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
|
||||
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
|
||||
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
SendDataHW("534", (lMechInfo.gear.value > 0.5 and 1 or 0), lHardware ) -- Intake FOD shields
|
||||
|
||||
--SendDataHW("540", lMechInfo.parachute.status )
|
||||
SendDataHW("541", (lMechInfo.parachute.value < 0.5 and 1 or 0), lHardware )
|
||||
end
|
||||
@@ -1,880 +0,0 @@
|
||||
-- Su-33 Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundFCModule = true
|
||||
|
||||
-- auxiliary function
|
||||
dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-33 --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ProcessGlassCockpitFCHighImportanceConfig()
|
||||
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
--local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
--local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
--local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
--local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
--local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
--local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
--local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
--local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
--local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
--local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
--local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
--local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
-- customizing for HELOS
|
||||
lPitch = math.deg(lPitch) -- PITCH, (Radian to Grad)
|
||||
lBank = math.deg(lBank) -- BANK (Radian to Grad)
|
||||
lYaw = math.deg(lYaw) -- YAW (Radian to Grad)
|
||||
lHSI_RMI = math.deg(lHSI_RMI) -- VOR1 OBS (Radian to Grad)
|
||||
lHSI_ADF = math.deg(lHSI_ADF) -- ADF OBS (Radian to Grad)
|
||||
lAoA = math.deg(lAoA) -- ANGLE OF ATTACK AoA (Radian to Grad)
|
||||
lHeading = math.deg(lHeading) -- Heading (Radian to Grad)
|
||||
lHSI_ADF = (360 - lHSI_ADF) + (360 - lHeading)
|
||||
lHSI_RMI = 360 - lHSI_RMI
|
||||
lIAS = lIAS * 3.6 -- change from m/s to km/h
|
||||
|
||||
SendData("1", string.format("%.2f", lPitch) )
|
||||
SendData("2", string.format("%.2f", lBank) )
|
||||
SendData("3", string.format("%.2f", lYaw) )
|
||||
SendData("4", string.format("%.2f", lAltBar) )
|
||||
SendData("5", string.format("%.2f", lAltRad) )
|
||||
SendData("6", string.format("%.2f", lHSI_ADF) )
|
||||
SendData("7", string.format("%.2f", lHSI_RMI) )
|
||||
SendData("8", string.format("%.2f", lHeading) )
|
||||
SendData("9", string.format("%.2f", lEngineRPMleft) )
|
||||
SendData("10", string.format("%.2f", lEngineRPMright) )
|
||||
SendData("11", string.format("%.2f", lEngineTempLeft) )
|
||||
SendData("12", string.format("%.2f", lEngineTempRight) )
|
||||
SendData("13", string.format("%.2f", lVVI) )
|
||||
SendData("14", string.format("%.2f", lIAS) )
|
||||
SendData("15", string.format("%.2f", lDistanceToWay) )
|
||||
SendData("16", string.format("%.2f", lAoA) )
|
||||
SendData("17", string.format("%.2f", lGlide) )
|
||||
SendData("18", string.format("%.2f", lSide) )
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
-- IAS-MACH Indicator (IAS, MACH) {"%.4f;%.4f"}
|
||||
FC_Russian_AirSpeed_1600hkm(1)
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
FC_Russian_AOA_Su2733(3)
|
||||
|
||||
-- ADI
|
||||
FC_Russian_ADI_New(4)
|
||||
|
||||
-- HSI
|
||||
FC_Russian_HSI(lDistanceToWay, 5)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI) (VVI, TurnIndicator, SlipBallPosition)
|
||||
FC_Russian_VVI_New(6)
|
||||
|
||||
-- Radar Altimeter (AltRad, MinAltitude, WarningFlag, MinAltitudeLamp) {"%.4f;%.4f;%.1f;%.1f"} (below 100m is warning light on)
|
||||
FC_Russian_RadarAltimeter_1500m(100, 7)
|
||||
|
||||
-- Barometric Altimeter (AltBar, BasicAtmospherePressure)
|
||||
FC_Russian_BarometricAltimeter_late(8)
|
||||
|
||||
-- Tachometer (RPM) (EngineRPMleft, EngineRPMright) {"%.4f;%.4f"}
|
||||
FC_Russian_EngineRPM(9)
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 10)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp) {"%.4f"}
|
||||
FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 11)
|
||||
|
||||
-- Clock from Ka-50 {CurrentHours, CurrentMinutes, CurrentSeconds, 0, FlightTimeHours, FlightTimeMinutes, 0, 0) {"%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f"}
|
||||
FC_Russian_Clock_late(12)
|
||||
end
|
||||
else
|
||||
WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
end
|
||||
|
||||
function ProcessGlassCockpitFCLowImportanceConfig()
|
||||
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
FC_WeaponPanel_SU2733(13)
|
||||
|
||||
FC_RadarWarning_SPO15(14)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
local lTotalFuel = 0
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
lTotalFuel = lEngineInfo.fuel_internal
|
||||
--lTotalFuel = string.format("%3d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lTotalFuel_12_0 = 1.0
|
||||
|
||||
if lTotalFuel < 12000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0 -- minimaler Eingangswert
|
||||
x_max = 12000 -- maximaler Eingangswert
|
||||
x = 8000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 12000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 8.3333333333333333333333333333333e-5 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 4.e-33 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.66666666666666666666666666666667 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_12_0 = 8.3333333333333333333333333333333e-5 * lTotalFuel + 4.e-33
|
||||
end
|
||||
|
||||
-- TotalFuel_12_0
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- BingoLight
|
||||
SendData("15", string.format("%0.4f;%d;%d;%d;%d;%d",
|
||||
lTotalFuel_12_0,
|
||||
(lEngineInfo.fuel_internal < 5000.0 and 1 or 0), -- Tank warning 1
|
||||
(lEngineInfo.fuel_internal < 1000.0 and 1 or 0), -- Tank warning 2 4000
|
||||
(lEngineInfo.fuel_internal < 4000.0 and 1 or 0), -- Tank warning 3 1500
|
||||
(lEngineInfo.fuel_internal < 1500.0 and 1 or 0), -- Tank warning 4 1000
|
||||
(lEngineInfo.fuel_internal < 600.0 and 1 or 0))) -- Bingo Fuel
|
||||
|
||||
-- Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 300, 17)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
FC_EKRAN(16)
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2) {"%.1f;%d;%d;%d;%d;%d;%d"}
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
local lWarningLight = 0.0
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
if lTrueAirSpeed ~= nil then
|
||||
lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
end
|
||||
-- WarningLight {0.0 = Off, 0.1 = blinking light, 0.2 = on}
|
||||
-- WarningLight {0.0 = Off, no blinking light, 1.0 = on}
|
||||
|
||||
-- left gear {0, 1}
|
||||
-- right gear {0, 1}
|
||||
-- nose gear {0, 1}
|
||||
-- Hook Light
|
||||
-- WarningLight
|
||||
-- Flap
|
||||
-- Intake FOD shields
|
||||
-- Speedbreakes on {0, 1}
|
||||
SendData("2", string.format("%.1f;%d;%d;%d;%d;%d;%d;%d",
|
||||
(lMechInfo.gear.value > 0.95 and 1 or 0), -- left gear
|
||||
(lMechInfo.gear.value == 1 and 1 or 0), -- right gear
|
||||
(lMechInfo.gear.value > 0.85 and 1 or 0), -- nose gear
|
||||
(lMechInfo.hook.value > 0.85 and 1 or 0), -- hook light
|
||||
lWarningLight,
|
||||
(lMechInfo.flaps.value > 0.93 and 1 or 0), -- flap
|
||||
(lMechInfo.gear.value > 0.5 and 1 or 0), -- Intake FOD shields
|
||||
(lMechInfo.speedbrakes.value > 0.1 and 1 or 0))) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 300, 18)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 300, 19)
|
||||
|
||||
--WriteToLog('lMechInfo.noseflap.value: '..dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
FC_Russian_AirIntake(20)
|
||||
|
||||
-- Fuel Quantity Standby Indicator
|
||||
FC_OneNeedleGauge(lTotalFuel, 10000, 21)
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
WriteToLog('lTWSInfo: '..dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
WriteToLog('lTargetInformation: '..dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
WriteToLog('lLockedTargetInformation: '..dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
WriteToLog('lF15_TWS_Contacs: '..dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
WriteToLog('lControlPanel_HSI: '..dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
WriteToLog('lRadioBeaconsStatus: '..dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--WriteToLog('lNameByType: '..dump(lNameByType))
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
-- where necessary, specify HardwareID, example WeaponStatusPanel(2)
|
||||
WeaponStatusPanel()
|
||||
MechanicalDevicesIndicator()
|
||||
StatusLamp()
|
||||
FuelQuantityIndicator()
|
||||
SightingSystem()
|
||||
SPO15RWR()
|
||||
PPDSPPanel()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function SightingSystem(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSightingSystemInfo: '..dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
SendDataHW("600", lSightingSystemInfo.ECM_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("601", lSightingSystemInfo.laser_on == true and 1 or 0, lHardware )
|
||||
--SendDataHW("602", lSightingSystemInfo.optical_system_on == true and 1 or 0, lHardware )
|
||||
SendDataHW("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0, lHardware )
|
||||
SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware )
|
||||
end
|
||||
|
||||
function PPDSPPanel(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lSnares: '..dump(lSnares))
|
||||
|
||||
--[chaff] = number: "48"
|
||||
--[flare] = number: "48"
|
||||
|
||||
local lChaffLED = math.round(lSnares.chaff / 6, 0, "ceil") + 1
|
||||
local lFlareLED = math.round(lSnares.flare / 6, 0, "ceil") + 1
|
||||
|
||||
SendDataHW("800", (lChaffLED <= 1 and 0 or 1), lHardware )
|
||||
SendDataHW("801", (lChaffLED <= 2 and 0 or 1), lHardware )
|
||||
SendDataHW("802", (lChaffLED <= 3 and 0 or 1), lHardware )
|
||||
SendDataHW("803", (lChaffLED <= 4 and 0 or 1), lHardware )
|
||||
SendDataHW("804", (lChaffLED <= 5 and 0 or 1), lHardware )
|
||||
SendDataHW("805", (lChaffLED <= 6 and 0 or 1), lHardware )
|
||||
SendDataHW("806", (lChaffLED <= 7 and 0 or 1), lHardware )
|
||||
SendDataHW("807", (lChaffLED <= 8 and 0 or 1), lHardware )
|
||||
|
||||
SendDataHW("810", (lFlareLED <= 1 and 0 or 1), lHardware )
|
||||
SendDataHW("811", (lFlareLED <= 2 and 0 or 1), lHardware )
|
||||
SendDataHW("812", (lFlareLED <= 3 and 0 or 1), lHardware )
|
||||
SendDataHW("813", (lFlareLED <= 4 and 0 or 1), lHardware )
|
||||
SendDataHW("814", (lFlareLED <= 5 and 0 or 1), lHardware )
|
||||
SendDataHW("815", (lFlareLED <= 6 and 0 or 1), lHardware )
|
||||
SendDataHW("816", (lFlareLED <= 7 and 0 or 1), lHardware )
|
||||
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
|
||||
SendDataHW("817", (lFlareLED <= 8 and 0 or 1), lHardware )
|
||||
end
|
||||
|
||||
function StatusLamp(hardware)
|
||||
local lHardware = hardware or 1
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMCPState: '..dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
SendDataHW("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("701", lMCPState.RightTailPlaneFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("702", lMCPState.MasterWarning == true and 1 or 0, lHardware )
|
||||
SendDataHW("703", lMCPState.LeftEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("704", lMCPState.RightEngineFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("705", lMCPState.LeftAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("706", lMCPState.RightAileronFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("707", lMCPState.LeftMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("708", lMCPState.RightMainPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("709", lMCPState.LeftWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("710", lMCPState.RightWingPumpFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("711", lMCPState.EOSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("712", lMCPState.ECMFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("713", lMCPState.CannonFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("714", lMCPState.MLWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("715", lMCPState.ACSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("716", lMCPState.RadarFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("717", lMCPState.HelmetFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("718", lMCPState.HUDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("719", lMCPState.MFDFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("720", lMCPState.RWSFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("721", lMCPState.GearFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("722", lMCPState.HydraulicsFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("723", lMCPState.AutopilotFailure == true and 1 or 0, lHardware )
|
||||
SendDataHW("724", lMCPState.FuelTankDamage == true and 1 or 0, lHardware )
|
||||
SendDataHW("725", lMCPState.CanopyOpen == true and 1 or 0, lHardware )
|
||||
SendDataHW("726", lMCPState.StallSignalization == true and 1 or 0, lHardware )
|
||||
SendDataHW("727", lMCPState.AutopilotOn == true and 1 or 0, lHardware )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
|
||||
SendDataHW("728", lEngineInfo.EngineStart.left, lHardware ) -- lamp start left engine 1 (0|1)
|
||||
SendDataHW("729", lEngineInfo.EngineStart.right, lHardware ) -- lamp start right engine 1 (0|1)
|
||||
|
||||
SendDataHW("730", (lEngineInfo.RPM.left > 100.0 and 1 or 0), lHardware ) -- lamp after burner left engine
|
||||
SendDataHW("731", (lEngineInfo.RPM.right > 100.0 and 1 or 0), lHardware ) -- lam after burner right engine
|
||||
end
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--WriteToLog('lAccelerationUnits: '..dump(lAccelerationUnits))
|
||||
SendDataHW("732", (lAccelerationUnits.y > 8.0 and 1 or 0), lHardware ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function WeaponStatusPanel(hardware)
|
||||
-- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated.
|
||||
local lHardware = hardware or 1
|
||||
gES_PayloadInfo = LoGetPayloadInfo()
|
||||
if gES_PayloadInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo))
|
||||
--[[ exsample
|
||||
[Stations] = {
|
||||
[1] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[2] = {
|
||||
[CLSID] = string: "{FBC29BFE-3D24-4C64-B81D-941239D12249}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "18"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[3] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
[4] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
[5] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
[6] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
[7] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
[8] = {
|
||||
[CLSID] = string: ""
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "0"
|
||||
[weapon] = {
|
||||
[level3] = number: "0"
|
||||
[level1] = number: "0"
|
||||
[level4] = number: "0"
|
||||
[level2] = number: "0"
|
||||
}
|
||||
}
|
||||
[9] = {
|
||||
[CLSID] = string: "{37DCC01E-9E02-432F-B61D-10C166CA2798}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "9"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "7"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[10] = {
|
||||
[CLSID] = string: "{37DCC01E-9E02-432F-B61D-10C166CA2798}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "9"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "7"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
[11] = {
|
||||
[CLSID] = string: "{9B25D316-0434-4954-868F-D51DB1A38DF0}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "7"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "13"
|
||||
[level2] = number: "4"
|
||||
}
|
||||
}
|
||||
[12] = {
|
||||
[CLSID] = string: "{3C612111-C7AD-476E-8A8E-2485812F4E5C}"
|
||||
[container] = boolean: "false"
|
||||
[count] = number: "1"
|
||||
[weapon] = {
|
||||
[level3] = number: "9"
|
||||
[level1] = number: "4"
|
||||
[level4] = number: "6"
|
||||
[level2] = number: "5"
|
||||
}
|
||||
}
|
||||
}
|
||||
[CurrentStation] = number: "0"
|
||||
[Cannon] = {
|
||||
[shells] = number: "150"
|
||||
}
|
||||
]]
|
||||
--[[
|
||||
Weapon Panel (Numper = Station number)
|
||||
|
|
||||
-------------------------------------------------------
|
||||
| | | | | | | | | | | |
|
||||
L 1 2 3 4 5 6 7 8 9 10 R -- Panel ID
|
||||
1 4 5 7 9 12 11 10 8 6 3 2 -- gES_PayloadInfo.Station.ID
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations L and R not on Panel
|
||||
-- weapon station 1 (left) to 10 (right), 5 and 6 center station
|
||||
SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells
|
||||
--SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- L
|
||||
--SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- R
|
||||
SendDataHW("110", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1)
|
||||
SendDataHW("101", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10)
|
||||
SendDataHW("102", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2)
|
||||
SendDataHW("109", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9)
|
||||
SendDataHW("103", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3)
|
||||
SendDataHW("108", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8)
|
||||
SendDataHW("104", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4)
|
||||
SendDataHW("107", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7)
|
||||
SendDataHW("106", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5)
|
||||
SendDataHW("105", (gES_PayloadInfo.Stations[12].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6)
|
||||
--SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware )
|
||||
-- air-to-air missils panel 1 and 2, air combat modus, CurrentStation = 1, panel 1 and 2 on
|
||||
-- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station
|
||||
-- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station
|
||||
-- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID
|
||||
|
||||
-- defination
|
||||
if gES_CurrentStationTmp == nil then
|
||||
gES_CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if gES_PayloadInfo.CurrentStation > 0 and
|
||||
gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then
|
||||
gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation
|
||||
|
||||
gES_TmpStationToPanel = {}
|
||||
--gES_TmpStationToPanel[1] = {Panel = 'L', StationID = 'L', CurrentID = 'L', HardwareID = lHardware } -- L
|
||||
--gES_TmpStationToPanel[2] = {Panel = 'R', StationID = 'R', CurrentID = 'R', HardwareID = lHardware } -- R
|
||||
gES_TmpStationToPanel[3] = {Panel = 10, StationID = 110, CurrentID = 210, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[4] = {Panel = 1, StationID = 101, CurrentID = 201, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[5] = {Panel = 2, StationID = 102, CurrentID = 202, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[6] = {Panel = 9, StationID = 109, CurrentID = 209, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[7] = {Panel = 3, StationID = 103, CurrentID = 203, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[8] = {Panel = 8, StationID = 108, CurrentID = 208, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[9] = {Panel = 4, StationID = 104, CurrentID = 204, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[10] = {Panel = 7, StationID = 107, CurrentID = 207, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[11] = {Panel = 6, StationID = 106, CurrentID = 206, HardwareID = lHardware }
|
||||
gES_TmpStationToPanel[12] = {Panel = 5, StationID = 105, CurrentID = 205, HardwareID = lHardware }
|
||||
|
||||
WeaponStatusPanel_Reset(201, 210, lHardware)
|
||||
|
||||
if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then
|
||||
SendDataHW(gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware ) -- eigentliche Auswahl
|
||||
|
||||
table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen
|
||||
end
|
||||
elseif gES_PayloadInfo.CurrentStation == 0 and gES_CurrentStationTmp > 0 then
|
||||
WeaponStatusPanel_Reset(201, 210, lHardware)
|
||||
gES_CurrentStationTmp = -1
|
||||
end
|
||||
end
|
||||
|
||||
function FuelQuantityIndicator(hardware)
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lHardware = hardware or 1
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
SendDataHW("300", string.format("%d", math.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("301", string.format("%d", lEngineInfo.fuel_internal), lHardware ) -- total fuel in kg
|
||||
--SendDataHW("302", string.format("%d", lEngineInfo.fuel_external), lHardware ) -- external fuel in kg
|
||||
|
||||
SendDataHW("304", (lEngineInfo.fuel_internal < 5000.0 and 1 or 0), lHardware ) -- Tank warning 1
|
||||
SendDataHW("305", (lEngineInfo.fuel_internal < 1000.0 and 1 or 0), lHardware ) -- Tank warning 2 4000
|
||||
SendDataHW("306", (lEngineInfo.fuel_internal < 4000.0 and 1 or 0), lHardware ) -- Tank warning 3 1500
|
||||
SendDataHW("307", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0), lHardware ) -- Tank warning 4 1000
|
||||
SendDataHW("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0), lHardware ) -- Bingo Fuel
|
||||
|
||||
end
|
||||
|
||||
function MechanicalDevicesIndicator(hardware)
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lHardware = hardware or 1
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--WriteToLog('lMechInfo: '..dump(lMechInfo))
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--SendDataHW("500", lMechInfo.gear.status )
|
||||
--SendDataHW("501", lMechInfo.gear.value )
|
||||
--SendDataHW("502", lMechInfo.gear.nose.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("503", lMechInfo.gear.main.left.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("504", lMechInfo.gear.main.right.rod ) -- zeigt an wie weit das Fahrwerk einsackt wenn das Flugzeug auf dem Boden ist
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) and 1 or 0 ) ) -- gear warning light, go up
|
||||
--SendDataHW("500", ((lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0) and 1 or 0 ) ) -- gear warning light, go down
|
||||
SendDataHW("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ), lHardware ) -- gear warning light
|
||||
SendDataHW("501", (lMechInfo.gear.value > 0.85 and 1 or 0), lHardware ) -- nose gear
|
||||
SendDataHW("502", (lMechInfo.gear.value > 0.95 and 1 or 0), lHardware ) -- left gear
|
||||
SendDataHW("503", (lMechInfo.gear.value == 1 and 1 or 0), lHardware ) -- right gear
|
||||
|
||||
--SendDataHW("510", lMechInfo.speedbrakes.status ) -- speedbreakes on 1 (0|1)
|
||||
SendDataHW("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0), lHardware ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
--SendDataHW("520", lMechInfo.wheelbrakes.status, lHardware ) -- not in use
|
||||
--SendDataHW("521", lMechInfo.wheelbrakes.value, lHardware ) -- not in use
|
||||
|
||||
local lGetTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
if lGetTrueAirSpeed == nil then
|
||||
lGetTrueAirSpeed = 0
|
||||
end
|
||||
--SendDataHW("530", lMechInfo.flaps.status ) -- flap switch off 0, 1. position 1, 2. position 2 (0|1|2)
|
||||
--SendDataHW("531", lMechInfo.flaps.value ) -- flap 1. position > 0.25, 2. position > 0.93 (0 - 1)
|
||||
SendDataHW("531", (lMechInfo.flaps.value > 0.25 and 1 or 0), lHardware ) -- flap 1. position
|
||||
SendDataHW("532", (lMechInfo.flaps.value > 0.93 and 1 or 0), lHardware ) -- flap 2. position
|
||||
SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
SendDataHW("534", (lMechInfo.gear.value > 0.5 and 1 or 0), lHardware ) -- Intake FOD shields
|
||||
|
||||
--SendDataHW("540", lMechInfo.parachute.status )
|
||||
SendDataHW("541", (lMechInfo.hook.value > 0.8 and 1 or 0), lHardware )
|
||||
|
||||
--SendDataHW("550", lMechInfo.noseflap.status )
|
||||
SendDataHW("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0), lHardware )
|
||||
end
|
||||
@@ -1,343 +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] = "%.2f", -- AirspeedNeedle
|
||||
[29] = "%.1f", -- Variometer
|
||||
-- Altimeter
|
||||
[97] = "%.1f", -- Altimeter_Pressure
|
||||
[96] = "%.1f", -- Altimeter_10000_footPtr
|
||||
[24] = "%.1f", -- Altimeter_1000_footPtr
|
||||
[25] = "%.1f", -- Altimeter_100_footPtr
|
||||
-- Artificial horizon
|
||||
[15] = "%.1f", -- AHorizon_Pitch
|
||||
[14] = "%.1f", -- AHorizon_Bank
|
||||
[16] = "%.1f", -- AHorizon_PitchShift
|
||||
[20] = "%.1f", -- AHorizon_Caged
|
||||
-- directional gyro
|
||||
[12] = "%.1f", -- GyroHeading
|
||||
-- turn indicator
|
||||
[27] = "%.1f", -- TurnNeedle
|
||||
[28] = "%.1f", -- Slipball
|
||||
-- oxygen pressure indicator
|
||||
[34] = "%.1f", -- Oxygen_Pressure
|
||||
[33] = "%.1f", -- Oxygen_Flow_Blinker
|
||||
-- fuel system
|
||||
[155] = "%.2f", -- Fuel_Tank_Left
|
||||
[156] = "%.2f", -- Fuel_Tank_Right
|
||||
[32] = "%.1f", -- Fuel_Pressure
|
||||
-- A-11 clock
|
||||
[4] = "%.4f", -- CLOCK_currtime_hours
|
||||
[5] = "%.4f", -- CLOCK_currtime_minutes
|
||||
[6] = "%.4f", -- CLOCK_currtime_seconds
|
||||
-- AN5730 remote compass
|
||||
[1] = "%.4f", -- CompassHeading
|
||||
[2] = "%.4f", -- CommandedCourse
|
||||
[3] = "%.4f", -- CommandedCourseKnob
|
||||
-- TailRadarWarning
|
||||
[161] = "%.1f", -- TailRadarWarning
|
||||
-- SCR-522A Control panel
|
||||
[122] = "%.1f", -- A_channel_light
|
||||
[123] = "%.1f", -- B_channel_light
|
||||
[124] = "%.1f", -- C_channel_light
|
||||
[125] = "%.1f", -- D_channel_light
|
||||
[126] = "%.1f", -- Transmit_light
|
||||
-- hydraulic pressure
|
||||
[78] = "%.4f", -- Hydraulic_Pressure
|
||||
-- Landing gears handle
|
||||
[150] = "%.4f", -- Landing_Gear_Handle
|
||||
[151] = "%.4f", -- Landing_Gear_Handle_Indoor
|
||||
[80] = "%.1f", -- LandingGearGreenLight
|
||||
[82] = "%.1f", -- LandingGearRedLight
|
||||
-- gauges
|
||||
[10] = "%.4f", -- Manifold_Pressure
|
||||
[23] = "%.4f", -- Engine_RPM
|
||||
[9] = "%.4f", -- Vacuum_Suction
|
||||
[21] = "%.4f", -- Carb_Temperature
|
||||
[22] = "%.4f", -- Coolant_Temperature
|
||||
[30] = "%.4f", -- Oil_Temperature
|
||||
[31] = "%.4f", -- Oil_Pressure
|
||||
[164] = "%.1f", -- Left_Fluor_Light
|
||||
[165] = "%.1f", -- Right_Fluor_Light
|
||||
[59] = "%.1f", -- Hight_Blower_Lamp
|
||||
-- Trimmer
|
||||
[170] = "%.4f", -- Aileron_Trimmer
|
||||
[172] = "%.4f", -- Rudder_Trimmer
|
||||
[171] = "%.4f", -- Elevator_Trimmer
|
||||
[174] = "%.4f", -- Control_Lock_Bracket
|
||||
[175] = "%.4f", -- Accelerometer_main
|
||||
[177] = "%.4f", -- Accelerometer_min
|
||||
[178] = "%.4f", -- Accelerometer_max
|
||||
[101] = "%.4f", -- Ammeter
|
||||
-- light
|
||||
[185] = "%.1f", -- Left_cockpit_light
|
||||
[186] = "%.1f", -- Right_cockpit_light
|
||||
[190] = "%.4f" -- warEmergencyPowerLimWire
|
||||
}
|
||||
gES_GlassCockpitConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
|
||||
-- Right Swich Panel
|
||||
[102] = "%d", -- Generator Connect/Disconnect
|
||||
[103] = "%d", -- Battery Connect/Disconnect
|
||||
[104] = "%d", -- Gun Heating ON/OFF
|
||||
[105] = "%d", -- Pitot Heating ON/OFF
|
||||
[106] = "%d", -- Wing Position Lights Bright/Off/Dim
|
||||
[107] = "%d", -- Tail Position Lights Bright/Off/Dim
|
||||
[108] = "%d", -- Red Recognition Light Key/Off/Steady
|
||||
[109] = "%d", -- Green Recognition Light Key/Off/Steady
|
||||
[110] = "%d", -- Amber Recognition Light Key/Off/Steady
|
||||
[111] = "%d", -- Recognition Lights Key
|
||||
[112] = "%d", -- Circuit Protectors Reset
|
||||
[100] = "%d", -- Right Fluorescent Light
|
||||
[90] = "%d", -- Left Fluorescent Light
|
||||
-- Flight Instrument panel
|
||||
[3] = "%.4f", -- Course Set
|
||||
[179] = "%.4f", -- Heading Set/Cage
|
||||
[13] = "%d", -- Heading Set/Cage Button
|
||||
[17] = "%.4f", -- Pitch Adjustment
|
||||
[19] = "%.4f", -- Cage
|
||||
[18] = "%d", -- Cage Button
|
||||
[8] = "%d", -- Winding/Adjustment Clock ??
|
||||
[7] = "%d", -- Winding/Adjustment Clock ??
|
||||
[26] = "%.4f", -- Set Pressure
|
||||
-- SCR-522A Control panel
|
||||
[117] = "%d", -- Radio ON/OFF
|
||||
[118] = "%d", -- A Channel Activate
|
||||
[119] = "%d", -- B Channel Activate
|
||||
[120] = "%d", -- C Channel Activate
|
||||
[121] = "%d", -- D Channel Activate
|
||||
[127] = "%.4f", -- Radio Lights Dimmer
|
||||
[116] = "%.4f", -- Radio Audio Volume
|
||||
[44] = "%d", -- Microphone On
|
||||
[129] = "%d", -- Switch Locking Lever
|
||||
[128] = "%.4f", -- Radio Mode Transmit/Receive/Remote
|
||||
-------------
|
||||
[71] = "%.4f", -- Cockpit Lights
|
||||
[66] = "%0.1f", -- Ignition Off/Right/Left/Both
|
||||
[67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On
|
||||
[72] = "%d", -- Silence Landing Gear Warning Horn Cut Off
|
||||
-- Bomb Arm/Chemical
|
||||
[69] = "%d", -- Left Bomb Arm/Chemical
|
||||
[70] = "%d", -- Right Bomb Arm/Chemical
|
||||
-- Release Mode
|
||||
[68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm
|
||||
-- Engine Control Panel
|
||||
[58] = "%d", -- Supercharger Switch Cover
|
||||
[57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH
|
||||
[60] = "%d", -- High Blower Lamp Test
|
||||
[61] = "%d", -- Fuel Booster On/Off
|
||||
[62] = "%d", -- Oil Dilute Activate
|
||||
[63] = "%d", -- Starter Activate
|
||||
[64] = "%d", -- Starter Switch Cover
|
||||
[65] = "%d", -- Primer Activate
|
||||
-- Oxygen Regulator
|
||||
[131] = "%d", -- Auto-Mix On-Off
|
||||
[130] = "%0.4f", -- Oxygen Emergency By-pass
|
||||
-- Fuel system
|
||||
[85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank
|
||||
[86] = "%d", -- Fuel Shut-Off Valve ON/OFF
|
||||
-- AN/APS-13
|
||||
[114] = "%d", -- ail Warning Radar Power ON/OFF
|
||||
[115] = "%d", -- Tail Warning Radar Test
|
||||
[113] = "%.4f", -- Tail Warning Radar Light Control
|
||||
-------------
|
||||
[79] = "%.4f", -- Hydraulic Release Knob
|
||||
[94] = "%.4f", -- Flaps Control Handle
|
||||
[84] = "%d", -- Parking Brake Handle
|
||||
[81] = "%d", -- Safe Landing Gear Light Test
|
||||
[83] = "%d", -- Unsafe Landing Gear Light Test
|
||||
-- Detrola receiver
|
||||
[137] = "%0.4f", -- Detrola Frequency Selector
|
||||
[138] = "%0.4f", -- Detrola Volume
|
||||
-- canopy
|
||||
[147] = "%.4f", -- Canopy Hand Crank
|
||||
[149] = "%d", -- Canopy Emergency Release Handle
|
||||
-- AN/ARA-8
|
||||
[152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING
|
||||
[153] = "%d", -- Homing Adapter Power On/Off
|
||||
[154] = "%d", -- Homing Adapter's Circuit Breaker
|
||||
-- SCR-695
|
||||
[139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6
|
||||
[140] = "%d", -- IFF Power On/Off
|
||||
[141] = "%d", -- IFF TIME/OFF/ON
|
||||
[142] = "%d", -- IFF Detonator Circuit On/Off
|
||||
[143] = "%d", -- IFF Distress Signal On/Off
|
||||
[145] = "%d", -- IFF Detonator Left
|
||||
[146] = "%d", -- IFF Detonator Right
|
||||
-- Trimmers
|
||||
[91] = "%.4f", -- Aileron Trim
|
||||
[92] = "%.4f", -- Elevator Trim
|
||||
[93] = "%.4f", -- Rudder Trim
|
||||
-------------
|
||||
[157] = "%.4f", -- Defroster
|
||||
[158] = "%.4f", -- Cold Air
|
||||
[159] = "%.4f", -- Hot Air
|
||||
-------------
|
||||
[89] = "%d", -- Landing Light On/Off
|
||||
[168] = "%d", -- Coolant Control Cover
|
||||
[87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control
|
||||
[169] = "%d", -- Oil Control Cover
|
||||
[88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control
|
||||
[134] = "%0.1f", -- Carburetor Cold Air Control
|
||||
[135] = "%0.1f", -- Carburetor Warm Air Control
|
||||
[47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH
|
||||
[43] = "%.4f", -- Throttle
|
||||
[46] = "%.4f", -- Propeller RPM
|
||||
[173] = "%.4f", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position
|
||||
[48] = "%.4f", -- Lock Throttle
|
||||
[49] = "%.4f", -- Lock Propeller & Mixture
|
||||
[176] = "%.4f", -- G-meter reset
|
||||
[183] = "%.4f" -- Mirror
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to GlassCockpit
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
SendData("ExportID", "Format")
|
||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||
]]
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to hardware
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
SendDataHW("ExportID", "Format")
|
||||
SendDataHW("ExportID", "Format", HardwareConfigID)
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
|
||||
-- no dimming lights
|
||||
-- TailRadarWarning
|
||||
SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.3 and 1 or 0) -- Lamp TailRadarWarning
|
||||
-- SCR-522A Control panel
|
||||
SendDataHW("122", mainPanelDevice:get_argument_value(122) > 0.3 and 1 or 0) -- A_channel_light
|
||||
SendDataHW("123", mainPanelDevice:get_argument_value(123) > 0.3 and 1 or 0) -- B_channel_light
|
||||
SendDataHW("124", mainPanelDevice:get_argument_value(124) > 0.3 and 1 or 0) -- C_channel_light
|
||||
SendDataHW("125", mainPanelDevice:get_argument_value(125) > 0.3 and 1 or 0) -- D_channel_light
|
||||
SendDataHW("126", mainPanelDevice:get_argument_value(126) > 0.3 and 1 or 0) -- Transmit_light
|
||||
-- Landing gears
|
||||
SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- LandingGearGreenLight
|
||||
SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- LandingGearRedLight
|
||||
-- Engine
|
||||
SendDataHW("59", mainPanelDevice:get_argument_value(59) > 0.3 and 1 or 0) -- Hight_Blower_Lamp
|
||||
-- Cockpit Lights
|
||||
SendDataHW("164", mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Left_Fluor_Light
|
||||
SendDataHW("165", mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Right_Fluor_Light
|
||||
SendDataHW("185", mainPanelDevice:get_argument_value(185) > 0.3 and 1 or 0) -- Left_cockpit_light
|
||||
SendDataHW("186", mainPanelDevice:get_argument_value(186) > 0.3 and 1 or 0) -- Right_cockpit_light
|
||||
|
||||
--[[
|
||||
-- dimming lights
|
||||
-- TailRadarWarning
|
||||
SendDataHW("161", string.format("%.1f", mainPanelDevice:get_argument_value(161))) -- Lamp TailRadarWarning
|
||||
-- SCR-522A Control panel
|
||||
SendDataHW("122", string.format("%.1f", mainPanelDevice:get_argument_value(122))) -- A_channel_light
|
||||
SendDataHW("123", string.format("%.1f", mainPanelDevice:get_argument_value(123))) -- B_channel_light
|
||||
SendDataHW("124", string.format("%.1f", mainPanelDevice:get_argument_value(124))) -- C_channel_light
|
||||
SendDataHW("125", string.format("%.1f", mainPanelDevice:get_argument_value(125))) -- D_channel_light
|
||||
SendDataHW("126", string.format("%.1f", mainPanelDevice:get_argument_value(126))) -- Transmit_light
|
||||
-- Landing gears
|
||||
SendDataHW("80", string.format("%.1f", mainPanelDevice:get_argument_value(80))) -- LandingGearGreenLight
|
||||
SendDataHW("82", string.format("%.1f", mainPanelDevice:get_argument_value(82))) -- LandingGearRedLight
|
||||
-- Engine
|
||||
SendDataHW("59", string.format("%.1f", mainPanelDevice:get_argument_value(59))) -- Hight_Blower_Lamp
|
||||
-- Cockpit Lights
|
||||
SendDataHW("164", string.format("%.1f", mainPanelDevice:get_argument_value(164))) -- Left_Fluor_Light
|
||||
SendDataHW("165", string.format("%.1f", mainPanelDevice:get_argument_value(165))) -- Right_Fluor_Light
|
||||
SendDataHW("185", string.format("%.1f", mainPanelDevice:get_argument_value(185))) -- Left_cockpit_light
|
||||
SendDataHW("186", string.format("%.1f", mainPanelDevice:get_argument_value(186))) -- Right_cockpit_light
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to GlassCockpit
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
SendData("ExportID", "Format")
|
||||
SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data
|
||||
]]
|
||||
|
||||
--[[
|
||||
local lDETROLA = GetDevice(24)
|
||||
WriteToLog('lDETROLA: '..dump(lDETROLA:is_on()))
|
||||
WriteToLog('lDETROLA: '..dump(lDETROLA:get_frequency()))
|
||||
--SendData(2000, string.format("%7.3f", lDETROLA:get_frequency()/1000000))
|
||||
|
||||
local lINTERCOM = GetDevice(31)
|
||||
WriteToLog('lINTERCOM: '..dump(lINTERCOM:is_communicator_available()))
|
||||
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_noise_level()))
|
||||
WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_signal_level()))
|
||||
]]
|
||||
--[[
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 32, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to hardware
|
||||
Example from A-10C
|
||||
Landing Gear
|
||||
mainPanelDevice, basis panel
|
||||
SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE
|
||||
SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE
|
||||
SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE
|
||||
]]
|
||||
|
||||
--[[
|
||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||||
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 10, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
# Known errors are listed here.
|
||||
---
|
||||
Please do not complain about the mistakes, but find a solution.
|
||||
---
|
||||
|
||||
On all Flaming Cliffs aircraft there are problems with the display of various instruments or warning lights.
|
||||
|
||||
E.g.
|
||||
- Many data of the functions LoGetEngineInfo(), LoGetMCPState(), ...
|
||||
- In the A-10A / F-15C, there are differences between the metric return values of the LoGetAltitudeAboveSeaLevel(), LoGetAltitudeAboveGroundLevel(), LoGetTrueAirSpeed(), ..., and the converted values values.
|
||||
@@ -1,26 +1,70 @@
|
||||
###Deutsch###
|
||||
# Deutsch
|
||||
---
|
||||
Dies ist ein universell einsetzbares Export Script für DCS.
|
||||
Es wird der gleichzeitige Export von Daten an verschiedene Software(Hardware)-Tools ermöglicht.
|
||||
Es wird der gleichzeitige Export von Daten an Virtual Cockpit Software und I/O Hardware ermöglicht.
|
||||
|
||||
Zur Zeit werden folgende Export-Formate unterstützt.
|
||||
- DAC (DCS Arcaze Connector) von [H-J-P](http://github.com/h-j-p/DAC/) um die Arcaze USB Controller anzusprechen (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB)
|
||||
- HawkTouch in der Version 1.5/1.6 (http://forums.eagle.ru/showthread.php?t=71729) mit der GaugePack.dll in der Version von [H-J-P](http://github.com/h-j-p/HT/).
|
||||
- HELIOS in der Version 1.3.19 (http://www.gadrocsworkshop.com/helios/) (Unterstützt nur die DCS Module A-10C, Ka-50 und im Eingeschränkten Umfang die SU-25T und die Flaming Cliffs Flugzeuge)
|
||||
- DAC (DCS Arcaze Connector) von [H-J-P](https://github.com/H-J-P/DAC/) um die Arcaze USB Controller anzusprechen (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB)
|
||||
- Ikarus von [H-J-P](https://github.com/H-J-P/Ikarus), unsere Virtual Cockpit Software
|
||||
|
||||
und andere Software/Hardware die ihre Daten über eine UDP Netzwerkverbindung bekommen und die Daten in einem Key=Value Format verarbeiten.
|
||||
Der Export von Daten wird für folgende Module unterstützt:
|
||||
- A-10C
|
||||
- AJS37
|
||||
- AV-8B N/A
|
||||
- Bf-109K-4
|
||||
- F/A-18C Hornet
|
||||
- F-5E-3
|
||||
- F-86F
|
||||
- FW-190D9
|
||||
- Ka-50
|
||||
- L-39C/ZA
|
||||
- Mi-8MT
|
||||
- MiG-15bis
|
||||
- MiG-21Bis
|
||||
- Mirage 2000
|
||||
- P-51D 25/30-NA
|
||||
- SA342L/M/Mistral
|
||||
- SpitfireLFMkIX
|
||||
- Su-25T
|
||||
- TF-51D
|
||||
- UH-1H
|
||||
- alle Flaming Cliffs Flugzeuge
|
||||
|
||||
###English###
|
||||
Kompatibel zur DCS World 2.5.4 und BETA Version
|
||||
|
||||
# English
|
||||
---
|
||||
This is an universally insertable export script for DCS. It allows for the simultaneous export of data of different programs and hardware
|
||||
This is an universally insertable export script for DCS. It allows for the simultaneous export of data at virtual cockpit software and I/O hardware.
|
||||
|
||||
At present the following export formats are supported:
|
||||
- DAC. (DCS Arcaze Connector) by [H-J-P](http://github.com/h-j-p/DAC/) to address the Arcaze USB Controller (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB)
|
||||
- HawkTouch in version 1.5/1.6 (http://forums.eagle.ru/showthread.php?t=71729) with GaugePack.dll in the version by [H-J-P](http://github.com/h-j-p/HT/).
|
||||
- HELIOS in the version 1.3.19 (http://www.gadrocsworkshop.com/helios/) (Only supports the DCS Module A-10C, Ka-50 and in a limited capacity the SU-25T and the Flaming Cliffs Aircraft)
|
||||
- DAC (DCS Arcaze Connector) by [H-J-P](https://github.com/H-J-P/DAC/) to address the Arcaze USB Controller (http://wiki.simple-solutions.de/en/products/Arcaze/Arcaze-USB)
|
||||
- Ikarus by [H-J-P](https://github.com/H-J-P/Ikarus), our virtual cockpit software
|
||||
|
||||
and other Software/Hardware that obtain your data via a UDP network connection and then process it into a Key=Value Format.
|
||||
Following moduls are supported:
|
||||
- A-10C
|
||||
- AJS37
|
||||
- AV-8B N/A
|
||||
- Bf-109K-4
|
||||
- F/A-18C Hornet
|
||||
- F-5E-3
|
||||
- F-86F
|
||||
- FW-190D9
|
||||
- Ka-50
|
||||
- L-39C/ZA
|
||||
- Mi-8MT
|
||||
- MiG-15bis
|
||||
- MiG-21Bis
|
||||
- Mirage 2000
|
||||
- P-51D 25/30-NA
|
||||
- SA342L/M/Mistral
|
||||
- SpitfireLFMkIX
|
||||
- Su-25T
|
||||
- TF-51D
|
||||
- UH-1H
|
||||
- all Flaming Cliffs aircrafts
|
||||
|
||||
###Wiki###
|
||||
Compatible with DCS World 2.5.4 and BETA version
|
||||
|
||||
# Wiki
|
||||
---
|
||||
[DCS-ExportScript Wiki and Docu](https://github.com/s-d-a/DCS-ExportScripts/wiki) (in Deutsch and English)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
-- Ikarus and D.A.C. Export Script
|
||||
--
|
||||
-- Config File
|
||||
--
|
||||
-- Copyright by Michael aka McMicha 2014
|
||||
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||
|
||||
ExportScript.Config = {}
|
||||
ExportScript.Version.Config = "1.2.0"
|
||||
|
||||
-- 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 = false -- true for 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 = ":"
|
||||
|
||||
-- Ikarus and D.A.C. can data send
|
||||
ExportScript.Config.Listener = true -- false for not use
|
||||
ExportScript.Config.ListenerPort = 26027 -- Listener Port for D.A.C.
|
||||
|
||||
-- Other
|
||||
ExportScript.Config.ExportInterval = 0.05 -- export evry 0.05 secounds
|
||||
ExportScript.Config.ExportLowTickInterval = 0.5 -- export evry 0.5 secounds
|
||||
ExportScript.Config.LogPath = lfs.writedir()..[[Logs\Export.log]]
|
||||
ExportScript.Config.ExportModulePath = lfs.writedir()..[[Scripts\DCS-ExportScript\ExportsModules\]]
|
||||
ExportScript.Config.Debug = false
|
||||
ExportScript.Config.SocketDebug = false
|
||||
ExportScript.Config.FirstNewDataSend = true
|
||||
ExportScript.Config.FirstNewDataSendCount = 100
|
||||
@@ -0,0 +1,173 @@
|
||||
-- Ikarus and D.A.C. Export Script
|
||||
--
|
||||
-- Copyright by Michael aka McMicha 2014 - 2018
|
||||
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||
|
||||
|
||||
-- Main Table
|
||||
ExportScript = {}
|
||||
ExportScript.Version = {}
|
||||
ExportScript.Version.ExportScript = "1.2.0"
|
||||
-- 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 = {}
|
||||
|
||||
ExportScript.lastExportTimeHI = 0
|
||||
ExportScript.lastExportTimeLI = 0
|
||||
|
||||
ExportScript.NoLuaExportBeforeNextFrame = false
|
||||
|
||||
local PrevExport = {}
|
||||
PrevExport.LuaExportStart = LuaExportStart
|
||||
PrevExport.LuaExportStop = LuaExportStop
|
||||
PrevExport.LuaExportBeforeNextFrame = LuaExportBeforeNextFrame
|
||||
PrevExport.LuaExportAfterNextFrame = LuaExportAfterNextFrame
|
||||
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]])
|
||||
ExportScript.utf8 = dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\utf8.lua]])
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]])
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\genericRadio.lua]])
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Maps.lua]])
|
||||
|
||||
for i = 1, #ExportScript.Config.DAC, 1 do
|
||||
ExportScript.PacketSizeDAC[i] = 0
|
||||
ExportScript.SendStringsDAC[i] = {}
|
||||
ExportScript.LastDataDAC[i] = {}
|
||||
end
|
||||
|
||||
-- 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"
|
||||
|
||||
--local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old")
|
||||
ExportScript.logFile = io.open(ExportScript.Config.LogPath, "wa") -- "W+"
|
||||
if ExportScript.logFile then
|
||||
ExportScript.logFile:write('\239\187\191') -- create a UTF-8 BOM
|
||||
ExportScript.logFile:write("ExportScript Version: "..ExportScript.Version.ExportScript.."\r\n")
|
||||
end
|
||||
--if lrenmae1 == nil then
|
||||
-- ExportScript.Tools.WriteToLog("Rename Error: "..lrename2)
|
||||
--end
|
||||
|
||||
ExportScript.Tools.createUDPSender()
|
||||
ExportScript.Tools.createUDPListner()
|
||||
|
||||
ExportScript.AF = {} -- Table for Auxiliary functions
|
||||
|
||||
ExportScript.NoLuaExportBeforeNextFrame = false
|
||||
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||
|
||||
-- Chain previously-included export as necessary
|
||||
if PrevExport.LuaExportStart then
|
||||
PrevExport.LuaExportStart()
|
||||
end
|
||||
end
|
||||
|
||||
function LuaExportBeforeNextFrame()
|
||||
--[[ if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.ProcessInput()
|
||||
else
|
||||
ExportScript.coProcessArguments_BeforeNextFrame = coroutine.create(ExportScript.Tools.ProcessInput)
|
||||
coStatus = coroutine.resume(ExportScript.coProcessArguments_BeforeNextFrame)
|
||||
end
|
||||
|
||||
if ExportScript.NoLuaExportBeforeNextFrame == false then
|
||||
ExportScript.Tools.ProcessOutput()
|
||||
end
|
||||
]]
|
||||
-- Chain previously-included export as necessary
|
||||
if PrevExport.LuaExportBeforeNextFrame then
|
||||
PrevExport.LuaExportBeforeNextFrame()
|
||||
end
|
||||
end
|
||||
|
||||
function LuaExportAfterNextFrame()
|
||||
if ExportScript.NoLuaExportBeforeNextFrame then
|
||||
ExportScript.Tools.ProcessOutput()
|
||||
end
|
||||
|
||||
-- Chain previously-included export as necessary
|
||||
if PrevExport.LuaExportAfterNextFrame then
|
||||
PrevExport.LuaExportAfterNextFrame()
|
||||
end
|
||||
end
|
||||
|
||||
function LuaExportActivityNextEvent(t)
|
||||
local tNext = t
|
||||
|
||||
-- Put your event code here and increase tNext for the next event
|
||||
-- so this function will be called automatically at your custom
|
||||
-- model times.
|
||||
-- If tNext == t then the activity will be terminated.
|
||||
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.ProcessInput()
|
||||
else
|
||||
ExportScript.coProcessArguments_BeforeNextFrame = coroutine.create(ExportScript.Tools.ProcessInput)
|
||||
coStatus = coroutine.resume(ExportScript.coProcessArguments_BeforeNextFrame)
|
||||
end
|
||||
|
||||
if ExportScript.NoLuaExportBeforeNextFrame == false then
|
||||
ExportScript.Tools.ProcessOutput()
|
||||
end
|
||||
|
||||
tNext = tNext + ExportScript.Config.ExportInterval
|
||||
|
||||
return tNext
|
||||
end
|
||||
|
||||
function LuaExportStop()
|
||||
-- Works once just after mission stop.
|
||||
if ExportScript.Config.DACExport then
|
||||
ExportScript.Tools.SendDataDAC("DAC", "stop")
|
||||
for i=1, #ExportScript.Config.DAC, 1 do
|
||||
ExportScript.Tools.FlushDataDAC(i)
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport then
|
||||
ExportScript.Tools.SendData("Ikarus", "stop")
|
||||
ExportScript.Tools.FlushData()
|
||||
end
|
||||
|
||||
ExportScript.UDPsender:close()
|
||||
if ExportScript.Config.Listener 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
|
||||
|
||||
-- Chain previously-included export as necessary
|
||||
if PrevExport.LuaExportStop then
|
||||
PrevExport.LuaExportStop()
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,516 @@
|
||||
-- AJS37
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.AJS37 = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- INSTRUMENTS Front panel
|
||||
-- Left Side
|
||||
-- Airspeed indicator
|
||||
[100] = "%.4f", -- IndicatedAirSpeed {0, 0.01, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1} {0, 41.66, 47.78, 55.56, 64.17, 73.61, 83.33, 98.61, 106.9, 122.22, 136.1, 154.16, 194.44, 239, 263.89, 288.89, 319.44, 350, 380.55, 416.66} --m/s
|
||||
-- Mach-meter
|
||||
[103] = "%.4f", -- MachMeterDec2 (1.2 _3_)
|
||||
[102] = "%.4f", -- MachMeterDec1 (1. _2_ 3)
|
||||
[101] = "%.4f", -- Integer (_1_ .23)
|
||||
[2007] = "%.f", -- ASI OFF Flag
|
||||
-- ADI
|
||||
[105] = "%.4f", -- Pitch {1.0, -1.0}
|
||||
[106] = "%.4f", -- Heading {1.0, -1.0}
|
||||
[107] = "%.4f", -- Roll {-1.0, 1.0}
|
||||
[108] = "%.4f", -- VerticalSpeed {-1.0, 1.0} {-5.0, 5.0} --ms
|
||||
[107] = "%.4f", -- Rollindex {1.0, -1.0} inverted
|
||||
[109] = "%.4f", -- VerticalILS {1.0, -1.0} {-1 , 1} --Degrees?
|
||||
[110] = "%.4f", -- HorizontalILS {1.0, -1.0} {-1 , 1} --Degrees?
|
||||
[160] = "%.4f", -- ADI OFF Flag
|
||||
[1810] = "%.4f", -- Slipball {-1.0, 1.0}, not animate
|
||||
[120] = "%.4f", -- AoA
|
||||
-- Main altimeter
|
||||
[114] = "%.4f", -- Altimeter_10000m {0.0, 1.0} {0.0, 10000}
|
||||
[113] = "%.4f", -- Altimeter_1000m {0.0, 1.0} {0.0, 1000}
|
||||
[2008] = "%.f", -- Altimeter OFF
|
||||
-- Altimeter setting 1 hPa
|
||||
[115] = "%.4f", -- AltimeterSetting_000X
|
||||
[116] = "%.4f", -- AltimeterSetting_00X0
|
||||
[117] = "%.4f", -- AltimeterSetting_0X00
|
||||
[118] = "%.4f", -- AltimeterSetting_X000
|
||||
-- Frequency
|
||||
-- FM/AM Radio
|
||||
[177] = "%.4f", -- MHz_X00
|
||||
[178] = "%.4f", -- MHz_0X0
|
||||
[179] = "%.4f", -- MHz_00X
|
||||
[180] = "%.4f", -- KHz_X00
|
||||
[181] = "%.4f", -- KHz_0X0
|
||||
[182] = "%.4f", -- KHz_00X
|
||||
-- Centre
|
||||
-- CI Instruments
|
||||
[128] = "%.4f", -- CIHeading {1.0, -1.0}
|
||||
[129] = "%.4f", -- CICommandedHeading {1.0, 0.0}
|
||||
[163] = "%.4f", -- CI OFF Flag 0.0=OFF, 1.0=fade in
|
||||
[3000] = "%.2f", -- Radar Scan Zone, 0.0=off, >= 0.1=15, >= 0.2=30, >= 0.3=60, >=0.4=120
|
||||
-- Right Side
|
||||
-- ENGINE
|
||||
[139] = "%.4f", -- Engine_RPM_100 {-1.0, 1.0} {0.0, 1.1}
|
||||
[140] = "%.4f", -- Engine_RPM_10
|
||||
-- Accelerometer
|
||||
[136] = "%.4f", -- VerticalAcceleration {-0.3, 1.0} { -2.0, 9.0}
|
||||
-- Backup instruments
|
||||
[127] = "%.4f", -- MagneticHeading {1.0, -1.0}
|
||||
[138] = "%.4f", -- IndicatedAirSpeedBackup {0.0, 0.01, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.0} {0.0, 56.39, 60.56, 65.83, 70.83, 75.83, 81.11, 86.11, 100.0, 113.9, 130.55, 150.0, 170.8, 193.0, 222.22} --m/s
|
||||
[121] = "%.4f", -- BackupPitch {1.0, -1.0}
|
||||
[122] = "%.4f", -- BackupRoll {1.0, -1.0}
|
||||
[125] = "%.4f", -- BackupAltimeter_10000m {0.0, 1.0} {0.0, 10000}
|
||||
[124] = "%.4f", -- BackupAltimeter_1000m {0.0, 1.0} {0.0, 1000}
|
||||
-- BackupAltimeter setting 1 hPa
|
||||
[468] = "%.4f", -- BackupAltimeterSetting_000X
|
||||
[467] = "%.4f", -- BackupAltimeterSetting_00X0
|
||||
[466] = "%.4f", -- BackupAltimeterSetting_0X00
|
||||
[465] = "%.4f", -- BackupAltimeterSetting_X000
|
||||
-- Distance indicator
|
||||
[142] = "%.4f", -- Distance {0.0, 0.4} {0.0, 40.0}
|
||||
[143] = "%.1f", -- km/mil Display 0.0=km >0.8=mil
|
||||
-- Fuel Gauge
|
||||
[144] = "%.4f", -- FuelGauge {0.0, 1.0} {0.0, 135.0}
|
||||
[145] = "%.4f", -- FuelNeeded {0.0, 1.0} {0.0, 135.0}
|
||||
-- Clock
|
||||
[130] = "%.4f", -- Hour
|
||||
--[] = "%.4f", -- Minute
|
||||
[133] = "%.4f", -- Second
|
||||
--
|
||||
[141] = "%.4f", -- Engine pressure ratio EPR indicator
|
||||
-- INSTRUMENTS Right Panel
|
||||
[147] = "%.4f", -- Engine nozzle indicator
|
||||
[146] = "%.4f", -- Exhaust Gas Temperature indicator Engine_TEMP {0.0, 1.00} {100, 800}
|
||||
[148] = "%.4f", -- Oxygen pressure indicator
|
||||
-- INSTRUMENTS Left Panel
|
||||
[2005] = "%.4f", -- Cabin pressure indicator
|
||||
[150] = "%.4f", -- Brake pressure indicator
|
||||
[151] = "%.4f", -- Pitch trim indicator
|
||||
-- Lamps/Lights
|
||||
-- Left Warning Lampen Panel
|
||||
-- Left Side
|
||||
[406] = "%.f", -- BRAND
|
||||
[407] = "%.f", -- BRAND
|
||||
[408] = "%.f", -- BRÄ UPPF
|
||||
[409] = "%.f", -- XTANK BRÄ
|
||||
[410] = "%.f", -- TANK PUMP
|
||||
[411] = "%.f", -- LANDSTÄLL
|
||||
[412] = "%.f", -- FÖRV FÖRBJ
|
||||
[413] = "%.f", -- NOSSTÄLL
|
||||
[414] = "%.f", -- V-STÄLL
|
||||
[415] = "%.f", -- H-STÄLL
|
||||
-- Right Side
|
||||
[416] = "%.f", -- TIPP VÄXEL
|
||||
[417] = "%.f", -- ELFEL
|
||||
[418] = "%.f", -- RESERVEFF
|
||||
[419] = "%.f", -- HYDR-TR2
|
||||
[420] = "%.f", -- HYDR-TR1
|
||||
[421] = "%.f", -- AFK FEL
|
||||
[422] = "%.f", -- EJ REV
|
||||
[423] = "%.f", -- OLJETRYCK
|
||||
-- Right Warning Lampen Panel
|
||||
-- Left Side
|
||||
[424] = "%.f", -- SPAK
|
||||
[425] = "%.f", -- HALL FUNK
|
||||
[426] = "%.f", -- RHM FEL
|
||||
[427] = "%.f", -- ROLLVÄXEL
|
||||
[428] = "%.f", -- CK
|
||||
[429] = "%.f", -- KABINHÖJD
|
||||
[430] = "%.f", -- HUV o STOLL
|
||||
[431] = "%.f", -- TÄNDSYST
|
||||
[432] = "%.f", -- STARTSYST
|
||||
[433] = "%.f", -- MAN BR REG
|
||||
-- Right Side
|
||||
[434] = "%.f", -- SYRGAS
|
||||
[435] = "%.f", -- BRÄ < 24
|
||||
[436] = "%.f", -- BRAND GTS
|
||||
[437] = "%.f", -- TILS
|
||||
[438] = "%.f", -- NAV-SYST
|
||||
[439] = "%.f", -- KB-V SLUT
|
||||
[440] = "%.f", -- KB-H/KA SL
|
||||
[441] = "%.f", -- FACKL SL
|
||||
[442] = "%.f", -- MOTVERK
|
||||
[443] = "%.f", -- LUFTBROMS
|
||||
-- Masterwarning lamp HUVUDVARNING
|
||||
[444] = "%.f", -- HUVUDVARNING - left lamp
|
||||
[445] = "%.f", -- HUVUDVARNING - right lamp
|
||||
-- Central Indicator
|
||||
[450] = "%.f", -- Altitude warning light
|
||||
-- RWR lights
|
||||
[451] = "%.f", -- 1 o'clock light
|
||||
[452] = "%.f", -- 3 o'clock light
|
||||
[453] = "%.f", -- 5 o'clock light
|
||||
[454] = "%.f", -- 7 o'clock light
|
||||
[455] = "%.f", -- 9 o'clock light
|
||||
[456] = "%.f", -- 11 o'clock light
|
||||
-- right main panel
|
||||
[461] = "%.f", -- Stores released indicator light (FÄLLD LAST)
|
||||
[462] = "%.f", -- Reserve and transonic indicator (REVAVDR TRANSONIC) red "REV" light
|
||||
-- 1,2,3 Lamps
|
||||
[405] = "%.1f", -- Afterburner zone indicator 0.0=off, >= 0.3=1, >= 0.6=2, >= 0.9=3
|
||||
-- left main panel
|
||||
[463] = "%.f", -- Auto throttle mode indicator light
|
||||
[464] = "%.f", -- Alpha 15.5° button (for AFK)
|
||||
[460] = "%.f", -- Reserve and transonic indicator (REVAVDR TRANSONIC) green "REV" light
|
||||
-- SA06 functionality lamps (Autopilot)
|
||||
[401] = "%.f", -- SPAK Lamp
|
||||
[402] = "%.f", -- ATT Lamp
|
||||
[403] = "%.f" -- HOJD Lamp
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Stick
|
||||
--[8] = "%1d", -- Mastersafe
|
||||
--[3] = "%.4f" -- Stick horizontal
|
||||
--[2] = "%.4f" -- Stick vertical
|
||||
--
|
||||
[12] = "%1d", -- Gear Handle
|
||||
[20] = "%1d", -- Reverser Handle
|
||||
[401] = "%1d", -- SPAK
|
||||
[402] = "%1d", -- Attitude Hold ATT
|
||||
[403] = "%1d", -- Altitude Hold HOJD
|
||||
[464] = "%1d", -- AFK 15 Deg Mode
|
||||
[213] = "%1d", -- Doppler Land/Sea Mode
|
||||
--[0] = "%.3f", -- Altimeter Setting (Axis) {0.0,1.0} in 0.001 steps
|
||||
-- Datapanel
|
||||
[200] = "%1d", -- Datapanel Selector
|
||||
[201] = "%1d", -- Datapanel IN/OUT Switch
|
||||
[290] = "%1d", -- Datapanel Key 0
|
||||
[291] = "%1d", -- Datapanel Key 1
|
||||
[292] = "%1d", -- Datapanel Key 2
|
||||
[293] = "%1d", -- Datapanel Key 3
|
||||
[294] = "%1d", -- Datapanel Key 4
|
||||
[295] = "%1d", -- Datapanel Key 5
|
||||
[296] = "%1d", -- Datapanel Key 6
|
||||
[297] = "%1d", -- Datapanel Key 7
|
||||
[298] = "%1d", -- Datapanel Key 8
|
||||
[299] = "%1d", -- Datapanel Key 9
|
||||
-- NAvigations Panel
|
||||
[271] = "%1d", -- Navigation Selector Button B1
|
||||
[272] = "%1d", -- Navigation Selector Button B2
|
||||
[273] = "%1d", -- Navigation Selector Button B3
|
||||
[274] = "%1d", -- Navigation Selector Button B4
|
||||
[275] = "%1d", -- Navigation Selector Button B5
|
||||
[276] = "%1d", -- Navigation Selector Button B6
|
||||
[277] = "%1d", -- Navigation Selector Button B7
|
||||
[278] = "%1d", -- Navigation Selector Button B8
|
||||
[279] = "%1d", -- Navigation Selector Button B9
|
||||
[280] = "%1d", -- Navigation Selector Button BX
|
||||
[270] = "%1d", -- Navigation Selector Button LS
|
||||
[281] = "%1d", -- Navigation Selector Button L MÅL
|
||||
[282] = "%.1f", -- TILS Channel Selection {0.0,0.1,0.2,...,0.9,1.0}
|
||||
[283] = "%1d", -- RHM switch, Radar Altimeter Power
|
||||
[285] = "%1d", -- TILS Channel Layer Selection 11-20/1-10
|
||||
---
|
||||
[344] = "%1d", -- Warning Panel Light Test
|
||||
[315] = "%1d", -- Indicator System Test
|
||||
[175] = "%1d", -- Max G Reset
|
||||
---
|
||||
[250] = "%1d", -- Anti Collision Lights
|
||||
[251] = "%1d", -- Navigation Lights {-1.0,0.0,1.0}
|
||||
[252] = "%1d", -- Formation Lights
|
||||
[253] = "%1d", -- Position Lights
|
||||
[254] = "%.1f", -- Position Lights Brightness {0.0,0.1,0.2}
|
||||
---
|
||||
[392] = "%.2f", -- Panel Lights (Axis) {0.0,1.0} in 0.05 steps
|
||||
[393] = "%.2f", -- Flood Lights (Axis) {0.0,1.0} in 0.05 steps
|
||||
[394] = "%.2f", -- Instrument Lights (Axis) {0.0,1.0} in 0.05 steps
|
||||
-- Engine panel
|
||||
[206] = "%1d", -- Start System
|
||||
[204] = "%1d", -- Low-pressure Fuel Valve
|
||||
[202] = "%1d", -- High-pressure Fuel Valve
|
||||
[205] = "%1d", -- Ignition System
|
||||
[310] = "%1d", -- Engine De-Ice
|
||||
[312] = "%1d", -- Backup Generator
|
||||
[21] = "%1d", -- Ejection Seat Arm
|
||||
[208] = "%1d", -- Restart
|
||||
[203] = "%1d", -- Main Electric Power
|
||||
[207] = "%1d", -- Generator
|
||||
[209] = "%1d", -- Master Mode Selector
|
||||
[446] = "%1d", -- "Master Caution Reset
|
||||
[323] = "%1d", -- Slav SI
|
||||
[324] = "%1d", -- HÖJD CISI
|
||||
--[0] = "%1d", -- Snabbresning
|
||||
[123] = "%1d", -- Backup ADI Cage
|
||||
[126] = "%.3f", -- Backup Altimeter Setting (Axis) {0.0,1.0} in 0.001 steps
|
||||
[311] = "%1d", -- Pitch Gear Automatic/Landing
|
||||
-- Countermeasure panel
|
||||
[317] = "%.1f", -- Jammer Operation Mode Selector {0.0,0.1,0.2,0.3,0.4}
|
||||
[318] = "%.1f", -- Jammer Band Selector {0.0,0.1,0.2,0.3,0.4}
|
||||
[319] = "%.1f", -- Countermeasure Operation Mode Selector {0.0,0.1,0.2,0.3,0.4}
|
||||
[320] = "%.1f", -- Countermeasure Streak Mode Selector {0.0,0.1}
|
||||
[321] = "%.1f", -- Radarwarning Indication Selector {0.0,0.1,0.2}
|
||||
[322] = "%.1f", -- Countermeasure Chaff/Flares Selector {0.0,0.1,0.2}
|
||||
-- Oxygen
|
||||
[176] = "%1d", -- Oxygen Lever
|
||||
-- Canopy
|
||||
[9] = "%1d", -- Canopy Open/Close {-1.0,0.0,1.0}
|
||||
[210] = "%1d", -- Canopy Jettison
|
||||
---
|
||||
[184] = "%1d", -- Countermeasure Release {-1.0,0.0,1.0}
|
||||
[316] = "%1d", -- Manual Fuel Regulator
|
||||
[212] = "%1d", -- Roll Centering
|
||||
[390] = "%1d", -- Emergency Roll Trim {-1.0,0.0,1.0}
|
||||
[389] = "%1d", -- Emergency Pitch Trim {-1.0,0.0,1.0}
|
||||
[388] = "%1d", -- Emergency Yaw Trim {-1.0,0.0,1.0}
|
||||
[313] = "%1d", -- Manual Afterburner Fuel Regulator
|
||||
[11] = "%1d", -- HUD Reflector Glass Position
|
||||
[180] = "%.2f", -- HUD Brightness Knob (Axis) {0.0,1.0} in 0.02 steps
|
||||
[13] = "%1d", -- AFK Lever
|
||||
[464] = "%1d", -- AFK Mode 3
|
||||
[22] = "%1d", -- Parking Brake
|
||||
-- Radio
|
||||
[171] = "%.1f", -- Radio Manual Frequency Setting Knob Inner Left (Axis) {0.0,1.0} in 0.1 steps
|
||||
[172] = "%.1f", -- Radio Manual Frequency Setting Knob Outer Left (Axis) {0.0,1.0} in 0.1 steps
|
||||
[173] = "%.1f", -- Radio Manual Frequency Setting Knob Inner Right (Axis) {0.0,1.0} in 0.1 steps
|
||||
[174] = "%.1f", -- Radio Manual Frequency Setting Knob Outer Right (Axis) {0.0,1.0} in 0.1 steps
|
||||
[170] = "%1d", -- Radio Manual Frequency Setting Modulation
|
||||
---
|
||||
[372] = "%1d", -- Flight 0
|
||||
[373] = "%1d", -- Flight 1
|
||||
[374] = "%1d", -- Flight 2
|
||||
[375] = "%1d", -- Flight 3
|
||||
[376] = "%1d", -- Flight 4
|
||||
[377] = "%1d", -- Flight 5
|
||||
[378] = "%1d", -- Flight 6
|
||||
[379] = "%1d", -- Flight 7
|
||||
[380] = "%1d", -- Flight 8
|
||||
[381] = "%1d", -- Flight 9
|
||||
[362] = "%1d", -- Channel H
|
||||
[363] = "%1d", -- Special 1
|
||||
[364] = "%1d", -- Special 2
|
||||
[365] = "%1d", -- Special 3
|
||||
[366] = "%1d", -- Minus
|
||||
[367] = "%1d", -- Channel A/G
|
||||
[368] = "%1d", -- Channel B
|
||||
[369] = "%1d", -- Channel C/F
|
||||
[370] = "%1d", -- Channel C2
|
||||
[371] = "%1d", -- Channel D/E
|
||||
---
|
||||
[386] = "%1d", -- FR22 Mode Selector {-1.0,0.0,1.0}
|
||||
[361] = "%1d", -- Base Selector {-1.0,0.0,1.0}
|
||||
[360] = "%1d", -- Group Selector {-1.0,0.0,1.0}
|
||||
---
|
||||
[382] = "%1d", -- Ground Intercom
|
||||
-- Weapons system
|
||||
-- trigger safety bracket
|
||||
[8] = "%1d", -- Trigger Safety Bracket
|
||||
[260] = "%1d", -- Weapon Emergency Release Cover
|
||||
[261] = "%1d", -- Weapon Emergency Release Button
|
||||
[262] = "%1d", -- External Tank Release Cover
|
||||
[263] = "%1d", -- External Tank Release Button
|
||||
[264] = "%.1f", -- Weapon Selector Knob - J/A Valjare {0.0,0.1,0.2,0.3,0.4,0.5}
|
||||
[265] = "%.1f", -- Weapon Interval Selector Mode Knob - Siktningvaljare {0.0,0.1,0.2,...,0.9,1.0}
|
||||
[266] = "%1d", -- Weapon Release Mode Switch - Fallsattomkopplare
|
||||
[267] = "%1d", -- RB-04/RB-15/BK Release Mode Switch - MALVAL/PREP
|
||||
-- IFF panel
|
||||
[308] = "%1d", -- IFF Power
|
||||
[309] = "%.1f", -- IFF Code {0.0,0.1,0.2,...,0.9,1.0}
|
||||
-- CB Circuit breakers
|
||||
[302] = "%1d", -- CB Autopilot SA
|
||||
[303] = "%1d", -- CB High Alpha Warning
|
||||
[304] = "%1d", -- CB Trim System
|
||||
[305] = "%1d", -- CB CI/SI
|
||||
[306] = "%1d", -- CB Ejection System
|
||||
[307] = "%1d", -- CB CB Engine
|
||||
-- Radar
|
||||
[217] = "%.1f", -- Anti Jamming Mode (AS) Selector {0.0,0.1,0.2,...,0.6,0.7}
|
||||
[214] = "%1d", -- Lin/Log Radar Gain Switch
|
||||
[218] = "%1d", -- Pulse Normal/Short Switch
|
||||
[216] = "%1d", -- Passive Recce On/Off Switch
|
||||
[391] = "%.3f", -- Radar Brightness (Axis) {0.0,1.0} in 0.001 steps
|
||||
-- Cabin air
|
||||
-- Var
|
||||
[286] = "%.3f", -- Windscreen De-Ice (Axis) {0.0,1.0} in 0.001 steps
|
||||
[675] = "%.3f", -- Maintenance Testing Mode (Axis) {0.0,1.0} in 0.001 steps
|
||||
[1006] = "%1d", -- Radar/EL Maintenance Test
|
||||
[1200] = "%1d", -- Magnetic Declination Cover
|
||||
[396] = "%.3f", -- Drysuit Ventilation Adjustment (Axis) {0.0,1.0} in 0.001 steps
|
||||
[395] = "%1d", -- Ignition Coils
|
||||
[1206] = "%1d", -- DME Selector
|
||||
[1203] = "%1d", -- IFF/Transponder Power
|
||||
[1204] = "%1d", -- IFF Channel Selector
|
||||
[1205] = "%1d", -- IFF Identification
|
||||
[384] = "%1d", -- Flight Recorder {-1.0,0.0,1.0}
|
||||
[385] = "%.5f", -- Radio Volume (Axis) {0.0,1.0} in 0.00001 steps
|
||||
--??[4200] = "%1d", -- Insert/Remove Data Cartridge
|
||||
[300] = "%1d", -- Rensa Button Cover
|
||||
[301] = "%1d", -- CK37 Rensa (Clear)
|
||||
--
|
||||
[398] = "%1d", -- Cabin Air Valve
|
||||
[493] = "%1d", -- Autopilot Yaw Trim Cover
|
||||
[211] = "%.2f", -- Autopilot yaw correction RENFLYGN (Axis) {0.0,1.0} in 0.01 steps
|
||||
[400] = "%1d", -- Missile Select Button
|
||||
[399] = "%.3f", -- Master Volume / Sidewinder Tone (Axis) {0.0,1.0} in 0.001 steps
|
||||
[1201] = "%.1f" -- Magnetic Declination Correction (Axis) {0.0,1.0} in 0.1 steps
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
local lFR22Radio = GetDevice(31)
|
||||
--ExportScript.Tools.SendData(2500, string.format("%7.3f", lFR22Radio:get_frequency()/1000000)) -- full frequency
|
||||
ExportScript.Tools.SendData(2500, ExportScript.Tools.RoundFreqeuncy(lFR22Radio:get_frequency()/1000000)) -- full frequency
|
||||
local lMHz = string.format("%0.0f", lFR22Radio:get_frequency()/1000000)
|
||||
local lKHz = string.sub(string.format("%0.3f", string.format("%.3f", lFR22Radio:get_frequency()/1000000) - lMHz), 3)
|
||||
ExportScript.Tools.SendData(2501, lMHz) -- slice frequency MHz
|
||||
ExportScript.Tools.SendData(2502, lKHz) -- slice frequency KHz
|
||||
|
||||
-- 1,2,3 Lamps
|
||||
--[405] = "%.1f", -- Afterburner zone indicator 0.0=off, >= 0.3=1, >= 0.6=2, >= 0.9=3
|
||||
local lAfterburnerZoneIndicator = mainPanelDevice:get_argument_value(405)
|
||||
|
||||
if lAfterburnerZoneIndicator >= 0.9 then
|
||||
ExportScript.Tools.SendData(2510, 1) -- Afterburner 1
|
||||
ExportScript.Tools.SendData(2511, 1) -- Afterburner 2
|
||||
ExportScript.Tools.SendData(2512, 1) -- Afterburner 3
|
||||
elseif lAfterburnerZoneIndicator >= 0.6 then
|
||||
ExportScript.Tools.SendData(2510, 1)
|
||||
ExportScript.Tools.SendData(2511, 2)
|
||||
ExportScript.Tools.SendData(2512, 0)
|
||||
elseif lAfterburnerZoneIndicator >= 0.3 then
|
||||
ExportScript.Tools.SendData(2510, 1)
|
||||
ExportScript.Tools.SendData(2511, 0)
|
||||
ExportScript.Tools.SendData(2512, 0)
|
||||
else
|
||||
ExportScript.Tools.SendData(2510, 0)
|
||||
ExportScript.Tools.SendData(2511, 0)
|
||||
ExportScript.Tools.SendData(2512, 0)
|
||||
end
|
||||
|
||||
-- Cockpit Light
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {392, 393, 394})
|
||||
-- Panel Lights, Flood Lights, Instrument Lights
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
local lFR22Radio = GetDevice(31)
|
||||
--ExportScript.Tools.SendData(2500, string.format("%7.3f", lFR22Radio:get_frequency()/1000000)) -- full frequency
|
||||
ExportScript.Tools.SendData(2500, ExportScript.Tools.RoundFreqeuncy(lFR22Radio:get_frequency()/1000000)) -- full frequency
|
||||
local lMHz = string.format("%0.0f", lFR22Radio:get_frequency()/1000000)
|
||||
local lKHz = string.sub(string.format("%0.3f", string.format("%.3f", lFR22Radio:get_frequency()/1000000) - lMHz), 3)
|
||||
ExportScript.Tools.SendData(2501, lMHz) -- slice frequency MHz
|
||||
ExportScript.Tools.SendData(2502, lKHz) -- slice frequency KHz
|
||||
|
||||
-- 1,2,3 Lamps
|
||||
--[405] = "%.1f", -- Afterburner zone indicator 0.0=off, >= 0.3=1, >= 0.6=2, >= 0.9=3
|
||||
local lAfterburnerZoneIndicator = mainPanelDevice:get_argument_value(405)
|
||||
|
||||
if lAfterburnerZoneIndicator >= 0.9 then
|
||||
ExportScript.Tools.SendDataDAC(2510, 1) -- Afterburner 1
|
||||
ExportScript.Tools.SendDataDAC(2511, 1) -- Afterburner 2
|
||||
ExportScript.Tools.SendDataDAC(2512, 1) -- Afterburner 3
|
||||
elseif lAfterburnerZoneIndicator >= 0.6 then
|
||||
ExportScript.Tools.SendDataDAC(2510, 1)
|
||||
ExportScript.Tools.SendDataDAC(2511, 2)
|
||||
ExportScript.Tools.SendDataDAC(2512, 0)
|
||||
elseif lAfterburnerZoneIndicator >= 0.3 then
|
||||
ExportScript.Tools.SendDataDAC(2510, 1)
|
||||
ExportScript.Tools.SendDataDAC(2511, 0)
|
||||
ExportScript.Tools.SendDataDAC(2512, 0)
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC(2510, 0)
|
||||
ExportScript.Tools.SendDataDAC(2511, 0)
|
||||
ExportScript.Tools.SendDataDAC(2512, 0)
|
||||
end
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,334 @@
|
||||
-- Bf-109K-4 Kurfürst
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.Bf109K4 = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
[1] = "%.4f", -- MW50 pressure {0.0, 3.0}kg/cm2 = {0.0, 1.0}
|
||||
[2] = "%.4f", -- Airspeed Gauge {0, 100, 150, 200, 700, 750, 900, 1000} = {0.0, 0.1, 0.15, 0.2, 0.7, 0.75, 0.9, 1.0}
|
||||
-- Artificial horizon Fl_22415
|
||||
[3] = "%.4f", -- turn indicator {-1.0, 1.0}
|
||||
[4] = "%.4f", -- Bank {1.0, -1.0}
|
||||
[5] = "%.4f", -- Pitch {1.0, -1.0}
|
||||
[6] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||
[7] = "%.4f", -- Caged {0.0, 1.0}
|
||||
--Altitude Gauge
|
||||
[8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0}
|
||||
[9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0}
|
||||
[10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0}
|
||||
[11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0}
|
||||
-- AN5730 remote compass
|
||||
[13] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||||
[12] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||||
-- AFN2 blind landing system
|
||||
[14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0}
|
||||
[15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0}
|
||||
[16] = "%.f", -- AFN2_Signal_Lamp {0.0, 1.0}
|
||||
--Dual-Range Pressure Gauge
|
||||
[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0}
|
||||
[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0}
|
||||
[27] = "%.4f", -- Coolant_Temperature {-1, 0, 130} = {-1, 0, 1}
|
||||
[28] = "%.4f", -- Oil_Temperature {-1, 0, 130} = {-1, 0, 1}
|
||||
[29] = "%.4f", -- Engine_RPM {400.0, 3600.0} = {0.0, 1.0}
|
||||
-- propeller pitch indicator, changed 1hour every 6degrees of pitch change
|
||||
[30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0}
|
||||
[31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0}
|
||||
-- Manifold_Pressure
|
||||
[32] = "%.4f", -- Manifold_Pressure {0.6, 1.8} = {0.0, 1.0}
|
||||
--fuel system
|
||||
[33] = "%.4f", -- Fuel_Tank_Fuselage {-1.0, 0.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0} -- Liters = {-1.0, 0.0, 0.07, 0.175, 0.31, 0.52, 0.73, 0.88, 1.0}
|
||||
--oxygen pressure indicator
|
||||
[34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
||||
--[35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
-- Variometer
|
||||
[36] = "%.4f", -- Variometer {-30, -10, -5, 0, 5, 10, 30} = {-0.3, -0.1, -0.05, 0.0, 0.05, 0.1, 0.3}
|
||||
--Weapon gauges
|
||||
[40] = "%.4f", -- MG131_0_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
|
||||
[41] = "%.4f", -- MG131_1_Shell_Counter {0.0, 500.0} = {0.0, 1.0}
|
||||
--[42] = "%.4f", -- MG131_0_Klappanker {0.0, 60.0} = {0.0, 1.0}
|
||||
--[43] = "%.4f", -- MG131_1_Klappanker {0.0, 60.0} = {0.0, 1.0}
|
||||
[44] = "%.f", -- LeftWing_MG151_Control_Lamp {0.0, 1.0}
|
||||
[45] = "%.f", -- RightWing_MG151_Control_Lamp {0.0, 1.0}
|
||||
--REVI_16B_Gunsight
|
||||
[46] = "%.4f", -- BodyState {0.0, 0.15,0.25, 1.0} = {0.0, 0.15,0.25, 1.0}
|
||||
[47] = "%.4f", -- SmokedScreen {0.0, 1.0}
|
||||
[48] = "%.4f", -- SightBrightness {0.0, 1.0}
|
||||
-- Landing Gear Light
|
||||
[56] = "%.f", -- LandingGearRedLight {0.0, 1.0}
|
||||
[57] = "%.f", -- LandingGearGreenLightLeft {0.0, 1.0}
|
||||
[58] = "%.f", -- LandingGearGreenLightRight {0.0, 1.0}
|
||||
-- Fuel_Reserve_Lamp
|
||||
[135] = "%.f" -- Fuel_Reserve_Lamp {0.0, 29.0} = {0.0, 1.0}
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
-- FuseBox Controls - Electrical Switches
|
||||
-- RH Fuse Box Circuit Breakers
|
||||
-- Left Row
|
||||
-- A 100 - Generator Cut-Off Relay
|
||||
[114] = "%1d", -- Generator On {0, 1}
|
||||
[151] = "%1d", -- Generator OFF {0, 1}
|
||||
-- D 100 - Heating CB
|
||||
[115] = "%1d", -- Pitot/Windscreen Heating On {0, 1}
|
||||
[152] = "%1d", -- Pitot/Windscreen Heating OFF {0, 1}
|
||||
-- C 100 - Navigation Lights CB
|
||||
[116] = "%1d", -- Nav. Lights On {0, 1}
|
||||
[153] = "%1d", -- Nav. Lights OFF {0, 1}
|
||||
-- C 101 - Instrument Panel Illumination CB {0, 1}
|
||||
[117] = "%1d", -- UV Lights On {0, 1}
|
||||
[154] = "%1d", -- UV Lights Off {0, 1}
|
||||
-- V 101 - Drop Ordnance & Optional Armament CB
|
||||
[118] = "%1d", -- Wing / Drop Ordnance On {0, 1}
|
||||
[155] = "%1d", -- Wing / Drop Ordnance Off {0, 1}
|
||||
-- V 100 - Systematic & Ignition CB
|
||||
[119] = "%1d", -- Ignition On {0, 1}
|
||||
[156] = "%1d", -- Ignition Off {0, 1}
|
||||
-- Spotlights CB - TODO implement when landing lights rustsatz is available
|
||||
--[] = "%1d", -- Spotlights On {0, 1}
|
||||
--[] = "%1d", -- Spotlights Off {0, 1}
|
||||
-- Right Row
|
||||
-- A 101 - Battery Cut-Off Relay
|
||||
[120] = "%1d", -- Battery On {0, 1}
|
||||
[157] = "%1d", -- Battery Off {0, 1}
|
||||
-- F 135 - Radio CB - Labelled "FuG 16"
|
||||
[121] = "%1d", -- Radio On {0, 1}
|
||||
[158] = "%1d", -- Radio Off {0, 1}
|
||||
-- F 211 - IFF CB - Labelled "FuG 25a"
|
||||
[122] = "%1d", -- IFF On {0, 1}
|
||||
[159] = "%1d", -- IFF Off {0, 1}
|
||||
-- E 101 - Fuel Pump CB - Labelled "Tankpumpe"
|
||||
[123] = "%1d", -- Fuel Pump On {0, 1}
|
||||
[160] = "%1d", -- Fuel Pump Off {0, 1}
|
||||
-- Ignition Controls and Starter and Motor-Related Switches
|
||||
-- Magneto Selector
|
||||
[59] = "%.1f", -- Magnetos (Off, M1, M2, M1+M2) {0.0, 0.1, 0.2, 0.3}
|
||||
-- Starter Handle Cover
|
||||
[51] = "%1d", -- Starter Handle Cover {0, 1}
|
||||
-- Starter Turn Handle
|
||||
[52] = "%1d", -- Starter {0, 1}
|
||||
-- WM-Kommandgerat Toggle
|
||||
[62] = "%1d", -- Governor Automation {0, 1}
|
||||
-- Dashboard and Secondary Switches
|
||||
-- A 104 - Kill Switch
|
||||
[49] = "%1d", -- Kill Switch {0, 1}
|
||||
-- Button T - Gun Camera Trigger
|
||||
[149] = "%1d", -- Button T {0, 1}
|
||||
-- SZKK3 Weapons Control Master Switch
|
||||
[37] = "%1d", -- Weapons Master {0, 1}
|
||||
-- LH SZ 500 Ammo Counter
|
||||
[38] = "%.1f", -- Left Ammo Counter Setter Pinion (axis) {0.0 - 0.0}
|
||||
-- RH SZ 500 Ammo Counter
|
||||
[39] = "%.1f", -- Right Ammo Counter Setter Pinion (axis) {0.0 - 0.0}
|
||||
-- MW50 Operational Toggle
|
||||
[60] = "%1d", -- MW50 Boost {0, 1}
|
||||
-- Wing Cannons Toggle
|
||||
[61] = "%1d", -- Wing Cannons {0, 1}
|
||||
-- MK 108 / Wing Guns Toggle
|
||||
[62] = "%1d", -- MK 108 / R 21 {0, 1}
|
||||
-- R 101 ZSK 244 A Bomb Panel Master Switch
|
||||
-- Operated internally via ZSK 244 A Mode Control
|
||||
-- R 101 ZSK 244 A Mode Selector
|
||||
[64] = "%.1f", -- Bomb Fusing Selector (DIVE (INSTANT), DIVE (DELAYED), OFF, LEVEL (DELAYED), LEVEL (INSTANT)) {0.0, 0.25, 0.5, 0.75, 1.0}
|
||||
-- Illumination Controls
|
||||
-- C 102 LH UV Lamp Rheostat
|
||||
[80] = "%.1f", -- Left UV Lamp Brightness (axis) {0.0 - 0.5}
|
||||
-- C 103 RH UV Lamp Rheostat
|
||||
[82] = "%.1f", -- Right UV Lamp Brightness (axis) {0.0 - 0.5}
|
||||
-- Oxygen Apparatus Controls
|
||||
-- Apparatus Connecting Valve
|
||||
[127] = "%1d", -- Oxygen Operating Valve {0, 1}
|
||||
[126] = "%1d", -- Oxygen Emergency By-Pass {0, 1}
|
||||
-- Main Panel Controls
|
||||
-- Undercarriage Controls
|
||||
-- U/C Plungers Cover
|
||||
[53] = "%1d", -- Undercarriage Controls Cover {0, 1}
|
||||
[54] = "%1d", -- Undercarriage Raise {1.0, 1.0}
|
||||
[55] = "%1d", -- Undercarriage Lower {1.0, 1.0}
|
||||
[63] = "%1d", -- Undercarriage Emergency Release
|
||||
-- Fuel and MW50 Systems Controls
|
||||
-- Fuel Primer Hand Pump
|
||||
[140] = "%1d", -- Fuel Priming Pump {0, 1}
|
||||
-- Schnellstop Lever
|
||||
[88] = "%1d", -- Engine Stop {0, 1}
|
||||
-- Booster Pumps Lever
|
||||
[87] = "%.1f", -- Booster Pumps (Off, P1, P2, P1+P2) {0.0, 0.1, 0.2, 0.3}
|
||||
-- Stoff-Kraftstoff Ventilbatterie Lever
|
||||
[96] = "%1d", -- MW / Fuel {0, 1}
|
||||
-- Fuel Jettison Knob
|
||||
[112] = "%1d", -- "Fuel / MW Jettison {0, 1}
|
||||
-- Coolant System Controls
|
||||
-- Radiator Mode Lever {0, 1}
|
||||
[113] = "%.1f", -- Radiators Mode (Drive Off, Open, Automatic, Close) {0.0, 0.1, 0.2, 0.3}
|
||||
-- LH Radiator Hose Cut-Off Pull Handle
|
||||
[90] = "%1d", -- LH Radiator Cut-Off {0, 1}
|
||||
-- RH Radiator Hose Cut-Off Pull Handle
|
||||
[91] = "%1d", -- RH Radiator Cut-Off {0, 1}
|
||||
-- Navigation Instruments
|
||||
-- Altimeter
|
||||
[11] = "%.2f", -- Altimeter Pressure Set (axis) 1.0 in 0.04 steps
|
||||
-- Artificial Horizon
|
||||
--[7] = "%.2f", -- Horizon Cage (axis) {0.0, 0.511} in 0.04 steps
|
||||
-- Repeater Compass
|
||||
--[12] = "%.2f", -- Course Set (axis) 0.0 in 0.04 steps
|
||||
-- Instruments
|
||||
-- Clock Scale
|
||||
[21] = "%.8f", -- Scale Set (axis) 0.0 in 0.01612434 steps
|
||||
-- Clock Setter Pinion
|
||||
[22] = "%.1f", -- Adjusting Knob (axis) 0.0 in 0.1 steps
|
||||
-- Clock Freeze Lever
|
||||
[23] = "%1d", -- Time Setting Lever {0, 1}
|
||||
-- Clock Stopwatch Button
|
||||
[24] = "%1d", -- Start/Stop/Reset Chronometer
|
||||
-- P 112 Gun Sight Brightness Rheostat {0, 1}
|
||||
--[48] = "%.1f", -- Gun Sight Brightness (axis) 0.5 in 0.1 steps
|
||||
-- P 112 Gun Sight Folding Controls
|
||||
[139] = "%1d", -- Gunsight Fold {0, 1}
|
||||
-- P 112 Gun Sight Smoked Screen Controls
|
||||
--[47] = "%.1f", -- Gunsight Smoked Screen (axis) {0, 1} in 01 steps
|
||||
-- Radio Controls
|
||||
-- FUG16
|
||||
[128] = "%.1f", -- FuG16ZY Preset Selector (1, 2, TR, SQ) {0.0, 0.1, 0.2, 0.3}
|
||||
[129] = "%.2f", -- FuG16 ZY Fine Tune (axis) 0.5 in 0.05 steps
|
||||
[130] = "%.2f", -- FuG16 ZY Volume (axis) 0.0 in 0.04 steps
|
||||
[131] = "%1d", -- "Mic. On/Off {0, 1}
|
||||
-- FUG25
|
||||
[132] = "%.1f", -- FuG25 Mode Selector (1, 2) {0.0, 1.0}
|
||||
[133] = "%1d", -- FuG25 Test {0, 1}
|
||||
-- Left Wall Controls
|
||||
-- Tail Wheel Lock Handle
|
||||
[97] = "%1d", -- Tail Wheel Lock {0, 1}
|
||||
-- Cockpit Open/Close Control
|
||||
[136] = "%1d", -- Canopy (Open/Close) {0, 1}
|
||||
[137] = "%1d", -- Canopy (Open/Close) H {0, 1}
|
||||
[138] = "%1d", -- Canopy (Open/Close) S {0, 1}
|
||||
-- Cockpit Jettison Pull Handle
|
||||
[83] = "%1d", -- Jettison Canopy {0, 1}
|
||||
-- Trim Wheel
|
||||
[141] = "%1d", -- Stabilizer Trim Nose Up {0, 1}
|
||||
[142] = "%1d", -- Stabilizer Trim Nose Down {0, 1}
|
||||
-- Flaps Wheel
|
||||
[143] = "%1d", -- Extend Flaps {0, 1}
|
||||
[144] = "%1d", -- Retract Flaps {0, 1}
|
||||
-- Notwurf / Ordinance Dump
|
||||
[92] = "%1d", -- Ordinance Emergency Release
|
||||
--[98] = "$1d", -- Cockpit Left Vent {0, 1}
|
||||
-- Right Wall Controls
|
||||
-- RH Cockpit Vent
|
||||
--[99] = "%1d", -- Cockpit Right Vent {0, 1}
|
||||
-- Flare Gun Trigger
|
||||
[72] = "%1d", -- Fire Flare Gun
|
||||
-- Engine Controls & Quadrant
|
||||
-- Propellor Control Rocker
|
||||
[85] = "%.1f", -- Decrease RPM {1.0, -1.0}
|
||||
-- Radio Transmit Button
|
||||
[150] = "%1d", -- Microphone On {0, 1}
|
||||
-- E 103 Propellor Automation Switch
|
||||
[89] = "%1d", -- Governor Automation {0, 1}
|
||||
-- Cold Weather Start Valve Handle
|
||||
[86] = "%1d" -- Cold Weather Start {0, 1}
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
ExportScript.Tools.SendData(35, string.format("%0.4f", mainPanelDevice:get_argument_value(35))) -- Oxygen_Flow_Blinker
|
||||
ExportScript.Tools.SendData(42, string.format("%0.4f", mainPanelDevice:get_argument_value(42))) -- MG131_0_Klappanker
|
||||
ExportScript.Tools.SendData(43, string.format("%0.4f", mainPanelDevice:get_argument_value(43))) -- MG131_1_Klappanker
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
local lRADIO = GetDevice(14)
|
||||
--ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy(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
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,117 @@
|
||||
-- Module Name Export
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.<ModuleName> = "1.2.X"
|
||||
|
||||
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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,664 @@
|
||||
-- F-5E-3
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.F5E3 = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Gear System
|
||||
[97] = "%.4f", -- AlterReleaseRods
|
||||
-- Cockpit mechanics
|
||||
[712] = "%.4f", -- CanopyHandle
|
||||
-- WEAPONS ----------------------------------------------------
|
||||
-- CMDS
|
||||
[401] = "%.4f", -- ChaffDrumCounter_10 {0.0, 1.0} {0.0, 10.0}
|
||||
[402] = "%.4f", -- ChaffDrumCounter_1 {0.0, 1.0} {0.0, 10.0}
|
||||
[405] = "%.4f", -- FlareDrumCounter_10 {0.0, 1.0} {0.0, 10.0}
|
||||
[406] = "%.4f", -- FlareDrumCounter_1 {0.0, 1.0} {0.0, 10.0}
|
||||
-- AN/ASG-31 Sight
|
||||
[43] = "%.4f", -- RetDepressionDrum_100 {0.0, 1.0} {0.0, 10.0}
|
||||
[44] = "%.4f", -- RetDepressionDrum_10 {0.0, 1.0} {0.0, 10.0}
|
||||
[45] = "%.4f", -- RetDepressionDrum_1 {0.0, 1.0} {0.0, 10.0}
|
||||
-- Slipball
|
||||
[3] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||
-- Sight Camera
|
||||
[85] = "%.4f", -- MotorRunKnob {1.0, 0.0}
|
||||
-- AN/APQ-159 Radar
|
||||
-- Range scale lights
|
||||
[155] = "%.4f", -- RangeScale_5
|
||||
[156] = "%.4f", -- RangeScale_10
|
||||
[157] = "%.4f", -- RangeScale_20
|
||||
[158] = "%.4f", -- RangeScale_40
|
||||
[159] = "%.f", -- InRangeLight
|
||||
[160] = "%.f", -- FailLight
|
||||
[161] = "%.f", -- LockOnLight
|
||||
[162] = "%.f", -- ExcessGLight
|
||||
[163] = "%.4f", -- ScaleBrightness
|
||||
-- INSTRUMENTS ------------------------------------------------
|
||||
-- Angle-of-attack Indicator
|
||||
[7] = "%.4f", -- AOA_Units {0.0, 1.0} {0.0, 30.0}
|
||||
[704] = "%.f", -- AOA_poweroff_flag
|
||||
-- Accelerometer
|
||||
[6] = "%.4f", -- Accelerometer { 0.0, 0.323, 0.653, 1.0} {-5.0, 0.0, 5.0, 10.0}
|
||||
[902] = "%.4f", -- AccelerometerMin { 0.0, 0.323, 0.653, 1.0} {-5.0, 0.0, 5.0, 10.0}
|
||||
[903] = "%.4f", -- AccelerometerMax { 0.0, 0.323, 0.653, 1.0} {-5.0, 0.0, 5.0, 10.0}
|
||||
-- AirSpeed/Mach Indicator
|
||||
[8] = "%.4f", -- Airspeed {0.0, 0.0435, 0.1, 0.318, 0.3745, 0.397, 0.4495, 0.482, 0.54, 0.553, 0.6145, 0.658, 0.668, 0.761, 0.801, 0.877, 0.909, 0.942, 0.972, 1.0} {0.0, 80.0, 100.0, 170.0, 190.0, 200.0, 230.0, 250.0, 290.0, 300.0, 350.0, 390.0, 400.0, 500.0, 550.0, 650.0, 700.0, 750.0, 800.0, 850.0}
|
||||
[178] = "%.4f", -- MaxAirspeed {0.0, 0.0435, 0.1, 0.318, 0.3745, 0.397, 0.4495, 0.482, 0.54, 0.553, 0.6145, 0.658, 0.668, 0.761, 0.801, 0.877, 0.909, 0.942, 0.972, 1.0} {0.0, 80.0, 100.0, 170.0, 190.0, 200.0, 230.0, 250.0, 290.0, 300.0, 350.0, 390.0, 400.0, 500.0, 550.0, 650.0, 700.0, 750.0, 800.0, 850.0}
|
||||
[177] = "%.f", -- SetAirspeed
|
||||
[179] = "%.4f", -- MachIndicator {1.0, 0.957, 0.92, 0.631, 0.386} {0.0, 0.5, 1.0, 1.8, 2.5}
|
||||
-- Vertical Velocity Indicator
|
||||
[24] = "%.4f", -- Variometer {-1.0, -0.64, -0.5, -0.29, 0.0, 0.29, 0.5, 0.64, 1.0} {-6000.0, -3000.0, -2000.0, -1000.0, 0.0, 1000.0, 2000.0, 3000.0, 6000.0}
|
||||
-- Altimeter AAU-34/A
|
||||
[10] = "%.4f", -- Altimeter_100_footPtr {0.0, 1.0} {0.0, 1000.0}
|
||||
[11] = "%.4f", -- Altimeter_10000_footCount {0.0, 1.0} {0.0, 10.0}
|
||||
[520] = "%.4f", -- Altimeter_1000_footCount {0.0, 1.0} {0.0, 10.0}
|
||||
[521] = "%.4f", -- Altimeter_100_footCount {0.0, 1.0} {0.0, 10.0}
|
||||
[59] = "%.4f", -- pressure_setting_0 {0.0, 1.0} {0.0, 10.0}
|
||||
[58] = "%.4f", -- pressure_setting_1 {0.0, 1.0} {0.0, 10.0}
|
||||
[57] = "%.4f", -- pressure_setting_2 {0.0, 1.0} {0.0, 10.0}
|
||||
[56] = "%.4f", -- pressure_setting_3 {0.0, 1.0} {0.0, 10.0}
|
||||
[9] = "%.4f", -- AAU34_PNEU_flag {0.0, 1.0} {0.0, 0.4}
|
||||
-- Attitude Indicator ARU-20
|
||||
[81] = "%.4f", -- AI_Pitch {-0.507, 0.0, 0.507} {-rad_(90.0), 0.0, rad_(90.0)}
|
||||
[30] = "%.4f", -- AI_Bank {-1.0, 1.0} { 0.0, math.pi * 2.0}
|
||||
[149] = "%.4f", -- AI_OFF_flag
|
||||
-- Horizontal Situation Indicator
|
||||
[32] = "%.4f", -- HSI_CompassCard
|
||||
[139] = "%.4f", -- HSI_BearingPtr
|
||||
[35] = "%.4f", -- HSI_CourseArrow
|
||||
[36] = "%.4f", -- HSI_CourseDevInd {-1.0, 1.0}
|
||||
[144] = "%.4f", -- HSI_HeadingMark
|
||||
[268] = "%.4f", -- HSI_Range_100 {0.0, 1.0} {0.0, 10.0}
|
||||
[269] = "%.4f", -- HSI_Range_10 {0.0, 1.0} {0.0, 10.0}
|
||||
[270] = "%.4f", -- HSI_Range_1 {0.0, 1.0} {0.0, 10.0}
|
||||
[142] = "%.4f", -- HSI_Range_flag
|
||||
[275] = "%.4f", -- HSI_CourseSel_100 {0.0, 1.0} {0.0, 10.0}
|
||||
[276] = "%.4f", -- HSI_CourseSel_10 {0.0, 1.0} {0.0, 10.0}
|
||||
[277] = "%.4f", -- HSI_CourseSel_1 {0.0, 1.0} {0.0, 10.0}
|
||||
[146] = "%.4f", -- HSI_ToFrom
|
||||
[143] = "%.4f", -- HSI_OFF_flag
|
||||
[141] = "%.4f", -- HSI_DevDF_Win
|
||||
-- Standby Attitude Indicator
|
||||
[438] = "%.4f", -- SAI_Pitch {-0.665, -0.581, -0.5, 0.0, 0.5, 0.581, 0.676, 0.735} {-rad_(78.0), -rad_(60.0), -rad_(42.0), 0.0, rad_(42.0), rad_(60.0), rad_(80.0), rad_(92.0)}
|
||||
[439] = "%.4f", -- SAI_Bank {1.0, -1.0} {-math.pi, math.pi}
|
||||
[440] = "%.4f", -- SAI_OFF_flag
|
||||
[443] = "%.4f", -- SAI_knob_arrow {-1.0, 1.0} {0.0, 1.0}
|
||||
-- Clock
|
||||
[19] = "%.4f", -- CLOCK_currtime_hours
|
||||
[18] = "%.4f", -- CLOCK_currtime_minutes
|
||||
[509] = "%.4f", -- CLOCK_elapsed_time_minutes
|
||||
[37] = "%.4f", -- CLOCK_elapsed_time_seconds
|
||||
-- Pitch Trim Indicator
|
||||
[52] = "%.4f", -- Pitch_Trim {1.0, 0.0, -0.1} {-10.0, 0.0, 1.0}
|
||||
-- Flap Indicator
|
||||
[51] = "%.4f", -- Flap_Indicator {0.0, 0.4} {0.0, 4.0}
|
||||
-- Hydraulic Pressure Indicators
|
||||
[109] = "%.4f", -- Utility_Pressure {0.0, 1.0} {0.0, 4000.0}
|
||||
[110] = "%.4f", -- Flight_Pressure {0.0, 1.0} {0.0, 4000.0}
|
||||
-- Engine Tachometers
|
||||
[16] = "%.4f", -- Tachometer_Left {0.008, 0.475, 0.84, 0.94, 1.0} {0.0, 50.0, 90.0, 100.0, 107.0}
|
||||
[425] = "%.4f", -- Tachometer_percent_Left {0.0, 1.0} {0.0, 10.0}
|
||||
[17] = "%.4f", -- Tachometer_Right {0.008, 0.475, 0.84, 0.94, 1.0} {0.0, 50.0, 90.0, 100.0, 107.0}
|
||||
[426] = "%.4f", -- Tachometer_percent_Right {0.0, 1.0} {0.0, 10.0}
|
||||
-- Exhaust Gas Temperature Indicators
|
||||
[12] = "%.4f", -- EGT_Left {0.0, 0.03, 0.1, 0.274, 0.78, 1.0} {0.0, 140.0, 200.0, 500.0, 800.0, 1200.0}
|
||||
[14] = "%.4f", -- EGT_Right {0.0, 0.03, 0.1, 0.274, 0.78, 1.0} {0.0, 140.0, 200.0, 500.0, 800.0, 1200.0}
|
||||
-- Aux Intake Doors Indicator
|
||||
[111] = "%.4f", -- AuxIntakeDoors {0.0, 0.2} {0.0, 2.0}
|
||||
-- Oil Pressure Indicator (Dual)
|
||||
[112] = "%.4f", -- OilPressure_Left {0.0, 1.0} {0.0, 100.0}
|
||||
[113] = "%.4f", -- OilPressure_Right {0.0, 1.0} {0.0, 100.0}
|
||||
-- Nozzle Position Indicators
|
||||
[107] = "%.4f", -- NozzlePos_Left {0.0, 1.0} {0.0, 100.0}
|
||||
[108] = "%.4f", -- NozzlePos_Right {0.0, 1.0} {0.0, 100.0}
|
||||
-- Cabin Pressure Altimeter
|
||||
[114] = "%.4f", -- CabinPressure {0.0, 1.0} {0.0, 50.0}
|
||||
-- Fuel Flow Indicator (Dual)
|
||||
[525] = "%.4f", -- FuelFlow_Left {0.0, 0.67, 0.75, 0.83, 1.0} {0.0, 4000.0, 7000.0, 10000.0, 15000.0}
|
||||
[526] = "%.4f", -- FuelFlow_Right {0.0, 0.67, 0.75, 0.83, 1.0} {0.0, 4000.0, 7000.0, 10000.0, 15000.0}
|
||||
-- Fuel Quantity Indicator (Dual)
|
||||
[22] = "%.4f", -- FuelQuantity_Left {0.0, 1.0} {0.0, 2500.0}
|
||||
[23] = "%.4f", -- FuelQuantity_Right {0.0, 1.0} {0.0, 2500.0}
|
||||
-- Oxygen Quantity Indicator
|
||||
[390] = "%.4f", -- OxygenQuantity {0.0, 1.0} {0.0, 5.0}
|
||||
-- Oxygen Flow Pressure Indicator
|
||||
[604] = "%.4f", -- FlowPressure {0.0, 0.5, 1.0} {0.0, 100.0, 500.0}
|
||||
-- Oxygen Flow Indicator
|
||||
[600] = "%.4f", -- FlowBlinker
|
||||
-- RADIO ------------------------------------------------------
|
||||
-- UHF Radio AN/ARC-164
|
||||
[326] = "%.2f", -- UHFRadioChannel
|
||||
[302] = "%.1f", -- UHFRadio100MHz
|
||||
[303] = "%.1f", -- UHFRadio10MHz {1.0, 0.0} {0.0, 1.0}
|
||||
[304] = "%.1f", -- UHFRadio1MHz {1.0, 0.0} {0.0, 1.0}
|
||||
[305] = "%.1f", -- UHFRadio01MHz {1.0, 0.0} {0.0, 1.0}
|
||||
[306] = "%.1f", -- UHFRadio0025MHz {1.0, 0.0} {0.0, 1.0}
|
||||
-- IFF/SIF APX72
|
||||
[197] = "%.4f", -- IFF_Code4Sw_Pull
|
||||
[198] = "%.4f", -- IFF_MasterSw_Pull
|
||||
-- TACAN
|
||||
[263] = "%.4f", -- TACAN_window_wheel.hundreds {0.0, 1.0} {0.0, 10.0}
|
||||
[264] = "%.4f", -- TACAN_window_wheel.tens {0.0, 1.0} {0.0, 10.0}
|
||||
[265] = "%.4f", -- TACAN_window_wheel.ones {0.0, 1.0} {0.0, 10.0}
|
||||
[266] = "%.4f", -- XYwheel
|
||||
[260] = "%.f", -- TACAN_test_light
|
||||
-- LAMPS
|
||||
-- Engine Fire Lights
|
||||
[167] = "%.f", -- lamp_LeftFire
|
||||
[168] = "%.f", -- lamp_RightFire
|
||||
-- AOA Indexer Lights
|
||||
[48] = "%.f", -- lamp_AOA_Red
|
||||
[49] = "%.f", -- lamp_AOA_Green
|
||||
[50] = "%.f", -- lamp_AOA_Yellow
|
||||
-- Landing Gear Lights
|
||||
[96] = "%.f", -- lamp_GearWarning
|
||||
[54] = "%.f", -- lamp_GearNose
|
||||
[53] = "%.f", -- lamp_GearLeft
|
||||
[55] = "%.f", -- lamp_GearRight
|
||||
-- Hook Light
|
||||
[90] = "%.f", -- lamp_Hook
|
||||
-- Caution Lights panel
|
||||
[530] = "%.f", -- lamp_LeftGenerator
|
||||
[531] = "%.f", -- lamp_Canopy
|
||||
[532] = "%.f", -- lamp_RightGenerator
|
||||
[533] = "%.f", -- lamp_UtilityHyd
|
||||
[534] = "%.f", -- lamp_Spare1
|
||||
[535] = "%.f", -- lamp_FlightHyd
|
||||
[536] = "%.f", -- lamp_ExtTanksEmpty
|
||||
[537] = "%.f", -- lamp_IFF
|
||||
[538] = "%.f", -- lamp_Oxygen
|
||||
[539] = "%.f", -- lamp_LeftFuelLow
|
||||
[540] = "%.f", -- lamp_EngineAntiIce
|
||||
[541] = "%.f", -- lamp_RightFuelLow
|
||||
[542] = "%.f", -- lamp_LeftFuelPress
|
||||
[543] = "%.f", -- lamp_INS
|
||||
[544] = "%.f", -- lamp_RightFuelPress
|
||||
[545] = "%.f", -- lamp_AOA_Flaps
|
||||
[546] = "%.f", -- lamp_AirDataComputer
|
||||
[547] = "%.f", -- lamp_DirGyro
|
||||
[548] = "%.f", -- lamp_Spare2
|
||||
[549] = "%.f", -- lamp_DC_Overload
|
||||
[550] = "%.f", -- lamp_Spare3
|
||||
-- Master Caution Light
|
||||
[169] = "%.f", -- lamp_MasterCaution
|
||||
--IFF Panel lamps
|
||||
[216] = "%.f", -- IFF_reply_lamp
|
||||
[218] = "%.f", -- IFF_test_lamp
|
||||
-- Internal Lights
|
||||
[801] = "%.f", -- light_Flight
|
||||
[802] = "%.f", -- light_Engine
|
||||
[803] = "%.f", -- light_Console
|
||||
[804] = "%.f", -- light_Compass
|
||||
[805] = "%.f", -- light_Flood
|
||||
[806] = "%.f", -- light_Sight
|
||||
[807] = "%.f", -- light_Armt
|
||||
[810] = "%.f", -- light_Tstorm
|
||||
-- RWR button lights
|
||||
[576] = "%.f", -- rwr_Power
|
||||
[572] = "%.f", -- rwr_Ship_unkn
|
||||
[571] = "%.f", -- rwr_Ship_U
|
||||
[568] = "%.f", -- rwr_Sys_On
|
||||
[569] = "%.f", -- rwr_Sys
|
||||
[565] = "%.f", -- rwr_Sep_Up
|
||||
[566] = "%.f", -- rwr_Sep_Down
|
||||
[563] = "%.f", -- rwr_Alt
|
||||
[562] = "%.f", -- rwr_Alt_Low
|
||||
[557] = "%.f", -- rwr_Hand_Up
|
||||
[558] = "%.f", -- rwr_Hand_H
|
||||
[555] = "%.f", -- rwr_Search
|
||||
[553] = "%.f", -- rwr_Mode_Open
|
||||
[552] = "%.f", -- rwr_Mode_Pri
|
||||
-- Brightness regulation
|
||||
[808] = "%.f", -- brtRadarScale
|
||||
[815] = "%.f", -- brtRwrLights
|
||||
[816] = "%.f", -- brtFireLights
|
||||
[817] = "%.f", -- brtMainLights
|
||||
[818] = "%.f", -- brtIFFLights
|
||||
[819] = "%.f" -- brtRadarLights
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Control System
|
||||
[323] = "%1d", -- Yaw Damper Switch, YAW/OFF
|
||||
[322] = "%1d", -- Pitch Damper Switch, PITCH/OFF
|
||||
[324] = "%.4f", -- Rudder Trim Knob (Axis) {-1.0, 1.0} in 0.15 Steps
|
||||
[116] = "%1d", -- Flaps Lever, EMER UP/THUMB SW/FULL {-1.0, 0.0, 1.0}
|
||||
[132] = "%1d", -- Pitch Damper Cutoff Switch - Push to cutoff
|
||||
[101] = "%1d", -- Speed Brake Switch, OUT/OFF/IN {-1.0, 0.0, 1.0}
|
||||
[115] = "%1d", -- Auto Flap System Thumb Switch, UP/FIXED/AUTO {-1.0, 0.0, 1.0}
|
||||
--[125] = "%1d", -- Trimmer Switch, PUSH(DESCEND) {0.0, 1.0}
|
||||
--[125] = "%1d", -- Trimmer Switch, PULL(CLIMB) {-1.0, 0.0}
|
||||
--[126] = "%1d", -- Trimmer Switch, LEFT WING DOWN {0.0, 1.0}
|
||||
--[126] = "%1d", -- Trimmer Switch, RIGHT WING DOWN {-1.0, 0.0}
|
||||
[125] = "%1d", -- Trimmer Switch, PUSH(DESCEND)/PULL(CLIMB) {1.0, 0.0, -1.0}
|
||||
[126] = "%1d", -- Trimmer Switch, LEFT WING DOWN/RIGHT WING DOWN {1.0, 0.0, -1.0}
|
||||
[278] = "%1d", -- Rudder Pedal Adjust T-Handle, PULL/STOW
|
||||
-- Electric system
|
||||
[387] = "%1d", -- attery Switch, BATT/OFF
|
||||
[388] = "%1d", -- Left Generator Switch, L GEN/OFF/RESET {-1.0, 0.0, 1.0}
|
||||
[389] = "%1d", -- Right Generator Switch, R GEN/OFF/RESET {-1.0, 0.0, 1.0}
|
||||
[375] = "%1d", -- Pitot Anti-Ice Switch, PITOT/OFF
|
||||
[230] = "%1d", -- Fuel & Oxygen Switch, GAGE TEST/OFF/QTY CHECK {-1.0, 0.0, 1.0}
|
||||
-- Fuel System
|
||||
[360] = "%1d", -- Left Fuel Shutoff Switch, OPEN/CLOSED
|
||||
[362] = "%1d", -- Right Fuel Shutoff Switch, OPEN/CLOSED
|
||||
[377] = "%1d", -- Ext Fuel Cl Switch, ON/OFF
|
||||
[378] = "%1d", -- Ext Fuel Pylons Switch, ON/OFF
|
||||
[380] = "%1d", -- Left Boost Pump Switch, ON/OFF
|
||||
[381] = "%1d", -- Crossfeed Switch, OPEN/CLOSED
|
||||
[382] = "%1d", -- Right Boost Pump Switch, ON/OFF
|
||||
[383] = "%1d", -- Autobalance Switch, LEFT/NEUT/RIGHT {-1.0, 0.0, 1.0}
|
||||
-- Engines
|
||||
[357] = "%1d", -- Left Engine Start Button - Push to start
|
||||
[358] = "%1d", -- Right Engine Start Button - Push to start
|
||||
[376] = "%1d", -- Engine Anti-Ice Switch, ENGINE/OFF {1.0, -1.0}
|
||||
-- Gear System
|
||||
[83] = "%1d", -- Landing Gear Lever, LG UP/LG DOWN
|
||||
[95] = "%1d", -- Landing Gear Alternate Release Handle, Pull and Hold
|
||||
[98] = "%1d", -- Gear Alternate Release Reset Control, OFF/RESET
|
||||
[88] = "%1d", -- Landing Gear Downlock Override Button - Push and hold to override locking solenoid
|
||||
[87] = "%1d", -- Landing Gear And Flap Warning Silence Button
|
||||
[250] = "%1d", -- Nose Strut Switch, EXTEND/RETRACT {1.0, -1.0}
|
||||
[131] = "%1d", -- Nosewheel Steering Button - Press and Hold to engage nosewheel control
|
||||
[92] = "%1d", -- Left Landing Gear Lamp - Press to test(LMB)
|
||||
[93] = "%1d", -- Nose Landing Gear Lamp - Press to test(LMB)
|
||||
[94] = "%1d", -- Right Landing Gear Lamp - Press to test(LMB)
|
||||
[89] = "%1d", -- Arresting Hook Button
|
||||
-- Oxygen System
|
||||
[603] = "%1d", -- Oxygen Supply Lever, ON/OFF {1.0, -1.0}
|
||||
[602] = "%1d", -- Diluter Lever
|
||||
[601] = "%1d", -- Emergency Lever, EMERGENCY/NORMAL/TEST MASK {-1.0, 0.0, 1.0}
|
||||
-- EC System
|
||||
[371] = "%1d", -- Cabin Press Switch, DEFOG ONLY/NORMAL/RAM DUMP {0.0, 0.5, 1.0}
|
||||
[372] = "%1d", -- Cabin Temp Switch, AUTO/CENTER/MAN COLD/MAN HOT {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6}
|
||||
[373] = "%.2f", -- Cabin Temp Knob (Axis) {-1.0, 1.0} in 0.15 Steps
|
||||
[374] = "%.2f", -- Canopy Defog Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[386] = "%.2f", -- Cockpit Air Inlet (Horizontal) (Axis) {-1.0, 1.0} in 0.1 Steps
|
||||
[385] = "%.2f", -- Cockpit Air Inlet (Vertical) (Axis) {-1.0, 1.0} in 0.1 Steps
|
||||
-- Cockpit Mechanics
|
||||
--[0] = "%1d", -- Canopy Handle, OPEN/CLOSE
|
||||
[772] = "%1d", -- Seat Adjust Switch, DOWN/NEUTRAL/UP {-1.0, 0.0, 1.0}
|
||||
[384] = "%1d", -- Canopy Jettison T-Handle, PULL/PUSH
|
||||
[91] = "%.1f", -- Drag Chute T-Handle, PULL/PUSH {0.1, -0.1}
|
||||
-- External Lights
|
||||
[227] = "%.2f", -- Navigation Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[228] = "%.2d", -- Formation Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[229] = "%1d", -- Beacon Switch, BEACON/OFF
|
||||
[353] = "%1d", -- Landing & Taxi Light Switch, ON/OFF
|
||||
-- Internal Lights
|
||||
[46] = "%1d", -- AN/ASG-31 Sight Panel Light Button, ON/OFF
|
||||
[613] = "%1d", -- Magnetic Compass Light Switch, LIGHT/OFF
|
||||
[221] = "%.2f", -- Flood Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[222] = "%.2f", -- Flight Instruments Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[223] = "%.2f", -- Engine Instruments Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[224] = "%.2f", -- Console Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[363] = "%.2f", -- Armament Panel Lights Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[172] = "%1d", -- Master Caution Button - Push to reset
|
||||
[226] = "%1d", -- Warning Test Switch, Press to test
|
||||
[225] = "%1d", -- Bright/Dim Switch, BRT/NEUT/DIM {-1.0, 0.0, 1.0}
|
||||
-- Countermeasures Dispensing System
|
||||
[400] = "%1d", -- Chaff Mode Selector, OFF/SINGLE/PRGM/MULT {0.0, 0.1, 0.2, 0.3}
|
||||
[404] = "%1d", -- Flare Mode Selector, OFF/SINGLE/PRGM {0.0, 0.1, 0.2}
|
||||
[409] = "%1d", -- Flare Jettison Switch, OFF/UP
|
||||
[403] = "%1d", -- Chaff Counter Reset Button - Push to reset
|
||||
[407] = "%1d", -- Flare Counter Reset Button - Push to reset
|
||||
[117] = "%1d", -- Flare-Chaff Button - Push to dispense
|
||||
-- IFF
|
||||
[199] = "%1d", -- IFF MODE 4 CODE Selector, ZERO(use MW to pull switch)/B/A/HOLD
|
||||
[197] = "%1d", -- IFF MODE 4 CODE Selector, ZERO(use MW to pull switch)/B/A/HOLD
|
||||
[200] = "%1d", -- IFF MASTER Control Selector, EMER(use MW to pull switch)/NORM/LOW/STBY/OFF
|
||||
[198] = "%1d", -- IFF MASTER Control Selector, EMER(use MW to pull switch)/NORM/LOW/STBY/OFF
|
||||
[201] = "%1d", -- IFF MODE 4 Monitor Control Switch, AUDIO/OUT/LIGHT {-1.0, 0.0, 1.0}
|
||||
[202] = "%1d", -- IFF Mode Select/TEST Switch, M-1 /ON/OUT {-1.0, 0.0, 1.0}
|
||||
[203] = "%1d", -- IFF Mode Select/TEST Switch, M-2 /ON/OUT {-1.0, 0.0, 1.0}
|
||||
[204] = "%1d", -- IFF Mode Select/TEST Switch, M-3/A /ON/OUT {-1.0, 0.0, 1.0}
|
||||
[205] = "%1d", -- IFF Mode Select/TEST Switch, M-C /ON/OUT {-1.0, 0.0, 1.0}
|
||||
[206] = "%1d", -- IFF RAD TEST/MON Switch, RAD TEST/OUT/MON {-1.0, 0.0, 1.0}
|
||||
[207] = "%1d", -- IFF Identification of Position (IP) Switch, IDENT/OUT/MIC {-1.0, 0.0, 1.0}
|
||||
[208] = "%1d", -- IFF MODE 4 Control Switch, ON/OUT
|
||||
[209] = "%.1f", -- IFF MODE 1 Code Selector Wheel 1 {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
|
||||
[210] = "%.1f", -- IFF MODE 1 Code Selector Wheel 2 {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
|
||||
[211] = "%.1f", -- IFF MODE 3/A Code Selector Wheel 1 {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
|
||||
[212] = "%.1f", -- IFF MODE 3/A Code Selector Wheel 2 {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
|
||||
[213] = "%.1f", -- IFF MODE 3/A Code Selector Wheel 3 {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
|
||||
[214] = "%.1f", -- IFF MODE 3/A Code Selector Wheel 4 {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
|
||||
[217] = "%1d", -- MODE 4 REPLY Light - Press to test(LMB)
|
||||
[215] = "%1d", -- Radiation TEST and Monitor Light - Press to test(LMB)
|
||||
-- Jettison System
|
||||
[365] = "%1d", -- Emergency All Jettison Button - Push to jettison
|
||||
[367] = "%1d", -- Select Jettison Switch, SELECT POSITION/OFF/ALL PYLONS {-1.0, 0.0, 1.0}
|
||||
[366] = "%1d", -- Select Jettison Button - Push to jettison
|
||||
-- Weapons Control
|
||||
[346] = "%1d", -- Armament Position Selector Switch - LEFT WINGTIP, ON/OFF
|
||||
[347] = "%1d", -- Armament Position Selector Switch - LEFT OUTBD, ON/OFF
|
||||
[348] = "%1d", -- Armament Position Selector Switch - LEFT INBD, ON/OFF
|
||||
[349] = "%1d", -- Armament Position Selector Switch - CENTERLINE, ON/OFF
|
||||
[350] = "%1d", -- Armament Position Selector Switch - RIGHT INBD, ON/OFF
|
||||
[351] = "%1d", -- Armament Position Selector Switch - RIGHT OUTBD, ON/OFF
|
||||
[352] = "%1d", -- Armament Position Selector Switch - RIGHT WINGTIP, ON/OFF
|
||||
[340] = "%1d", -- Interval Switch [sec], .06/.10/.14 {-1.0, 0.0, 1.0}
|
||||
[341] = "%1d", -- Bombs Arm Switch, SAFE/TAIL/NOSE & TAIL/NOSE {0.0, 0.1, 0.2, 0.3}
|
||||
[343] = "%1d", -- Guns, Missile and Camera Switch, GUNS MSL & CAMR/OFF/CAMR ONLY {-1.0, 0.0, 1.0}
|
||||
[344] = "%.1f", -- External Stores Selector, RIPL/BOMB/SAFE/RKT DISP {0.0,0.1,0.2,0.3}
|
||||
[345] = "%.2f", -- Missile Volume Knob - Rotate to adjust volume (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[128] = "%1d", -- Weapon Release Button - Press to release (Stick)
|
||||
[137] = "%1d", -- Missile Uncage Switch - Press and hold to uncage missile seeker head
|
||||
-- Trigger
|
||||
[127] = "%1d", -- Trigger Button, FIRST DETENT(LMB) {0.0, 0.5}
|
||||
[127] = "%1d", -- Trigger Button, SECOND DETENT(RMB) {0.0, 1.0}
|
||||
-- AHRS
|
||||
[166] = "%1d", -- Fast Erect Button - Push to erect
|
||||
[220] = "%1d", -- Compass Switch, DIR GYRO/MAG/FAST SLAVE
|
||||
[273] = "%.1f", -- Nav Mode Selector Switch, DF/TACAN {0.1,-0.1}
|
||||
-- AN/APQ-159 Radar Control Panel
|
||||
[65] = "%.2f", -- AN/APQ-159 Radar Scale Knob - Rotate to adjust scale brightness (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[321] = "%.2f", -- AN/APQ-159 Radar Elevation Antenna Tilt Control Knob - Rotate to adjust antenna elevation (Axis) {-1.0, 1.0} in 0.15 Steps
|
||||
[315] = "%.1f", -- AN/APQ-159 Radar Range Selector Switch [nm], 5/10/20/40 {0.0, 0.1, 0.2, 0.3}
|
||||
[316] = "%.1f", -- AN/APQ-159 Radar Mode Selector Switch, OFF/STBY/OPER/TEST {0.0, 0.1, 0.2, 0.3}
|
||||
[317] = "%1d", -- AN/APQ-159 Radar Acquisition Button
|
||||
[70] = "%.2f", -- AN/APQ-159 Radar Bright Knob - Rotate to adjust brightness (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[69] = "%.2f", -- AN/APQ-159 Radar Persistence Knob - Rotate to adjust persistence (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[68] = "%.2f", -- AN/APQ-159 Radar Video Knob - Rotate to adjust video intensity (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[67] = "%.2f", -- AN/APQ-159 Radar Cursor Knob - Rotate to adjust indication brightness (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[66] = "%.2f", -- AN/APQ-159 Radar Pitch Knob - Rotate to adjust horizon bar (Axis) {-0.75, 0.75} in 0.1 Steps
|
||||
-- AN/ASG-31 Sight
|
||||
[40] = "%.1f", -- AN/ASG-31 Sight Mode Selector, OFF/MSL/A/A1 GUNS/A/A2 GUNS/MAN {0.0, 0.1, 0.2, 0.3, 0.4}
|
||||
[42] = "%.2f", -- AN/ASG-31 Sight Reticle Depression Knob - Rotate to adjust manual mode depression angle (Axis) {0.0, 1.0} in 0.10 Steps
|
||||
[41] = "%.2f", -- AN/ASG-31 Sight Reticle Intensity Knob - Rotate to adjust brightness (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[136] = "%1d", -- AN/ASG-31 Sight Cage Switch - Press and hold to cage
|
||||
-- RWR-IC
|
||||
[551] = "%1d", -- RWR Indicator Control MODE Button
|
||||
[554] = "%1d", -- RWR Indicator Control SEARCH Button
|
||||
[556] = "%1d", -- RWR Indicator Control HANDOFF Button
|
||||
[559] = "%1d", -- RWR Indicator Control LAUNCH Button
|
||||
[561] = "%1d", -- RWR Indicator Control ALTITUDE Button
|
||||
[564] = "%1d", -- RWR Indicator Control T Button
|
||||
[567] = "%1d", -- RWR Indicator Control SYS TEST Button
|
||||
[570] = "%1d", -- RWR Indicator Control UNKNOWN SHIP Button
|
||||
[573] = "%1d", -- RWR Indicator Control ACT/PWR Button
|
||||
[575] = "%1d", -- RWR Indicator Control POWER Button {1.0,0.0,-1.0}
|
||||
[577] = "%.1f", -- RWR Indicator Control AUDIO Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[578] = "%.1f", -- RWR Indicator Control DIM Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- AN/ALR-87 RWR
|
||||
[140] = "%.2f", -- Adjust Display Brightness (Axis) {0.15, 0.85} in 0.1 Steps
|
||||
-- Instruments --------------------------
|
||||
-- Accelerometer
|
||||
[904] = "%1d", -- Accelerometer - Push to set
|
||||
-- AirSpeed/Mach Indicator
|
||||
[180] = "%.2f", -- Index Setting Pointer Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
-- Altimeter AAU-34/A
|
||||
[62] = "%.2f", -- Zero Setting Knob (Axis) {0.0, 1.0} in 0.04 Steps
|
||||
[60] = "%1d", -- Altimeter Mode Control Lever, ELECT(rical)/PNEU(matic) {-1.0, 0.0, 1.0}
|
||||
-- Attitude Indicator ARU-20
|
||||
[150] = "%.3f", -- AI Pitch Trim Knob (Axis) {0.0, 1.0} in 0.083 Steps
|
||||
-- Horizontal Situation Indicator
|
||||
[272] = "%.5f", -- HSI Course Set Knob (Axis) {0.0, 1.0} in 0.05818 Steps
|
||||
[271] = "%.5f", -- HSI Heading Set Knob (Axis) {0.0, 1.0} in 0.05818 Steps
|
||||
-- Standby Attitude Indicator
|
||||
[441] = "%1d", -- Cage/Pitch Trim (Button)
|
||||
[442] = "%.1f", -- Cage/Pitch Trim Knob (Axis) {0.0, 1.0} in 0.5 Steps
|
||||
-- Clock
|
||||
[511] = "%1d", -- ABU-11 Clock Winding and Setting knob (Button)
|
||||
[510] = "%1d", -- ABU-11 Clock Winding and Setting Knob (Axis) {0.0, 1.0} in 0.6 Steps
|
||||
[512] = "%1d", -- ABU-11 Clock Elapsed Time Knob
|
||||
-- Electric system - CB Front Panel
|
||||
[280] = "%1d", -- CB WPN PWR LEFT INBD, ON/OFF {1.0, 0.0}
|
||||
[281] = "%1d", -- CB WPN PWR CENTER LINE, ON/OFF {1.0, 0.0}
|
||||
[282] = "%1d", -- CB WPN PWR RIGHT INBD, ON/OFF {1.0, 0.0}
|
||||
[283] = "%1d", -- CB WPN PWR LEFT OUTBD, ON/OFF {1.0, 0.0}
|
||||
[284] = "%1d", -- CB WPN ARMING, ON/OFF {1.0, 0.0}
|
||||
[285] = "%1d", -- CB WPN PWR RIGHT OUTBD, ON/OFF {1.0, 0.0}
|
||||
[286] = "%1d", -- CB JETTISON CONTROL, ON/OFF {1.0, 0.0}
|
||||
[287] = "%1d", -- CB WPN RELEASE, ON/OFF {1.0, 0.0}
|
||||
[288] = "%1d", -- CB WPN MODE SEL & AIM-9-INTLK, ON/OFF {1.0, 0.0}
|
||||
[289] = "%1d", -- CB EMERGENCY ALL JETTISON, ON/OFF {1.0, 0.0}
|
||||
[290] = "%1d", -- CB LEFT AIM-9 CONT, ON/OFF {1.0, 0.0}
|
||||
[291] = "%1d", -- CB RIGHT AIM-9 CONT, ON/OFF {1.0, 0.0}
|
||||
-- Electric system - CB Left Panel
|
||||
[450] = "%1d", -- CB LEFT AIM-9 POWER, ON/OFF {1.0, 0.0}
|
||||
[451] = "%1d", -- CB LEFT GUN FIRING, ON/OFF {1.0, 0.0}
|
||||
[453] = "%1d", -- CB 26 VOLT AC POWER, ON/OFF {1.0, 0.0}
|
||||
[454] = "%1d", -- CB ATTD & HDG REF SYS A, ON/OFF {1.0, 0.0}
|
||||
[455] = "%1d", -- CB CENTRAL AIR DATA COMPUTER, ON/OFF {1.0, 0.0}
|
||||
[456] = "%1d", -- CB ENG IGN L ENG INST & HYD IND, ON/OFF {1.0, 0.0}
|
||||
[457] = "%1d", -- CB RIGHT AIM-9 POWER, ON/OFF {1.0, 0.0}
|
||||
[458] = "%1d", -- CB RIGHT GUN FIRING, ON/OFF {1.0, 0.0}
|
||||
[460] = "%1d", -- CB TRIM CONTROL, ON/OFF {1.0, 0.0}
|
||||
[461] = "%1d", -- CB ATTD & HDG REF SYS B, ON/OFF {1.0, 0.0}
|
||||
[462] = "%1d", -- CB TOTAL TEMP PROBE HTR, ON/OFF {1.0, 0.0}
|
||||
[463] = "%1d", -- CB L ENG AUX DOOR, ON/OFF {1.0, 0.0}
|
||||
[464] = "%1d", -- CB CABIN COND, ON/OFF {1.0, 0.0}
|
||||
[467] = "%1d", -- CB FUEL QTY PRIMARY, ON/OFF {1.0, 0.0}
|
||||
[468] = "%1d", -- CB ATTD & HDG REF SYS C, ON/OFF {1.0, 0.0}
|
||||
[469] = "%1d", -- CB TACAN, ON/OFF {1.0, 0.0}
|
||||
[471] = "%1d", -- CB PYLON TANK FUEL CONT, ON/OFF {1.0, 0.0}
|
||||
[472] = "%1d", -- CB L BOOST CL & TIP TANK FUEL CONT, ON/OFF {1.0, 0.0}
|
||||
[473] = "%1d", -- CB IGNITION INVERTER POWER, ON/OFF {1.0, 0.0}
|
||||
[474] = "%1d", -- CB L ENG START & AB CONT, ON/OFF {1.0, 0.0}
|
||||
[475] = "%1d", -- CB R ENG START & AB CONT, ON/OFF {1.0, 0.0}
|
||||
[476] = "%1d", -- CB UHF COMMAND RADIO, ON/OFF {1.0, 0.0}
|
||||
[477] = "%1d", -- CB LEFT LE FLAP CONT, ON/OFF {1.0, 0.0}
|
||||
[478] = "%1d", -- CB RIGHT LE FLAP CONT, ON/OFF {1.0, 0.0}
|
||||
[479] = "%1d", -- CB LEFT TE FLAP CONT, ON/OFF {1.0, 0.0}
|
||||
[480] = "%1d", -- CB RIGHT TE FLAP CONT & IND, ON/OFF {1.0, 0.0}
|
||||
-- Electric system - CB Right Panel
|
||||
[231] = "%1d", -- CB PITOT HEATER, ON/OFF {1.0, 0.0}
|
||||
[233] = "%1d", -- CB R OIL & HYD IND FUEL QTY SEL, ON/OFF {1.0, 0.0}
|
||||
[234] = "%1d", -- CB CABIN AIR VALVES, ON/OFF {1.0, 0.0}
|
||||
[238] = "%1d", -- CB INST LIGHTS, ON/OFF {1.0, 0.0}
|
||||
[239] = "%1d", -- CB R ENG AUX DOORS, ON/OFF {1.0, 0.0}
|
||||
[244] = "%1d", -- CB CAUTION & WARN LIGHTS-DIM, ON/OFF {1.0, 0.0}
|
||||
[245] = "%1d", -- CB OXY QTY & CANOPY SEAL, ON/OFF {1.0, 0.0}
|
||||
[246] = "%1d", -- CB LDG-TAXI LAMP PWR, ON/OFF {1.0, 0.0}
|
||||
--UHF Radio AN/ARC-164
|
||||
[300] = "%.2f", -- AN/ARC-164, UHF Radio Preset Channel Selector Knob {0.0, 0.1, 0.2, 0.3, 0.4, ... 0.15, 0.16, 0.17, 0.18, 0.19}
|
||||
[327] = "%.1f", -- AN/ARC-164, UHF Radio 100 MHz Frequency Selector Knob {0.0, 0.1, 0.2, 0.3}
|
||||
[328] = "%.1f", -- AN/ARC-164, UHF Radio 10 MHz Frequency Selector Knob {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}
|
||||
[329] = "%.1f", -- AN/ARC-164, UHF Radio 1 MHz Frequency Selector Knob {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}
|
||||
[330] = "%.1f", -- AN/ARC-164, UHF Radio 0.1 MHz Frequency Selector Knob {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}
|
||||
[331] = "%.2f", -- AN/ARC-164, UHF Radio 0.025 MHz Frequency Selector Knob {0.0, 0.25, 0.5, 0.75}
|
||||
[307] = "%.1f", -- AN/ARC-164, UHF Radio Frequency Mode Selector Switch, MANUAL/PRESET/GUARD {0.0, 0.1, 0.2}
|
||||
[311] = "%.1f", -- AN/ARC-164, UHF Radio Function Selector Switch, OFF/MAIN/BOTH/ADF {0.0, 0.1, 0.2}
|
||||
[310] = "%1d", -- AN/ARC-164, UHF Radio Tone Button
|
||||
[308] = "%1d", -- AN/ARC-164, UHF Radio Squelch Switch, ON/OFF
|
||||
[309] = "%.1f", -- AN/ARC-164, UHF Radio Volume Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[336] = "%.1f", -- AN/ARC-164, UHF Radio Antenna Selector Switch, UPPER/AUTO/LOWER {0.0, 0.5, 1.0}
|
||||
[135] = "%1d", -- AN/ARC-164, UHF Radio Microphone Button
|
||||
--TACAN
|
||||
[256] = "%.1f", -- TACAN Channel Selector (Tens) - Rotate mouse wheel to select (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[257] = "%.1f", -- TACAN Channel Selector (Ones) / X/Y Mode - Right mouse click to select X/Y. Rotate mouse wheel to make channel selection (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[258] = "%.2f", -- TACAN Channel Selector (Ones) / X/Y Mode - Right mouse click to select X/Y. Rotate mouse wheel to make channel selection (Button) {0.87, 0.93}
|
||||
[259] = "%1d", -- TACAN Signal on HSI Test Button
|
||||
[261] = "%1d", -- TACAN Signal Volume Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[262] = "%.1f", -- TACAN Mode Selector Switch {0.0, 0.1, 0.2, 0.3, 0.4}
|
||||
-- Sight Camera
|
||||
[82] = "%.1f", -- Sight Camera Lens f-Stop Selector, 2.8(dull)..22(bright) (Axis) {0.0, 0.3} in 0.1 Steps
|
||||
[80] = "%1d", -- Sight Camera FPS Select Switch, 24/48
|
||||
[84] = "%.1f", -- Sight Camera Overrun Selector, 0/3/10/20 {0.0, 0.1, 0.2, 0.3}
|
||||
[79] = "%1d" -- Sight Camera Run (Test) Switch, ON/OFF
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
--AN/ARC-164 UHF
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(23)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2000, string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy(lUHFRadio:get_frequency()/1000000))
|
||||
|
||||
local lUHFRadio_PRESET = {[0]="01",[0.05]="02",[0.1]="03",[0.15]="04",[0.2]="05",[0.25]="06",[0.3]="07",[0.35]="08",[0.4]="09",[0.45]="10",[0.5]="11",[0.55]="12",[0.6]="13",[0.65]="14",[0.7]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
||||
ExportScript.Tools.SendData(2001, lUHFRadio_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(300), 2)])
|
||||
end
|
||||
|
||||
-- TACAN Channel
|
||||
-------------------------------------------------
|
||||
ExportScript.Tools.SendData(2002, (string.format("%0.2f", (mainPanelDevice:get_argument_value(263))) == "1.00" and "0" or "1")..ExportScript.Tools.round(mainPanelDevice:get_argument_value(264) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(265) * 10, 0)..(string.format("%1d", (mainPanelDevice:get_argument_value(266))) == "0" and "X" or "Y"))
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--AN/ARC-164 UHF
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(23)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC(2000, string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC(2000, ExportScript.Tools.RoundFreqeuncy(lUHFRadio:get_frequency()/1000000))
|
||||
|
||||
local lUHFRadio_PRESET = {[0]="01",[0.05]="02",[0.1]="03",[0.15]="04",[0.2]="05",[0.25]="06",[0.3]="07",[0.35]="08",[0.4]="09",[0.45]="10",[0.5]="11",[0.55]="12",[0.6]="13",[0.65]="14",[0.7]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
||||
ExportScript.Tools.SendDataDAC(2001, lUHFRadio_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(300), 2)])
|
||||
end
|
||||
|
||||
-- TACAN Channel
|
||||
-------------------------------------------------
|
||||
ExportScript.Tools.SendDataDAC(2002, (string.format("%0.2f", (mainPanelDevice:get_argument_value(263))) == "1.00" and "0" or "1")..ExportScript.Tools.round(mainPanelDevice:get_argument_value(264) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(265) * 10, 0)..(string.format("%1d", (mainPanelDevice:get_argument_value(266))) == "0" and "X" or "Y"))
|
||||
|
||||
-- Fuel Quantity Indicator (Dual)
|
||||
local lLeftFuel = ExportScript.Tools.round(mainPanelDevice:get_argument_value(22) * 2500, 0)
|
||||
local lRightFuel = ExportScript.Tools.round(mainPanelDevice:get_argument_value(23) * 2500, 0)
|
||||
|
||||
ExportScript.Tools.SendDataDAC(2003, lLeftFuel)
|
||||
ExportScript.Tools.SendDataDAC(2004, lRightFuel)
|
||||
ExportScript.Tools.SendDataDAC(2005, lLeftFuel + lRightFuel)
|
||||
|
||||
-- generic Radio display and frequency rotarys
|
||||
-------------------------------------------------
|
||||
-- genericRadioConf
|
||||
ExportScript.genericRadioConf = {}
|
||||
ExportScript.genericRadioConf['maxRadios'] = 1 -- numbers of aviables/supported radios
|
||||
ExportScript.genericRadioConf[1] = {} -- first radio
|
||||
ExportScript.genericRadioConf[1]['Name'] = "AN/ARC-164 UHF" -- name of radio
|
||||
ExportScript.genericRadioConf[1]['DeviceID'] = 23 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[1]['minFrequency'] = 220.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[1]['maxFrequency'] = 399.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[1]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3008 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active
|
||||
ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3011 -- volume button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active
|
||||
ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 300 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.1]="02",[0.2]="03",[0.3]="04",[0.4]="05",[0.5]="06",[0.6]="07",[0.7]="08",[0.8]="09",[0.9]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20"}
|
||||
ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.1 -- minimal step for preset change
|
||||
ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 308 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3010 -- squelch button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3015 -- load button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 307 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
+131
-166
@@ -1,10 +1,21 @@
|
||||
-- F-86 Export
|
||||
-- Version 0.9.9 BETA
|
||||
|
||||
gES_FoundDCSModule = true
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.F86 = "1.2.0"
|
||||
--ExportScript.NoLuaExportBeforeNextFrame = 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
|
||||
[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}
|
||||
@@ -33,9 +44,9 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
||||
-- SlipIndicator
|
||||
[31] = "%.4f", -- SlipIndicator {-1.0, 1.0}
|
||||
-- Accelerometer
|
||||
[6] = "%.4f", -- Accelerometer {-5, 0, 10} = {-0.5, 0, 1.0}
|
||||
[1003] = "%.4f", -- AccelerometerMin {-5.0, 0.0} = {-0.5, 0.0}
|
||||
[1002] = "%.4f", -- AccelerometerMax {0.0, 10} = {0.0, 1.0}
|
||||
[6] = "%.4f", -- Accelerometer {-5.0, 0.0, 10.0} {0.0, 0.334, 1.0}
|
||||
[1003] = "%.4f", -- AccelerometerMin {-5.0, 0.0, 10.0} {0.0, 0.334, 1.0}
|
||||
[1002] = "%.4f", -- AccelerometerMax {-5.0, 0.0, 10.0} {0.0, 0.334, 1.0}
|
||||
-- GyroCompass
|
||||
[711] = "%.4f", -- GyroCompassNeedle {1.0, 0.0}
|
||||
[712] = "%.4f", -- GyroCompassScale {0.0, 1.0}
|
||||
@@ -73,37 +84,49 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
||||
[600] = "%.4f", -- ARN6_Bearing {0.0, 1.0}
|
||||
[814] = "%.4f", -- ARN6_Scale {1.0, 0.0}
|
||||
[830] = "%.4f", -- ARN6_FreqScale {0.0, 1.0}
|
||||
[219] = "%.4f", -- ARN6_ScaleLight {0.0, 1.0}
|
||||
-- light system
|
||||
[182] = "%.4f", -- IlluminationLights {0.0, 1.0}
|
||||
[825] = "%.4f", -- StandByCompassLight {0.0, 1.0}
|
||||
[180] = "%.4f", -- PrimaryInstLights {0.0, 1.0}
|
||||
[185] = "%.4f", -- AuxiliaryInstrumentLights {0.0, 1.0}
|
||||
[182] = "%.f", -- IlluminationLights {0.0, 1.0}
|
||||
[825] = "%.f", -- StandByCompassLight {0.0, 1.0}
|
||||
[180] = "%.f", -- PrimaryInstLights {0.0, 1.0}
|
||||
[185] = "%.f", -- AuxiliaryInstrumentLights {0.0, 1.0}
|
||||
[222] = "%.4f", -- LandingGearUnsafe {0.0, 1.0}
|
||||
--
|
||||
[603] = "%.4f", -- LABS_roll_needle {-1.0, 1.0}
|
||||
[604] = "%.4f", -- LABS_pitch_needle {-1.0, 1.0}
|
||||
--
|
||||
[818] = "%.4f", -- EmergencyJettisonHandlePos {0.0, 1.0}
|
||||
[221] = "%.4f", -- EmergencyJettisonHandleRot {0.0, 1.0}
|
||||
-- LAMPS
|
||||
-- electric system
|
||||
[617] = "%.1f", -- lamp_ELEC_GenOff {-1.0, 1.0}
|
||||
[610] = "%.1f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
|
||||
[611] = "%.1f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
|
||||
[612] = "%.1f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
|
||||
[617] = "%.f", -- lamp_ELEC_GenOff {-1.0, 1.0}
|
||||
[610] = "%.f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
|
||||
[611] = "%.f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
|
||||
[612] = "%.f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
|
||||
-- hydraulic system
|
||||
[614] = "%.1f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
|
||||
[39] = "%.1f", -- lamp_HYDRO_LeftGear {-1.0, 1.0}
|
||||
[41] = "%.1f", -- lamp_HYDRO_RightGear {-1.0, 1.0}
|
||||
[40] = "%.1f", -- lamp_HYDRO_NoseGear {-1.0, 1.0}
|
||||
[614] = "%.f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
|
||||
[39] = "%.f", -- lamp_HYDRO_LeftGear {-1.0, 1.0}
|
||||
[41] = "%.f", -- lamp_HYDRO_RightGear {-1.0, 1.0}
|
||||
[40] = "%.f", -- lamp_HYDRO_NoseGear {-1.0, 1.0}
|
||||
-- fuel system
|
||||
[625] = "%.1f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
|
||||
[625] = "%.f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
|
||||
-- fire detection system
|
||||
[615] = "%.1f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
|
||||
[616] = "%.1f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
|
||||
[615] = "%.f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
|
||||
[616] = "%.f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
|
||||
-- control system
|
||||
[613] = "%.1f" -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
|
||||
[613] = "%.f", -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
|
||||
-- air system
|
||||
[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
|
||||
[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0}
|
||||
[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 0.0, 1.0}
|
||||
[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0}
|
||||
[817] = "%.1f", -- Canopy Alternate Emergency Jettison Handle, IN/OUT {0.0, 1.0}
|
||||
[816] = "%.1f", -- Canopy Declutch Handle, IN/OUT {0.0, 1.0}
|
||||
@@ -164,6 +187,9 @@ gES_GlassCockpitConfigArguments =
|
||||
[706] = "%1d", -- Alternate Hydraulic Emergency Override Handle, IN/OUT {1, -1}
|
||||
[647] = "%1d", -- Flight Control Switch, ALTERNATE ON/NORMAL/RESET {1}
|
||||
[815] = "%1d", -- Landing Gear Warning Horn Cutout Button (Push to silence horn) {1}
|
||||
[819] = "%.4f", -- Landing Gear Emergency Release Handle (rotary) {0.0,1.0} in 0.1 steps
|
||||
[211] = "%1d", -- Speed Brake Switch, OUT/HOLD/IN {-1.0,0.0,1.0}
|
||||
[217] = "%1d", -- Parking Brake Handle, ON/OFF
|
||||
-- Fuel Interface
|
||||
[672] = "%1d", -- Fuel Densitometer Selection Switch, IN/OUT {2, -2}
|
||||
[662] = "%.1f", -- Drop Tank Selector Switch {-0.1, 0.1}
|
||||
@@ -173,7 +199,7 @@ gES_GlassCockpitConfigArguments =
|
||||
[703] = "%1d", -- Oxygen Regulator Diluter Lever, NORMAL OXYGEN/100% OXYGEN {1, -1}
|
||||
[704] = "%.4f", -- Oxygen Regulator Supply Lever (rotary) {0.0 to 1.0} in -0.5 steps
|
||||
-- Fire Detection Interface
|
||||
[635] = "%1d", -- Engine Fire Detector System Test Button {1,- 1}
|
||||
[635] = "%1d", -- Engine Fire Warning Light Test Button {1,- 1}
|
||||
[685] = "%1d", -- Forward Engine Compartment Fire-warning Light (Push to test) {1}
|
||||
[686] = "%1d", -- Aft Engine Compartment Fire-warning Light (Push to test) {1}
|
||||
-- Air Interface
|
||||
@@ -185,6 +211,8 @@ gES_GlassCockpitConfigArguments =
|
||||
[737] = "%.1f", -- Cockpit Air Temperature Control Switch, AUTO/OFF/HOT/COLD {-1.0, 1.0}
|
||||
[645] = "%.1f", -- Engine Anti-Ice & Screen Switch, EXTEND/RET./ANTI-ICE {-1.0, 1.0}
|
||||
[741] = "%1d", -- Air Outlet Selector Lever, FLOOR/BOTH/DEFROST {-1, 1}
|
||||
[691] = "%1d", -- Windshield Anti-Ice Overheat Warning Light
|
||||
[202] = "%.4f", -- Windshield Anti-Icing Lever (rotary) {0.0,1.0} in 0.1 steps
|
||||
-- Light Interface
|
||||
[654] = "%1d", -- Compass Light Switch, ON/OFF {2, -2}
|
||||
[813] = "%.1f", -- Instrument Panel Primary Light Rheostat (rotary) {0.0, 1.0} in 0.5 steps
|
||||
@@ -199,24 +227,27 @@ gES_GlassCockpitConfigArguments =
|
||||
--[732] = "%1d", -- Emergency (In-air) Ignition Switch Cover {1, -1}
|
||||
[733] = "%.1f", -- Emergency (In-air) Ignition Switch, ON/OFF {1.0, 1.0}
|
||||
-- Control Interface
|
||||
[649] = "%.1f", -- Lateral Alternate Trim Switch, NORMAL/OFF/LEFT/RIGHT {-0.1, 0.1}
|
||||
[648] = "%.1f", -- Rudder Trim Switch, LEFT/OFF/RIGHT {-1.0, 1.0}
|
||||
[649] = "%.1f", -- Lateral Alternate Trim Switch, LEFT/RIGHT/NORMAL/OFF {0.3, 0.5, 0.1, 0.0}
|
||||
[648] = "%.1f", -- Rudder Trim Switch, LEFT/OFF/RIGHT {1.0, -1.0}
|
||||
--[738] = "%1d", -- Longitudinal Alternate Trim Switch Cover {1, -1}
|
||||
[739] = "%.1f", -- Longitudinal Alternate Trim Switch, NORMAL GRIP CONT/OFF/NOSE UP/NOSE DOWN {-0.1, 0.0, 0.1}
|
||||
[739] = "%.1f", -- Longitudinal Alternate Trim Switch, NORMAL GRIP CONT/NOSE UP/NOSE DOWN/OFF {0.5, 0.3, 0.1, 0.0}
|
||||
[683] = "%1d", -- Take-off (Trim) Position Indicator Light (Push to test) {1}
|
||||
[735] = "%1d", -- Wing Flaps Handle {-1, 1}
|
||||
[209] = "%1d", -- Nose Wheel Steering Button
|
||||
-- radio ARC-27
|
||||
[806] = "%.4f", -- AN/ARC-27 UHF Audio Volume Knob (rotary) {0.1, 0.9} in 0.5 steps
|
||||
[807] = "%.1f", -- AN/ARC-27 UHF Preset Channel Selector {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8}
|
||||
[805] = "%.1f", -- AN/ARC-27 UHF Power Switch, OFF/T/R/T/R + G REC/ADF {0.0, 0.1, 0.2, 0.3}
|
||||
[213] = "%1d", -- Microphone Button
|
||||
-- radio compass ARN-6
|
||||
[802] = "%.4f", -- AN/ARN-6 Audio Volume Control (rotary) {0.1, 0.9} in 0.5 steps
|
||||
[803] = "%.1f", -- AN/ARN-6 Frequency Band Switch {0.0, 0.1, 0.2, 0.3}
|
||||
[667] = "%.1f", -- AN/ARN-6 Function Selector Switch, OFF/COMP/ANT./LOOP/CONT. {0.0, 0.1, 0.2, 0.3}
|
||||
[667] = "%.1f", -- AN/ARN-6 Function Selector Switch, OFF/COMP/ANT./LOOP/CONT. {0.0, 0.1, 0.2, 0.3, 0.4}
|
||||
[666] = "%.1f", -- AN/ARN-6 LOOP L-R Switch {-1.0, 0.0, 1.0}
|
||||
--[null] = "%.4f", -- AN/ARN-6 Tuning Crank {0.0, 1.0} in 0.01 steps
|
||||
[657] = "%.1f", -- AN/ARN-6 Scale Light Switch, HI/OFF/LO {-0.1, 0.0, 0.1}
|
||||
[826] = "%.4f", -- AN/ARN-6 East/West Variation Knob (rotary) {0.0, 1.0} in 0.05 steps
|
||||
[658] = "%.1f", -- AN/ARN-6 CW-VOICE Switch, CW/VOICE {1.0, -1.0}
|
||||
-- IFF APX-6
|
||||
[810] = "%.1f", -- AN/APX-6 IFF Master Switch, EMERGENCY/NORM/LOW/STDBY/OFF {0.0, 0.1, 0.2, 0.3, 0.4}
|
||||
[659] = "%.1f", -- AN/APX-6 IFF Mode 2 Switch, MODE 2/OUT/I/P {-0.1, 0.0, 0.1}
|
||||
@@ -224,14 +255,14 @@ gES_GlassCockpitConfigArguments =
|
||||
--[808] = "%1d", -- AN/APX-6 IFF Destruct Switch Cover {1, -1}
|
||||
[809] = "%1d", -- AN/APX-6 IFF Destruct Switch, OFF/ON {0, -1}
|
||||
-- baro altimeter
|
||||
--[null] = "%.4f", -- Altimeter reference pressure adjusting knob (rotary) {0.0, 1.0} in 0.1 steps
|
||||
[218] = "%.4f", -- Altimeter reference pressure adjusting knob (rotary) {0.0, 1.0} in 0.1 steps
|
||||
-- gyromag compass
|
||||
--[null] = "%.4f", -- Compass Correction (rotary) {0.0, 1.0} in 0.05 steps
|
||||
[598] = "%.1f", -- Directional Indicator Fast Slaving Switch {0.0, 1.0}
|
||||
[598] = "%.1f", -- Directional Indicator Fast Slaving Button {0.0, 1.0}
|
||||
-- attitude indicator
|
||||
[714] = "%.1f", -- Pull to Cage Knob {0.0, 1.0}
|
||||
-- accelerometer
|
||||
[1004] = "%.1f", -- Accelerometer Reset Knob {0.0, 1.0}
|
||||
[1004] = "%.1f", -- Accelerometer Reset Button {0.0, 1.0}
|
||||
-- CLOCK
|
||||
--[null] = "%1d", -- Set Clock Knob
|
||||
[831] = "%1d", -- Elapsed Time Mechanism Button {0, 1}
|
||||
@@ -239,12 +270,15 @@ gES_GlassCockpitConfigArguments =
|
||||
[716] = "%.4f", -- A-4 Sight Wing Span Adjustment Knob (rotary) {0.0, 1.0} in 0.1 steps
|
||||
[715] = "%.4f", -- A-4 Sight Radar Range Sweep Rheostat (rotary) {0.0, 1.0} in 0.1 steps
|
||||
[734] = "%.4f", -- A-4 Sight Reticle Dimmer Control (rotary) {0, 0.74} in -0.2 steps
|
||||
[755] = "%1d", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE {0, 1}
|
||||
[755] = "%.4f", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE (rotary) {0.001, 0.999}
|
||||
[642] = "%1d", -- A-4 Sight Filament Selector Switch, SECONDARY/PRIMARY {2, -2}
|
||||
[755] = "%1d", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE {0, 1}
|
||||
[755] = "%.4f", -- A-4 Sight Mechanical Caging Lever, CAGE/UNCAGE (rotary) {0.001, 0.999} in 0.1 steps
|
||||
[212] = "%1d", -- A-4 Sight Electrical Caging Button
|
||||
[642] = "%1d", -- A-4 Sight Filament Selector Switch, SECONDARY/PRIMARY {2, -2}
|
||||
[210] = "%.4f", -- A-4 Sight Rotating Grip - Mouse Wheel for manual ranging {-1.0,1.0} in 0.2 steps
|
||||
[210] = "%1d", -- A-4 Sight Rotating Grip - Right Click for return to CCW spring-loaded position {1.0}
|
||||
[721] = "%.1f", -- Variable Sight Selector Unit - Sight Function Selector Lever, ROCKET/GUN/BOMB {0.0, 0.1, 0.2}
|
||||
[720] = "%1d", -- Variable Sight Selector Unit - Target Speed Switch, HI/LO {1, -1}
|
||||
[722] = "%.4f", -- Variable Sight Selector Unit - Rocket Depression Angle Selector (rotary) {0.0, 1.0} in 0.6 steps
|
||||
[720] = "%.1f", -- Variable Sight Selector Unit - Target Speed Switch, HI/LO {0.0,0.5,1.0}
|
||||
[722] = "%.4f", -- Variable Sight Selector Unit - Rocket Depression Angle Selector (rotary) {0.0, 1.0} in 0.1 steps
|
||||
[727] = "%.4f", -- Bomb-Target Wind Control Knob (rotary) {0.0, 1.0} in 0.6 steps
|
||||
-- weapon system
|
||||
[639] = "", -- Demolition Bomb Release Selector Switch, AUTO RELEASE/MANUAL RELEASE {2,-2}
|
||||
@@ -256,7 +290,7 @@ gES_GlassCockpitConfigArguments =
|
||||
[751] = "%.1f", -- Rocket Release Selector Switch, SINGLE/OFF/AUTO {-1.0, 0.0, 1.0}
|
||||
[668] = "%.1f", -- Gun Selector Switch {-0.2, 0.2}
|
||||
[665] = "%.1f", -- Gun-Missile Selector Switch, OFF/SIGHT CAMERA & RADAR/GUNS/MISSILE {0, 0.3}
|
||||
[636] = "%1d", -- Gun Heater Switch, HEATER/OFF {2,- 2}
|
||||
[636] = "%.1f", -- Gun Heater Switch, HEATER/OFF/(N/F) {-1.0, 1.0}
|
||||
[663] = "%1d", -- Manual Pip Control Switch, BOMB/NORMAL {2, -2}
|
||||
[796] = "%.1f", -- Manual Pip Control Change Calibrated Dials (Presets) {0.0, 0.3, 0.6, 0.9}
|
||||
[797] = "%.4f", -- Manual Pip Control Knob (rotary) {0.0, 1.0} in 0.1 steps
|
||||
@@ -269,7 +303,10 @@ gES_GlassCockpitConfigArguments =
|
||||
[820] = "%.1f", -- Missile Control Switch, LH & RH/RH/SALVO {-1.0, 0.0, 1.0}
|
||||
[821] = "%.4f", -- Tone Volume (rotary) {0.0, 1.0} in 0.1 steps
|
||||
[822] = "%.1f", -- Safe Launch Button {0.0, 1.0}
|
||||
[1001] = "%.1f" -- Rocket Intervalometer {0.0, 1.0}
|
||||
[225] = "%1d", -- G-Limit Light - Push to test
|
||||
[226] = "%.4f", -- G-Limit Light - Rotate to adjust brightness(MW) (rotary) {0.0,0.5} in 0.02 steps
|
||||
[1001] = "%.1f", -- Rocket Intervalometer {0.0, 1.0}
|
||||
[208] = "%1d" -- A-4 Sight Radar Target Selector Button
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
@@ -277,109 +314,32 @@ gES_GlassCockpitConfigArguments =
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch version 1.6
|
||||
|
||||
-- ACC
|
||||
-- Accelerometer; AccelerometerMin; AccelerometerMax;
|
||||
SendData(2001, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(6),
|
||||
mainPanelDevice:get_argument_value(1003),
|
||||
mainPanelDevice:get_argument_value(1002)))
|
||||
-- ADI
|
||||
-- AttitudeIndicatorPitch; AttitudeIndicatorBank; AttitudeIndicatorPitchSphere; AttitudeIndicatorBankNeedle; AttitudeIndicatorOffFlag
|
||||
SendData(2002, string.format("%.4f;%.4f;%.4f;%.4f;%.1f",
|
||||
mainPanelDevice:get_argument_value(605),
|
||||
mainPanelDevice:get_argument_value(606),
|
||||
mainPanelDevice:get_argument_value(81),
|
||||
mainPanelDevice:get_argument_value(1005),
|
||||
mainPanelDevice:get_argument_value(713)))
|
||||
-- Altimeter
|
||||
-- Altimeter10000; Altimeter1000; Altimeter100; AltimeterHG
|
||||
SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(707),
|
||||
mainPanelDevice:get_argument_value(523),
|
||||
mainPanelDevice:get_argument_value(524),
|
||||
mainPanelDevice:get_argument_value(700)))
|
||||
-- Airspeed
|
||||
-- Airspeed; AirspeedDrum; AirspeedM1
|
||||
SendData(2004, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(178),
|
||||
mainPanelDevice:get_argument_value(709),
|
||||
mainPanelDevice:get_argument_value(8)))
|
||||
-- RMI
|
||||
-- ARN6_Bearing; ARN6_Scale
|
||||
SendData(2008, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(600),
|
||||
mainPanelDevice:get_argument_value(814)))
|
||||
-- Clock
|
||||
-- CLOCK_currtime_hours; CLOCK_currtime_minutes; CLOCK_currtime_seconds; CLOCK_seconds_meter_time_minutes; CLOCK_seconds_meter_time_seconds
|
||||
-- CLOCK_currtime_hours; CLOCK_currtime_minutes; <= Beta
|
||||
SendData(2005, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(19),
|
||||
mainPanelDevice:get_argument_value(18)))
|
||||
-- GyroCompass
|
||||
-- GyroCompassNeedle; GyroCompassScale
|
||||
SendData(2006, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(711),
|
||||
mainPanelDevice:get_argument_value(712)))
|
||||
-- Labs
|
||||
-- LABS_roll_needle; LABS_pitch_needle
|
||||
SendData(2007, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(603),
|
||||
mainPanelDevice:get_argument_value(604)))
|
||||
-- RMI
|
||||
-- ARN6_Bearing; ARN6_Scale
|
||||
SendData(2008, string.format("%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(600),
|
||||
mainPanelDevice:get_argument_value(814)))
|
||||
-- Gear
|
||||
-- Left; Right; Front
|
||||
SendData(2010, string.format("%0.4f;%0.4f;%0.4f",
|
||||
mainPanelDevice:get_argument_value(39),
|
||||
mainPanelDevice:get_argument_value(41),
|
||||
mainPanelDevice:get_argument_value(40)))
|
||||
end
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function 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
|
||||
|
||||
-- light system
|
||||
SendDataHW("182", mainPanelDevice:get_argument_value(182)) -- IlluminationLights {0.0, 1.0}
|
||||
SendDataHW("825", mainPanelDevice:get_argument_value(825)) -- StandByCompassLight {0.0, 1.0}
|
||||
SendDataHW("180", mainPanelDevice:get_argument_value(180)) -- PrimaryInstLights {0.0, 1.0}
|
||||
SendDataHW("185", mainPanelDevice:get_argument_value(185)) -- AuxiliaryInstrumentLights {0.0, 1.0}
|
||||
-- LAMPS
|
||||
-- electric system
|
||||
SendDataHW("617", mainPanelDevice:get_argument_value(617)) -- lamp_ELEC_GenOff {-1.0, 1.0}
|
||||
SendDataHW("610", mainPanelDevice:get_argument_value(610)) -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0}
|
||||
SendDataHW("611", mainPanelDevice:get_argument_value(611)) -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0}
|
||||
SendDataHW("612", mainPanelDevice:get_argument_value(612)) -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0}
|
||||
-- hydraulic system
|
||||
SendDataHW("614", mainPanelDevice:get_argument_value(614)) -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0}
|
||||
SendDataHW("39", mainPanelDevice:get_argument_value(39)) -- lamp_HYDRO_LeftGear {-1.0, 1.0}
|
||||
SendDataHW("41", mainPanelDevice:get_argument_value(41)) -- lamp_HYDRO_RightGear {-1.0, 1.0}
|
||||
SendDataHW("40", mainPanelDevice:get_argument_value(40)) -- lamp_HYDRO_NoseGear {-1.0, 1.0}
|
||||
-- fuel system
|
||||
SendDataHW("625", mainPanelDevice:get_argument_value(625)) -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0}
|
||||
-- fire detection system
|
||||
SendDataHW("615", mainPanelDevice:get_argument_value(615)) -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0}
|
||||
SendDataHW("616", mainPanelDevice:get_argument_value(616)) -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0}
|
||||
-- control system
|
||||
SendDataHW("613", mainPanelDevice:get_argument_value(613)) -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0}
|
||||
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
@@ -387,54 +347,59 @@ end
|
||||
-- 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
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {654,813,811,812})
|
||||
-- Compass Light Switch, Instrument Panel Primary Light Rheostat, Instrument Panel Auxiliary Light Rheostat, Console and Panel Light Rheostat
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to hardware
|
||||
export in low tick interval to DAC
|
||||
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
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 13, 1 do
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 73, 1 do
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function genericRadio(key, value, hardware)
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
@@ -0,0 +1,743 @@
|
||||
-- F/A-18C Export
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.FA18C_hornet = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Controlls
|
||||
--[71] = "%.4f", -- StickPitch {-1, 0, 0.137, 0.5} {1, 0.12, 0, -0.726}
|
||||
--[74] = "%.4f", -- StickRoll {-1, 1}
|
||||
--[500] = "%.4f", -- Rudder {-1, 1}
|
||||
--[501] = "%.4f", -- LeftWheelBrake
|
||||
--[502] = "%.4f", -- RightWheelBrake
|
||||
--[104] = "%.4f", -- LeftThrottle
|
||||
--[105] = "%.4f", -- RightThrottle
|
||||
--[495] = "%.4f", -- LeftFingerLift
|
||||
--[496] = "%.4f", -- RightFingerLift
|
||||
-- Electric Interface
|
||||
[400] = "%.4f", -- VoltmeterU {16.0, 30.0}{0.0, 1.0}
|
||||
[401] = "%.4f", -- VoltmeterE {16.0, 30.0}{0.0, 1.0}
|
||||
-- Hydraulic Interface
|
||||
[310] = "%.4f", -- HydIndLeft {0.0, 5000.0} {0.0, 1.0}
|
||||
[311] = "%.4f", -- HydIndRight {0.0, 5000.0} {0.0, 1.0}
|
||||
[242] = "%.4f", -- HydIndBrake {0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0}{0.0, 0.036, 0.338, 0.636, 0.924, 1.0}
|
||||
-- Gear Interface
|
||||
[228] = "%.4f", -- EmergGearDownHandle
|
||||
[240] = "%.4f", -- EmergParkBrakeHandle
|
||||
-- Instruments --------------------------
|
||||
-- Standby Pressure Altimeter AAU-52/A
|
||||
[218] = "%.4f", -- Altimeter_100_footPtr {0.0, 1000.0} {0.0, 1.0}
|
||||
[220] = "%.4f", -- Altimeter_10000_footCount {0.0, 9.0} {0.0, 1.0}
|
||||
[219] = "%.4f", -- Altimeter_1000_footCount {0.0, 9.0} {0.0, 1.0}
|
||||
[221] = "%.4f", -- pressure_setting_0 {0.0, 10.0} {0.0, 1.0}
|
||||
[222] = "%.4f", -- pressure_setting_1 {0.0, 10.0} {0.0, 1.0}
|
||||
[223] = "%.4f", -- pressure_setting_2 {0.0, 10.0} {0.0, 1.0}
|
||||
-- Indicated Airspeed Indicator AVU-35/A
|
||||
[217] = "%.4f", -- Airspeed {0.0, 60.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0} {0.0, 0.0445, 0.15, 0.348, 0.586, 0.636, 0.673, 0.715, 0.748, 0.782, 0.819, 0.849, 0.870, 0.898, 0.922, 0.950, 0.976, 1.0}
|
||||
-- Vertical Speed Indicator AVU-53/A
|
||||
[225] = "%.4f", -- Variometer {-6000.0, -4000.0, -3000.0, -2000.0, -1000.0, -500.0, 0.0, 500.0, 1000.0, 2000.0, 3000.0, 4000.0, 6000.0} { -1.0, -0.83, -0.73, -0.605, -0.40, -0.22, 0.0, 0.22, 0.40, 0.605, 0.73, 0.83, 1.0}
|
||||
-- Clock
|
||||
[278] = "%.4f", -- CLOCK_currtime_hour {0.0, 12.0} {0.0, 1.0}
|
||||
[279] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} {0.0, 1.0}
|
||||
[281] = "%.4f", -- CLOCK_elapsed_time_minutes {0.0, 60.0} {0.0, 1.0}
|
||||
[280] = "%.4f", -- CLOCK_elapsed_time_seconds {0.0, 60.0} {0.0, 1.0}
|
||||
-- ID-2163/A
|
||||
[287] = "%.4f", -- Min_Height_Indicator_ID2163A {-0.03, 0.0, 0.5, 0.8, 1.0} {0.0, 0.031, 0.525, 0.802, 0.982}
|
||||
[286] = "%.4f", -- Altitude_Pointer_ID2163A {-10.0, 0.0, 100.0, 200.0, 300.0, 400.0, 600.0, 800.0, 1000.0, 3000.0, 5000.0, 5100.0} {0.0, 0.048, 0.171, 0.296, 0.416, 0.530, 0.616, 0.706, 0.799, 0.886, 0.974, 0.98}
|
||||
[288] = "%.4f", -- OFF_Flag_ID2163A
|
||||
[290] = "%1d", -- Red_Lamp_ID2163A
|
||||
[289] = "%1d", -- Green_Lamp_ID2163A
|
||||
-- SAI
|
||||
[205] = "%.4f", -- SAI_Pitch {-1.0, 1.0}
|
||||
[206] = "%.4f", -- SAI_Bank {-1.0, 1.0}
|
||||
[209] = "%.4f", -- SAI_attitude_warning_flag
|
||||
[210] = "%.4f", -- SAI_manual_pitch_adjustment {0.0, 1.0} {-1.0, 1.0}
|
||||
[207] = "%.4f", -- SAI_SlipBall {-1.0, 1.0}
|
||||
[208] = "%.4f", -- SAI_RateOfTurn {-3.0, 3.0} {-1.0, 1.0}
|
||||
[211] = "%.4f", -- SAI_vertical_pointer {-1.0, 1.0}
|
||||
[212] = "%.4f", -- SAI_horisontal_pointer {-1.0, 1.0}
|
||||
-- Cockpit Pressure Altimeter
|
||||
[285] = "%.4f", -- CockpitPressureAltimeter {0.0, 5000.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 35000.0, 40000.0, 45000.0, 50000.0} {0.0, 0.117, 0.2245, 0.3225, 0.411, 0.506, 0.609, 0.717, 0.823, 0.914, 1.0}
|
||||
-- Caution Light Indicator Panel
|
||||
[298] = "%1d", -- CPT_LTS_CK_SEAT
|
||||
[299] = "%1d", -- CPT_LTS_APU_ACC
|
||||
[300] = "%1d", -- CPT_LTS_BATT_SW
|
||||
[301] = "%1d", -- CPT_LTS_FCS_HOT
|
||||
[302] = "%1d", -- CPT_LTS_GEN_TIE
|
||||
[303] = "%1d", -- CPT_LTS_SPARE_CTN1
|
||||
[304] = "%1d", -- CPT_LTS_FUEL_LO
|
||||
[305] = "%1d", -- CPT_LTS_FCES
|
||||
[306] = "%1d", -- CPT_LTS_SPARE_CTN2
|
||||
[307] = "%1d", -- CPT_LTS_L_GEN
|
||||
[308] = "%1d", -- CPT_LTS_R_GEN
|
||||
[309] = "%1d", -- CPT_LTS_SPARE_CTN3
|
||||
-- LH Advisory and Threat Warning Indicator Panel
|
||||
[13] = "%1d", -- CPT_LTS_MASTER_CAUTION
|
||||
[10] = "%1d", -- CPT_LTS_FIRE_LEFT
|
||||
[15] = "%1d", -- CPT_LTS_GO
|
||||
[16] = "%1d", -- CPT_LTS_NO_GO
|
||||
[17] = "%1d", -- CPT_LTS_L_BLEED
|
||||
[18] = "%1d", -- CPT_LTS_R_BLEED
|
||||
[19] = "%1d", -- CPT_LTS_SPD_BRK
|
||||
[20] = "%1d", -- CPT_LTS_STBY
|
||||
[21] = "%1d", -- CPT_LTS_L_BAR_RED
|
||||
[22] = "%1d", -- CPT_LTS_REC
|
||||
[23] = "%1d", -- CPT_LTS_L_BAR_GREEN
|
||||
[24] = "%1d", -- CPT_LTS_XMIT
|
||||
[25] = "%1d", -- CPT_LTS_ASPJ_OH
|
||||
-- RH Advisory and Threat Warning Indicator Panel
|
||||
[29] = "%1d", -- CPT_LTS_FIRE_APU
|
||||
[26] = "%1d", -- CPT_LTS_FIRE_RIGHT
|
||||
[31] = "%1d", -- CPT_LTS_RCDR_ON
|
||||
[32] = "%1d", -- CPT_LTS_DISP
|
||||
[38] = "%1d", -- CPT_LTS_SAM
|
||||
[39] = "%1d", -- CPT_LTS_AI
|
||||
[40] = "%1d", -- CPT_LTS_AAA
|
||||
[41] = "%1d", -- CPT_LTS_CW
|
||||
[33] = "%1d", -- CPT_LTS_SPARE_RH1
|
||||
[34] = "%1d", -- CPT_LTS_SPARE_RH2
|
||||
[35] = "%1d", -- CPT_LTS_SPARE_RH3
|
||||
[36] = "%1d", -- CPT_LTS_SPARE_RH4
|
||||
[37] = "%1d", -- CPT_LTS_SPARE_RH5
|
||||
-- Flaps, Landing Gear and Stores Indicator Panel
|
||||
[152] = "%1d", -- CPT_LTS_CTR
|
||||
[154] = "%1d", -- CPT_LTS_LI
|
||||
[156] = "%1d", -- CPT_LTS_LO
|
||||
[158] = "%1d", -- CPT_LTS_RI
|
||||
[160] = "%1d", -- CPT_LTS_RO
|
||||
[166] = "%1d", -- CPT_LTS_NOSE_GEAR
|
||||
[165] = "%1d", -- CPT_LTS_LEFT_GEAR
|
||||
[167] = "%1d", -- CPT_LTS_RIGHT_GEAR
|
||||
[163] = "%1d", -- CPT_LTS_HALF_FLAPS
|
||||
[164] = "%1d", -- CPT_LTS_FULL_FLAPS
|
||||
[162] = "%1d", -- CPT_LTS_FLAPS
|
||||
-- Lock/Shoot Light Assy
|
||||
[1] = "%1d", -- CPT_LTS_LOCK
|
||||
[2] = "%1d", -- CPT_LTS_SHOOT
|
||||
[3] = "%1d", -- CPT_LTS_SHOOT_STROBE
|
||||
-- Master Arm Control
|
||||
[47] = "%1d", -- CPT_LTS_AA
|
||||
[48] = "%1d", -- CPT_LTS_AG
|
||||
[45] = "%1d", -- CPT_LTS_DISCH
|
||||
[44] = "%1d", -- CPT_LTS_READY
|
||||
-- Arresting Hook Control Handle
|
||||
[294] = "%1d", -- CPT_LTS_HOOK
|
||||
-- Landing Gear
|
||||
--[] = "%1d", -- CPT_LTS_LDG_GEAR_HANDLE
|
||||
-- APU Control Panel
|
||||
[376] = "%1d", -- CPT_LTS_APU_READY
|
||||
-- ECM Control Panel Assy
|
||||
--[] = "%1d", -- CPT_LTS_SEL
|
||||
-- Map Gain Control Panel Assy
|
||||
[137] = "%1d", -- CPT_LTS_SPN
|
||||
-- Height Indicator
|
||||
[290] = "%1d", -- CPT_LTS_LOW_ALT_WARN
|
||||
-- AoA Indexer Lights
|
||||
[4] = "%1d", -- CPT_LTS_AOA_HIGH
|
||||
[5] = "%1d", -- CPT_LTS_AOA_CENTER
|
||||
[6] = "%1d", -- CPT_LTS_AOA_LOW
|
||||
-- Internal Lights
|
||||
--[460] = "%.1f", -- Console
|
||||
--[461] = "%.1f", -- Flood
|
||||
--[462] = "%.1f", -- NvgFlood
|
||||
--[464] = "%.1f", -- EmerInstr
|
||||
--[465] = "%.1f", -- EngInstFlood
|
||||
--[466] = "%.1f", -- Instrument
|
||||
--[467] = "%.1f", -- StbyCompass
|
||||
--[810] = "%.1f", -- Utility
|
||||
--[463] = "%.1f", -- Chart
|
||||
-- WCAGroupLightness
|
||||
--[521] = "%.1f", -- WCAGroupLightness 1
|
||||
--[522] = "%.1f", -- WCAGroupLightness 2
|
||||
--[523] = "%.1f", -- WCAGroupLightness 3
|
||||
-- IFEI
|
||||
[468] = "%1d", -- IFEI
|
||||
[469] = "%1d", -- IFEI_buttons
|
||||
-- RWR
|
||||
[276] = "%1d", -- Lower
|
||||
[273] = "%1d", -- Limit
|
||||
[274] = "%1d", -- Display
|
||||
--[270] = "%1d", -- SpecialEn
|
||||
[271] = "%1d", -- Special
|
||||
[267] = "%1d", -- Enable
|
||||
[268] = "%1d", -- Offset
|
||||
[264] = "%1d", -- Fail
|
||||
[265] = "%1d", -- Bit
|
||||
[520] = "%.1f", -- RwrLightsBrightness
|
||||
-- CMDS
|
||||
[516] = "%1d", -- ecmJett
|
||||
-- Magnetic compas
|
||||
[149] = "%.4f", -- heading
|
||||
[150] = "%.4f", -- pitch
|
||||
[151] = "%.4f", -- bank
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Control System
|
||||
[345] = "%.2f", -- RUD TRIM Control (Axis) {-1.0, 1.0} in 0.05 Steps
|
||||
[346] = "%1d", -- T/O TRIM Button
|
||||
[349] = "%1d", -- FCS RESET Button
|
||||
[347] = "%1d", -- GAIN Switch, NORM/ORIDE
|
||||
[234] = "%1d", -- FLAP Switch, AUTO/HALF/FULL {-1.0,0.0,1.0}
|
||||
[138] = "%1d", -- Spin Recovery Switch, RCVY/NORM
|
||||
[470] = "%1d", -- FCS BIT Switch
|
||||
[295] = "%1d", -- Wing Fold Control Handle, (RMB)CW/(LMB)CCW
|
||||
[296] = "%1d", -- Wing Fold Control Handle, (MW)PULL/STOW
|
||||
[504] = "%.1f", -- Throttles Friction Adjusting Lever (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Electric system
|
||||
[404] = "%1d", -- Battery Switch, ON/OFF/ORIDE {-1.0,0.0,1.0}
|
||||
[402] = "%1d", -- Left Generator Control Switch, NORM/OFF
|
||||
[403] = "%1d", -- Right Generator Control Switch, NORM/OFF
|
||||
[378] = "%1d", -- Generator TIE Control Switch, NORM/RESET
|
||||
[336] = "%1d", -- External Power Switch, RESET/NORM/OFF {-1.0,0.0,1.0}
|
||||
[332] = "%1d", -- Ground Power Switch 1, A ON/AUTO/B ON {-1.0,0.0,1.0}
|
||||
[333] = "%1d", -- Ground Power Switch 2, A ON/AUTO/B ON {-1.0,0.0,1.0}
|
||||
[334] = "%1d", -- Ground Power Switch 3, A ON/AUTO/B ON {-1.0,0.0,1.0}
|
||||
[335] = "%1d", -- Ground Power Switch 4, A ON/AUTO/B ON {-1.0,0.0,1.0}
|
||||
-- Anti-Ice
|
||||
[409] = "%1d", -- Pitot Heater Switch, ON/AUTO
|
||||
[410] = "%1d", -- Engine Anti-Ice Switch, ON/OFF/TEST {-1.0,0.0,1.0}
|
||||
-- CB
|
||||
[381] = "%1d", -- CB FCS CHAN 1, ON/OFF
|
||||
[382] = "%1d", -- CB FCS CHAN 2, ON/OFF
|
||||
[383] = "%1d", -- CB SPD BRK, ON/OFF
|
||||
[384] = "%1d", -- CB LAUNCH BAR, ON/OFF
|
||||
[454] = "%1d", -- CB FCS CHAN 3, ON/OFF
|
||||
[455] = "%1d", -- CB FCS CHAN 4, ON/OFF
|
||||
[456] = "%1d", -- CB HOOK, ON/OFF
|
||||
[457] = "%1d", -- CB LG, ON/OFF
|
||||
--
|
||||
[368] = "%1d", -- MC Switch, 1 OFF/NORM/2 OFF {-1.0,0.0,1.0}
|
||||
-- Power Plant
|
||||
[375] = "%1d", -- APU Control Switch, ON/OFF
|
||||
[377] = "%1d", -- Engine Crank Switch, LEFT/OFF/RIGHT {-1.0,0.0,1.0}
|
||||
[331] = "%1d", -- Fire and Bleed Air Test Switch, (RMB) TEST A/(LMB) TEST B {-1.0,0.0,1.0}
|
||||
-- Hydraulic system
|
||||
[369] = "%1d", -- Hydraulic Isolate Override Switch, NORM/ORIDE
|
||||
-- Gear system
|
||||
[226] = "%1d", -- Landing Gear Control Handle, (RMB)UP/(LMB)DOWN {-1.0,0.0} ???
|
||||
[228] = "%1d", -- Landing Gear Control Handle, (MW)EMERGENCY DOWN {0.0,1.0} ???
|
||||
[229] = "%1d", -- Down Lock Override Button - Push to unlock
|
||||
[238] = "%1d", -- Anti Skid Switch, ON/OFF
|
||||
[240] = "%.3f", -- Emergency/Parking Brake Handle, (MW)Pull-Stow {0.0,1.0} in 0.001 Steps ???
|
||||
[241] = "%.3f", -- Emergency/Parking Brake Handle, (LMB)Rotate Left/(RMB)Rotate Right ???
|
||||
[233] = "%1d", -- Launch Bar Control Switch, EXTEND/RETRACT
|
||||
[293] = "%1d", -- Arresting Hook Handle, UP/DOWN
|
||||
-- Fuel system
|
||||
[340] = "%1d", -- Internal Wing Tank Fuel Control Switch, INHIBIT/NORM
|
||||
[341] = "%1d", -- Probe Control Switch, EXTEND/RETRACT/EMERG EXTD {-1.0,0.0}
|
||||
[344] = "%1d", -- Fuel Dump Switch, ON/OFF
|
||||
[343] = "%1d", -- External Centerline Tank Fuel Control Switch, STOP/NORM/ORIDE {-1.0,0.0}
|
||||
[342] = "%1d", -- External Wing Tanks Fuel Control Switch, STOP/NORM/ORIDE {-1.0,0.0}
|
||||
-- Cockpit Mechanics
|
||||
[453] = "%1d", -- Canopy Control Switch, OPEN/HOLD/CLOSE {-1.0,0.0,1.0}
|
||||
[43] = "%1d", -- Canopy Jettison Handle Unlock Button - Press to unlock
|
||||
[42] = "%1d", -- Canopy Jettison Handle - Pull to jettison
|
||||
[510] = "%1d", -- Ejection Control Handle (3 times)
|
||||
[511] = "%1d", -- Ejection Seat SAFE/ARMED Handle, SAFE/ARMED
|
||||
[512] = "%1d", -- Ejection Seat Manual Override Handle, PULL/PUSH
|
||||
[513] = "%1d", -- Shoulder Harness Control Handle, LOCK/UNLOCK
|
||||
[514] = "%1d", -- Seat Height Adjustment Switch, UP/HOLD/DOWN {-1.0,0.0,1.0}
|
||||
[260] = "%1d", -- Rudder Pedal Adjust Lever
|
||||
[575] = "%1d", -- Hide Stick toggle
|
||||
-- Exterior Lights
|
||||
[338] = "%.2f", -- POSITION Lights Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[337] = "%.2f", -- FORMATION Lights Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[339] = "%1d", -- STROBE Lights Switch, BRT/OFF/DIM {-1.0,0.0,1.0}
|
||||
[237] = "%1d", -- LDG/TAXI LIGHT Switch, ON/OFF
|
||||
-- Cockpit Lights
|
||||
[413] = "%.2f", -- CONSOLES Lights Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[414] = "%.2f", -- INST PNL Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[415] = "%.2f", -- FLOOD Light Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[419] = "%1d", -- MODE Switch, NVG/NITE/DAY {-1.0,0.0,1.0}
|
||||
[418] = "%.2f", -- CHART Light Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[417] = "%.2f", -- WARN/CAUTION Dimmer Control {0.0,1.0} in 0.15 Steps
|
||||
[416] = "%1d", -- Lights Test Switch, TEST/OFF
|
||||
[14] = "%1d", -- MASTER CAUTION Reset Button - Press to reset
|
||||
[239] = "%1d", -- HOOK BYPASS Switch, FIELD/CARRIER
|
||||
-- Oxygen System
|
||||
[365] = "%1d", -- OBOGS Control Switch, ON/OFF
|
||||
[366] = "%.2f", -- OXY Flow Knob {0.0,1.0} in 0.5 Steps
|
||||
-- ECS
|
||||
[411] = "%.1f", -- Bleed Air Knob, R OFF/NORM/L OFF/OFF {0.0,0.1,0.2,0.3}
|
||||
[412] = "%1d", -- Bleed Air Knob, AUG PULL
|
||||
[405] = "%1d", -- ECS Mode Switch, AUTO/MAN/ OFF/RAM {-1.0,0.0,1.0}
|
||||
[408] = "%1d", -- Cabin Pressure Switch, NORM/DUMP/ RAM/DUMP {-1.0,0.0,1.0}
|
||||
[451] = "%.2f", -- Defog Handle {0.0,1.0} in 0.1 Steps
|
||||
[407] = "%.2f", -- Cabin Temperature Knob {0.0,1.0} in 0.1 Steps
|
||||
[406] = "%.2f", -- Suit Temperature Knob {0.0,1.0} in 0.1 Steps
|
||||
[297] = "%1d", -- AV COOL Switch, NORM/EMERG
|
||||
[452] = "%1d", -- Windshield Anti-Ice/Rain Switch, ANTI ICE/OFF/RAIN {-1.0,0.0,1.0}
|
||||
[505] = "%.2f", -- Left Louver {0.0,1.0} in 0.1 Steps
|
||||
[506] = "%.2f", -- Right Louver {0.0,1.0} in 0.1 Steps
|
||||
-- HOTAS
|
||||
[494] = "%1d", -- Exterior Lights Switch, ON/OFF
|
||||
-- Master Arm Panel
|
||||
[458] = "%1d", -- Master Mode Button, A/A
|
||||
[459] = "%1d", -- Master Mode Button, A/G
|
||||
[49] = "%1d", -- Master Arm Switch, ARM/SAFE
|
||||
[50] = "%1d", -- Emergency Jettison Button
|
||||
[258] = "%1d", -- Auxiliary Release Switch, ENABLE/NORM
|
||||
[153] = "%1d", -- Station Jettison Select Button, CENTER
|
||||
[155] = "%1d", -- Station Jettison Select Button, LEFT IN
|
||||
[157] = "%1d", -- Station Jettison Select Button, LEFT OUT
|
||||
[159] = "%1d", -- Station Jettison Select Button, RIGHT IN
|
||||
[161] = "%1d", -- Station Jettison Select Button, RIGHT OUT
|
||||
[235] = "%1d", -- Selective Jettison Pushbutton
|
||||
[236] = "%1d", -- Selective Jettison Knob, L FUS MSL/SAFE/R FUS MSL/ RACK/LCHR /STORES {0.0,0.1,0.2,0.3,0.4}
|
||||
[135] = "%.1f", -- IR Cooling Switch, ORIDE/NORM/OFF {0.0,0.1,0.2}
|
||||
-- Fire Systems
|
||||
[46] = "%1d", -- Fire Extinguisher Pushbutton
|
||||
[30] = "%1d", -- APU Fire Warning/Extinguisher Light
|
||||
[11] = "%1d", -- Left Engine/AMAD Fire Warning/Extinguisher Light - (LMB) depress
|
||||
[12] = "%1d", -- Left Engine/AMAD Fire Warning/Extinguisher Light - (RMB) cover control
|
||||
[27] = "%1d", -- Right Engine/AMAD Fire Warning/Extinguisher Light - (LMB) depress
|
||||
[28] = "%1d", -- Right Engine/AMAD Fire Warning/Extinguisher Light - (RMB) cover control
|
||||
-- Multipurpose Display Group -----------
|
||||
-- Head-Up Display
|
||||
[140] = "%1d", -- HUD Symbology Reject Switch, NORM/REJ 1/REJ 2 {0.0,0.1,0.2}
|
||||
[141] = "%.2f", -- HUD Symbology Brightness Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[142] = "%1d", -- HUD Symbology Brightness Selector Knob, DAY/NIGHT
|
||||
[143] = "%.2f", -- HUD Black Level Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[144] = "%1d", -- HUD Video Control Switch, W/B /VID/OFF {0.0,0.1,0.2}
|
||||
[145] = "%.2f", -- HUD Balance Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[146] = "%.2f", -- HUD AOA Indexer Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[147] = "%1d", -- HUD Altitude Switch, BARO/RDR
|
||||
[148] = "%1d", -- HUD Attitude Selector Switch, INS/AUTO/STBY {-1.0,0.0,1.0}
|
||||
-- Left MDI
|
||||
[51] = "%1d", -- Left MDI Brightness Selector Knob, OFF/NIGHT/DAY {0.0,0.1,0.2}
|
||||
[52] = "%.2f", -- Left MDI Brightness Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[53] = "%.2f", -- Left MDI Contrast Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[54] = "%1d", -- Left MDI PB 1
|
||||
[55] = "%1d", -- Left MDI PB 2
|
||||
[56] = "%1d", -- Left MDI PB 3
|
||||
[57] = "%1d", -- Left MDI PB 4
|
||||
[58] = "%1d", -- Left MDI PB 5
|
||||
[59] = "%1d", -- Left MDI PB 6
|
||||
[60] = "%1d", -- Left MDI PB 7
|
||||
[61] = "%1d", -- Left MDI PB 8
|
||||
[62] = "%1d", -- Left MDI PB 9
|
||||
[63] = "%1d", -- Left MDI PB 10
|
||||
[64] = "%1d", -- Left MDI PB 11
|
||||
[65] = "%1d", -- Left MDI PB 12
|
||||
[66] = "%1d", -- Left MDI PB 13
|
||||
[67] = "%1d", -- Left MDI PB 14
|
||||
[68] = "%1d", -- Left MDI PB 15
|
||||
[69] = "%1d", -- Left MDI PB 16
|
||||
[70] = "%1d", -- Left MDI PB 17
|
||||
[72] = "%1d", -- Left MDI PB 18
|
||||
[73] = "%1d", -- Left MDI PB 19
|
||||
[75] = "%1d", -- Left MDI PB 20
|
||||
[312] = "%1d", -- Heading Set Switch
|
||||
[313] = "%1d", -- Course Set Switch
|
||||
-- Right MDI
|
||||
[76] = "%.1f", -- Right MDI Brightness Selector Knob, OFF/NIGHT/DAY {0.0,0.1,0.2}
|
||||
[77] = "%.2f", -- Right MDI Brightness Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[78] = "%.2f", -- Right MDI Contrast Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[79] = "%1d", -- Right MDI PB 1
|
||||
[80] = "%1d", -- Right MDI PB 2
|
||||
[81] = "%1d", -- Right MDI PB 3
|
||||
[82] = "%1d", -- Right MDI PB 4
|
||||
[83] = "%1d", -- Right MDI PB 5
|
||||
[84] = "%1d", -- Right MDI PB 6
|
||||
[85] = "%1d", -- Right MDI PB 7
|
||||
[86] = "%1d", -- Right MDI PB 8
|
||||
[87] = "%1d", -- Right MDI PB 9
|
||||
[88] = "%1d", -- Right MDI PB 10
|
||||
[89] = "%1d", -- Right MDI PB 11
|
||||
[90] = "%1d", -- Right MDI PB 12
|
||||
[91] = "%1d", -- Right MDI PB 13
|
||||
[92] = "%1d", -- Right MDI PB 14
|
||||
[93] = "%1d", -- Right MDI PB 15
|
||||
[94] = "%1d", -- Right MDI PB 16
|
||||
[95] = "%1d", -- Right MDI PB 17
|
||||
[96] = "%1d", -- Right MDI PB 18
|
||||
[97] = "%1d", -- Right MDI PB 19
|
||||
[98] = "%1d", -- Right MDI PB 20
|
||||
-- AMPCD
|
||||
[203] = "%.2f", -- AMPCD Off/Brightness Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[177] = "%1d", -- AMPCD Night/Day Brightness Selector, DAY/NGT {1.0,0.0,-1.0}
|
||||
[179] = "%1d", -- AMPCD Symbology Control Switch, UP/DOWN {1.0,0.0,-1.0}
|
||||
[182] = "%1d", -- AMPCD Contrast Control Switch, UP/DOWN {1.0,0.0,-1.0}
|
||||
[180] = "%1d", -- AMPCD Gain Control Switch, UP/DOWN {1.0,0.0,-1.0}
|
||||
[183] = "%1d", -- AMPCD PB 1
|
||||
[184] = "%1d", -- AMPCD PB 2
|
||||
[185] = "%1d", -- AMPCD PB 3
|
||||
[186] = "%1d", -- AMPCD PB 4
|
||||
[187] = "%1d", -- AMPCD PB 5
|
||||
[188] = "%1d", -- AMPCD PB 6
|
||||
[189] = "%1d", -- AMPCD PB 7
|
||||
[190] = "%1d", -- AMPCD PB 8
|
||||
[191] = "%1d", -- AMPCD PB 9
|
||||
[192] = "%1d", -- AMPCD PB 10
|
||||
[193] = "%1d", -- AMPCD PB 11
|
||||
[194] = "%1d", -- AMPCD PB 12
|
||||
[195] = "%1d", -- AMPCD PB 13
|
||||
[196] = "%1d", -- AMPCD PB 14
|
||||
[197] = "%1d", -- AMPCD PB 15
|
||||
[198] = "%1d", -- AMPCD PB 16
|
||||
[199] = "%1d", -- AMPCD PB 17
|
||||
[200] = "%1d", -- AMPCD PB 18
|
||||
[201] = "%1d", -- AMPCD PB 19
|
||||
[202] = "%1d", -- AMPCD PB 20
|
||||
-- Instruments --------------------------
|
||||
-- Standby Pressure Altimeter AAU-52/A
|
||||
[224] = "%.2f", -- AAU-52 Altimeter Pressure Setting Knob {0.0,1.0} in 0.04 Steps
|
||||
-- Radar Altimeter Height Indicator
|
||||
[291] = "%.2f", -- Push to Test Switch, (MW) rotate clockwise to apply power and set low altitude index pointer {0.0,1.0} in 0.1 Steps
|
||||
[292] = "%1d", -- Push to Test Switch, (LMB) activate BIT checks
|
||||
[213] = "%1d", -- SAI Cage Knob, (LMB) Pull to cage
|
||||
[214] = "%.2f", -- SAI Cage Knob, (MW) Adjust miniature airplane {0.0,1.0} in 0.1 Steps
|
||||
[215] = "%1d", -- SAI Test Button - Push to test
|
||||
-- Integrated Fuel/Engine Indicator (IFEI)
|
||||
[168] = "%1d", -- IFEI Mode Button
|
||||
[169] = "%1d", -- IFEI QTY Button
|
||||
[170] = "%1d", -- IFEI Up Arrow Button
|
||||
[171] = "%1d", -- IFEI Down Arrow Button
|
||||
[172] = "%1d", -- IFEI ZONE Button
|
||||
[173] = "%1d", -- IFEI ET Button
|
||||
[174] = "%.2f", -- IFEI Brightness Control Knob {0.0,1.0} in 0.1 Steps
|
||||
-- Sensor panel
|
||||
[440] = "%.1f", -- RADAR Switch (MW to pull), OFF/STBY/OPR/EMERG(PULL) {0.0,1.0} {0.0,0.1,0.2,0.3}
|
||||
[443] = "%.1f", -- INS Switch, OFF/CV/GND/NAV/IFA/GYRO/GB/TEST {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7}
|
||||
-- UFC
|
||||
[128] = "%1d", -- UFC Function Selector Pushbutton, A/P
|
||||
[129] = "%1d", -- UFC Function Selector Pushbutton, IFF
|
||||
[130] = "%1d", -- UFC Function Selector Pushbutton, TCN
|
||||
[131] = "%1d", -- UFC Function Selector Pushbutton, ILS
|
||||
[132] = "%1d", -- UFC Function Selector Pushbutton, D/L
|
||||
[133] = "%1d", -- UFC Function Selector Pushbutton, BCN
|
||||
[134] = "%1d", -- UFC Function Selector Pushbutton, ON/OFF
|
||||
[100] = "%1d", -- UFC Option Select Pushbutton 1
|
||||
[101] = "%1d", -- UFC Option Select Pushbutton 2
|
||||
[102] = "%1d", -- UFC Option Select Pushbutton 3
|
||||
[103] = "%1d", -- UFC Option Select Pushbutton 4
|
||||
[106] = "%1d", -- UFC Option Select Pushbutton 5
|
||||
[111] = "%1d", -- UFC Keyboard Pushbutton, 1
|
||||
[112] = "%1d", -- UFC Keyboard Pushbutton, 2
|
||||
[113] = "%1d", -- UFC Keyboard Pushbutton, 3
|
||||
[114] = "%1d", -- UFC Keyboard Pushbutton, 4
|
||||
[115] = "%1d", -- UFC Keyboard Pushbutton, 5
|
||||
[116] = "%1d", -- UFC Keyboard Pushbutton, 6
|
||||
[117] = "%1d", -- UFC Keyboard Pushbutton, 7
|
||||
[118] = "%1d", -- UFC Keyboard Pushbutton, 8
|
||||
[119] = "%1d", -- UFC Keyboard Pushbutton, 9
|
||||
[120] = "%1d", -- UFC Keyboard Pushbutton, 0
|
||||
[121] = "%1d", -- UFC Keyboard Pushbutton, CLR
|
||||
[122] = "%1d", -- UFC Keyboard Pushbutton, ENT
|
||||
[99] = "%1d", -- UFC I/P Pushbutton
|
||||
[110] = "%1d", -- UFC Emission Control Pushbutton
|
||||
[107] = "%1d", -- UFC ADF Function Select Switch, 1/OFF/2 {-1.0,0.0,1.0}
|
||||
[108] = "%.2f", -- UFC COMM 1 Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[123] = "%.2f", -- UFC COMM 2 Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[109] = "%.2f", -- UFC Brightness Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[125] = "%1d", -- UFC COMM 1 Channel Selector Knob
|
||||
[124] = "%.2f", -- UFC COMM 1 Channel Selector Knob {0.0,1.0} in 0.2 Steps
|
||||
[127] = "%1d", -- UFC COMM 2 Channel Selector Knob
|
||||
[126] = "%.2f", -- UFC COMM 2 Channel Selector Knob {0.0,1.0} in 0.2 Steps
|
||||
-- intercom
|
||||
[357] = "%.2f", -- VOX Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[358] = "%.2f", -- ICS Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[359] = "%.2f", -- RWR Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[360] = "%.2f", -- WPN Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[361] = "%.2f", -- MIDS B Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[362] = "%.2f", -- MIDS A Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[363] = "%.2f", -- TACAN Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[364] = "%.2f", -- AUX Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[350] = "%1d", -- Comm Relay Switch, CIPHER/OFF/PLAIN {-1.0,0.0,1.0}
|
||||
[351] = "%1d", -- COMM G XMT Switch, COMM 1/OFF/COMM 2 {-1.0,0.0,1.0}
|
||||
[356] = "%1d", -- IFF Master Switch, EMER/NORM
|
||||
[355] = "%1d", -- IFF Mode 4 Switch, DIS/AUD /DIS/OFF {-1.0,0.0,1.0}
|
||||
[354] = "%1d", -- CRYPTO Switch, HOLD/NORM/ZERO {-1.0,0.0,1.0}
|
||||
[353] = "%1d", -- ILS UFC/MAN Switch, UFC/MAN
|
||||
[352] = "%.2f", -- ILS Channel Selector Switch {0.0,0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.90,0.95}
|
||||
[230] = "%1d", -- Warning Tone Silence Button - Push to silence
|
||||
-- KY-58
|
||||
[444] = "%.1f", -- KY-58 Mode Select Knob, P/C/LD/RV {0.0,0.1,0.2,0.3}
|
||||
[445] = "%.2f", -- KY-58 Volume Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[446] = "%.1f", -- KY-58 Fill Select Knob, Z 1-5/1/2/3/4/5/6/Z ALL {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7}
|
||||
[447] = "%.1f", -- KY-58 Power Select Knob, OFF/ON/TD {0.0,0.1,0.2}
|
||||
-- antenna selector
|
||||
[373] = "%1d", -- COMM 1 Antenna Selector Switch, UPPER/AUTO/LOWER {-1.0,0.0,1.0}
|
||||
[374] = "%1d", -- IFF Antenna Selector Switch, UPPER/BOTH/LOWER {-1.0,0.0,1.0}
|
||||
-- RWR
|
||||
[277] = "%1d", -- ALR-67 POWER Pushbutton
|
||||
[275] = "%1d", -- ALR-67 DISPLAY Pushbutton
|
||||
[272] = "%1d", -- ALR-67 SPECIAL Pushbutton
|
||||
[269] = "%1d", -- ALR-67 OFFSET Pushbutton
|
||||
[266] = "%1d", -- ALR-67 BIT Pushbutton
|
||||
[263] = "%.2f", -- ALR-67 DMR Control Knob {0.0,1.0} in 0.1 Steps
|
||||
[262] = "%.2f", -- ALR-67 AUDIO Control Knob (no function){0.0,1.0} in 0.1 Steps
|
||||
[261] = "%.1f", -- ALR-67 DIS TYPE Switch, N/I/A/U/F {0.0,0.1,0.2,0.3,0.4}
|
||||
[216] = "%.2f", -- ALR-67 RWR Intensity Knob {0.0,1.0} in 0.1 Steps
|
||||
-- CMDS
|
||||
[380] = "%1d", -- Dispense Button - Push to dispense flares and chaff
|
||||
[517] = "%.1f", -- DISPENSER Switch, BYPASS/ON/OFF {0.0,0.1,0.2}
|
||||
[515] = "%1d", -- ECM JETT JETT SEL Button - Push to jettison
|
||||
-- ICMCP
|
||||
[248] = "%.1f", -- ECM Mode Switch, XMIT/REC/BIT/STBY/OFF {0.0,0.1,0.2,0.3,0.4}
|
||||
-- Helmet
|
||||
[136] = "%.2f" -- HMD OFF/BRT Knob {0.0,0.75} in 0.01 Steps
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
]]
|
||||
|
||||
--ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
|
||||
-- IFEI - Engine, Fuel and Clock informations
|
||||
local lEngineFuelClock = ExportScript.Tools.getListIndicatorValue(5)
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog('EngineFuelClock: '..ExportScript.Tools.dump(lEngineFuelClock))
|
||||
end
|
||||
|
||||
if lEngineFuelClock ~= nil and lEngineFuelClock.txt_RPM_R ~= nil then
|
||||
-- Engine informations 3 character
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_R, 3)) -- right RPM
|
||||
ExportScript.Tools.SendData(2001, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_L, 3)) -- left RPM
|
||||
ExportScript.Tools.SendData(2002, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_R, 3)) -- right TEMP
|
||||
ExportScript.Tools.SendData(2003, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_L, 3)) -- left TEMP
|
||||
ExportScript.Tools.SendData(2004, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_R, 3)) -- right Fuel flow
|
||||
ExportScript.Tools.SendData(2005, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_L, 3)) -- left Fuel flow
|
||||
ExportScript.Tools.SendData(2006, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_R, 3)) -- right OilPress
|
||||
ExportScript.Tools.SendData(2007, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_L, 3)) -- left OilPress
|
||||
|
||||
-- Fuel informations 6 character
|
||||
ExportScript.Tools.SendData(2008, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_UP, 6)) -- up Fuel
|
||||
ExportScript.Tools.SendData(2009, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_DOWN, 6)) -- down Fuel
|
||||
ExportScript.Tools.SendData(2010, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_BINGO, 6)) -- BINGO
|
||||
|
||||
-- Clock 8 character
|
||||
ExportScript.Tools.SendData(2011, ExportScript.Tools.DisplayFormat(string.format("%s¦%s¦%s", lEngineFuelClock.txt_CLOCK_H, lEngineFuelClock.txt_CLOCK_M, lEngineFuelClock.txt_CLOCK_S), 8)) -- Clock HH:MM:SS
|
||||
else
|
||||
-- Engine informations 3 character
|
||||
ExportScript.Tools.SendData(2000, " ") -- right RPM
|
||||
ExportScript.Tools.SendData(2001, " ") -- left RPM
|
||||
ExportScript.Tools.SendData(2002, " ") -- right TEMP
|
||||
ExportScript.Tools.SendData(2003, " ") -- left TEMP
|
||||
ExportScript.Tools.SendData(2004, " ") -- right Fuel flow
|
||||
ExportScript.Tools.SendData(2005, " ") -- left Fuel flow
|
||||
ExportScript.Tools.SendData(2006, " ") -- right OilPress
|
||||
ExportScript.Tools.SendData(2007, " ") -- left OilPress
|
||||
|
||||
-- Fuel informations 6 character
|
||||
ExportScript.Tools.SendData(2008, " ") -- up Fuel
|
||||
ExportScript.Tools.SendData(2009, " ") -- down Fuel
|
||||
ExportScript.Tools.SendData(2010, " ") -- BINGO
|
||||
|
||||
-- Clock 8 character
|
||||
ExportScript.Tools.SendData(2011, " ") -- Clock HH:MM:SS
|
||||
end
|
||||
|
||||
-- UFC Displays
|
||||
local lUFCDisplays = ExportScript.Tools.getListIndicatorValue(6)
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog('UFC: '..ExportScript.Tools.dump(lUFCDisplays))
|
||||
end
|
||||
|
||||
if lUFCDisplays ~= nil and lUFCDisplays.UFC_MainDummy ~= nil then
|
||||
-- ScratchPadString Displays
|
||||
lUFCDisplays.UFC_ScratchPadString1Display = string.gsub(lUFCDisplays.UFC_ScratchPadString1Display, "_", "-") -- fix weil das ein - sein sollte
|
||||
lUFCDisplays.UFC_ScratchPadString2Display = string.gsub(lUFCDisplays.UFC_ScratchPadString2Display, "_", "-") -- fix weil das ein - sein sollte
|
||||
lUFCDisplays.UFC_ScratchPadString1Display = string.gsub(lUFCDisplays.UFC_ScratchPadString1Display, "~", "2") -- fix weil das eine 2 sein sollte
|
||||
lUFCDisplays.UFC_ScratchPadString2Display = string.gsub(lUFCDisplays.UFC_ScratchPadString2Display, "~", "2") -- fix weil das eine 2 sein sollte
|
||||
lUFCDisplays.UFC_ScratchPadString1Display = string.gsub(lUFCDisplays.UFC_ScratchPadString1Display, "`", "1") -- fix weil das eine 1 sein sollte
|
||||
lUFCDisplays.UFC_ScratchPadString2Display = string.gsub(lUFCDisplays.UFC_ScratchPadString2Display, "`", "1") -- fix weil das eine 1 sein sollte
|
||||
ExportScript.Tools.SendData(2020, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_ScratchPadString1Display, 2)) -- ScratchPadString1Display 2 character
|
||||
ExportScript.Tools.SendData(2021, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_ScratchPadString2Display, 2)) -- ScratchPadString2Display 2 character
|
||||
ExportScript.Tools.SendData(2022, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_ScratchPadNumberDisplay, 7)) -- ScratchPadNumberDisplay 7 character
|
||||
|
||||
local lTmpCueing = " "
|
||||
-- Option Displays
|
||||
lTmpCueing = (#lUFCDisplays.UFC_OptionCueing1 > 0 and "¦" or " ")
|
||||
ExportScript.Tools.SendData(2023, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay1)) -- OptionDisplay1 5 character
|
||||
lTmpCueing = (#lUFCDisplays.UFC_OptionCueing2 > 0 and "¦" or " ")
|
||||
ExportScript.Tools.SendData(2024, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay2)) -- OptionDisplay2 5 character
|
||||
lTmpCueing = (#lUFCDisplays.UFC_OptionCueing3 > 0 and "¦" or " ")
|
||||
ExportScript.Tools.SendData(2025, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay3)) -- OptionDisplay3 5 character
|
||||
lTmpCueing = (#lUFCDisplays.UFC_OptionCueing4 > 0 and "¦" or " ")
|
||||
ExportScript.Tools.SendData(2026, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay4)) -- OptionDisplay4 5 character
|
||||
lTmpCueing = (#lUFCDisplays.UFC_OptionCueing5 > 0 and "¦" or " ")
|
||||
ExportScript.Tools.SendData(2027, ExportScript.Tools.DisplayFormat(lTmpCueing..lUFCDisplays.UFC_OptionDisplay5)) -- OptionDisplay5 5 character
|
||||
|
||||
-- Comm Displays
|
||||
lUFCDisplays.UFC_Comm1Display = string.gsub(lUFCDisplays.UFC_Comm1Display, "~", "2") -- fix weil das eine 2 sein sollte
|
||||
lUFCDisplays.UFC_Comm2Display = string.gsub(lUFCDisplays.UFC_Comm2Display, "~", "2") -- fix weil das eine 2 sein sollte
|
||||
lUFCDisplays.UFC_Comm1Display = string.gsub(lUFCDisplays.UFC_Comm1Display, "`", "1") -- fix weil das eine 1 sein sollte
|
||||
lUFCDisplays.UFC_Comm2Display = string.gsub(lUFCDisplays.UFC_Comm2Display, "`", "1") -- fix weil das eine 1 sein sollte
|
||||
ExportScript.Tools.SendData(2028, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_Comm1Display, 2)) -- Comm1Display 2 character
|
||||
ExportScript.Tools.SendData(2029, ExportScript.Tools.DisplayFormat(lUFCDisplays.UFC_Comm2Display, 2)) -- Comm2Display 2 character
|
||||
else
|
||||
-- ScratchPadString Displays
|
||||
ExportScript.Tools.SendData(2020, " ") -- ScratchPadString1Display 2 character
|
||||
ExportScript.Tools.SendData(2021, " ") -- ScratchPadString2Display 2 character
|
||||
ExportScript.Tools.SendData(2022, " ") -- ScratchPadNumberDisplay 7 character
|
||||
|
||||
-- Option Displays
|
||||
ExportScript.Tools.SendData(2023, " ") -- OptionDisplay1 5 character
|
||||
ExportScript.Tools.SendData(2024, " ") -- OptionDisplay2 5 character
|
||||
ExportScript.Tools.SendData(2025, " ") -- OptionDisplay3 5 character
|
||||
ExportScript.Tools.SendData(2026, " ") -- OptionDisplay4 5 character
|
||||
ExportScript.Tools.SendData(2027, " ") -- OptionDisplay5 5 character
|
||||
|
||||
-- Comm Displays
|
||||
ExportScript.Tools.SendData(2028, " ") -- Comm1Display 2 character
|
||||
ExportScript.Tools.SendData(2029, " ") -- Comm2Display 2 character
|
||||
end
|
||||
|
||||
local lUHF1Radio = GetDevice(39)
|
||||
ExportScript.Tools.SendData(2030, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF1Radio:get_frequency()/1000000))), 7)
|
||||
|
||||
local lUHF2Radio = GetDevice(40)
|
||||
ExportScript.Tools.SendData(2031, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF2Radio:get_frequency()/1000000), "7.3", false, 0.005)), 7)
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config
|
||||
]]
|
||||
|
||||
-- IFEI - Engine, Fuel and Clock informations
|
||||
local lEngineFuelClock = ExportScript.Tools.getListIndicatorValue(5)
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog('EngineFuelClock: '..ExportScript.Tools.dump(lEngineFuelClock))
|
||||
end
|
||||
|
||||
if lEngineFuelClock ~= nil and lEngineFuelClock.txt_RPM_R ~= nil then
|
||||
-- Engine informations 3 character
|
||||
ExportScript.Tools.SendDataDAC(2000, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_R, 3, "r", true)) -- right RPM
|
||||
ExportScript.Tools.SendDataDAC(2001, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_RPM_L, 3, "r", true)) -- left RPM
|
||||
ExportScript.Tools.SendDataDAC(2002, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_R, 3, "r", true)) -- right TEMP
|
||||
ExportScript.Tools.SendDataDAC(2003, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_TEMP_L, 3, "r", true)) -- left TEMP
|
||||
ExportScript.Tools.SendDataDAC(2004, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_R, 3, "r", true)) -- right Fuel flow
|
||||
ExportScript.Tools.SendDataDAC(2005, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FF_L, 3, "r", true)) -- left Fuel flow
|
||||
ExportScript.Tools.SendDataDAC(2006, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_R, 3, "r", true)) -- right OilPress
|
||||
ExportScript.Tools.SendDataDAC(2007, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_OilPress_L, 3, "r", true)) -- left OilPress
|
||||
|
||||
-- Fuel informations 6 character
|
||||
ExportScript.Tools.SendDataDAC(2008, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_UP:match("%d+"), 6, "r", true)) -- up Fuel
|
||||
ExportScript.Tools.SendDataDAC(2009, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_FUEL_DOWN:match("%d+"), 6, "r", true)) -- down Fuel
|
||||
ExportScript.Tools.SendDataDAC(2010, ExportScript.Tools.DisplayFormat(lEngineFuelClock.txt_BINGO:match("%d+"), 6, "r", true)) -- BINGO
|
||||
|
||||
-- Clock 8 character
|
||||
ExportScript.Tools.SendDataDAC(2011, ExportScript.Tools.DisplayFormat(string.format("%s.%s.$s", lEngineFuelClock.txt_CLOCK_H, lEngineFuelClock.txt_CLOCK_M, lEngineFuelClock.txt_CLOCK_S)), 8, "r", true) -- Clock HH:MM:SS
|
||||
else
|
||||
-- Engine informations 3 character
|
||||
ExportScript.Tools.SendDataDAC(2000, "-") -- right RPM
|
||||
ExportScript.Tools.SendDataDAC(2001, "-") -- left RPM
|
||||
ExportScript.Tools.SendDataDAC(2002, "-") -- right TEMP
|
||||
ExportScript.Tools.SendDataDAC(2003, "-") -- left TEMP
|
||||
ExportScript.Tools.SendDataDAC(2004, "-") -- right Fuel flow
|
||||
ExportScript.Tools.SendDataDAC(2005, "-") -- left Fuel flow
|
||||
ExportScript.Tools.SendDataDAC(2006, "-") -- right OilPress
|
||||
ExportScript.Tools.SendDataDAC(2007, "-") -- left OilPress
|
||||
|
||||
-- Fuel informations 5 character
|
||||
ExportScript.Tools.SendDataDAC(2008, "-") -- up Fuel
|
||||
ExportScript.Tools.SendDataDAC(2009, "-") -- down Fuel
|
||||
ExportScript.Tools.SendDataDAC(2010, "-") -- BINGO
|
||||
|
||||
-- Clock 8 character
|
||||
ExportScript.Tools.SendDataDAC(2011, "-") -- Clock HH:MM:SS
|
||||
end
|
||||
|
||||
local lUHF1Radio = GetDevice(39)
|
||||
ExportScript.Tools.SendDataDAC(2030, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF1Radio:get_frequency()/1000000))), 7)
|
||||
|
||||
local lUHF2Radio = GetDevice(40)
|
||||
ExportScript.Tools.SendDataDAC(2031, ExportScript.Tools.DisplayFormat(ExportScript.Tools.RoundFreqeuncy((lUHF2Radio:get_frequency()/1000000), "7.3", false, 0.005)), 7)
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 13, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
--ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 73, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
File diff suppressed because it is too large
Load Diff
+103
-122
@@ -1,10 +1,20 @@
|
||||
-- FW-190D9 Dora
|
||||
-- Version 0.9.9
|
||||
|
||||
gES_FoundDCSModule = true
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.FW190D9 = "1.2.0"
|
||||
|
||||
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
|
||||
[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}
|
||||
@@ -24,7 +34,7 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
||||
[41] = "%.4f", -- Slipball {-1.0, 1.0}
|
||||
--oxygen pressure indicator
|
||||
[112] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0}
|
||||
[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
--[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
--Remote compass
|
||||
[45] = "%.4f", -- CompassHeading {0.0, 1.0}
|
||||
[44] = "%.4f", -- CommandedCourse {0.0, 1.0}
|
||||
@@ -53,30 +63,34 @@ gES_GlassCockpitConfigEveryFrameArguments =
|
||||
[58] = "%.4f", -- Ammo_Counter_3 {0.0, 500.0} = {0.0, 1.0}
|
||||
[61] = "%.4f", -- Ammo_Counter_4 {0.0, 500.0} = {0.0, 1.0}
|
||||
-- Gun_Fire
|
||||
[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
||||
[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
||||
[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
||||
[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
||||
--[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
||||
--[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
||||
--[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
||||
--[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
||||
--Target System
|
||||
[133] = "%.4f", -- TargetDist {0.0, 10.0, 100.0, 300.0, 600.0, 700.0, 800.0, 1000.0} = {0.0, 0.0, 0.323, 0.568, 0.709, 0.813, 0.917, 1.0}
|
||||
--Bomb Lamps
|
||||
[196] = "%1d", -- BombLamp_1 {0.0, 1.0}
|
||||
[197] = "%1d", -- BombLamp_2 {0.0, 1.0}
|
||||
[198] = "%1d", -- BombLamp_3 {0.0, 1.0}
|
||||
[199] = "%1d", -- BombLamp_4 {0.0, 1.0}
|
||||
[137] = "%1d", -- RocketEmCvr {0.0, 1.0}
|
||||
[196] = "%.f", -- BombLamp_1 {0.0, 1.0}
|
||||
[197] = "%.f", -- BombLamp_2 {0.0, 1.0}
|
||||
[198] = "%.f", -- BombLamp_3 {0.0, 1.0}
|
||||
[199] = "%.f", -- BombLamp_4 {0.0, 1.0}
|
||||
[137] = "%.f", -- RocketEmCvr {0.0, 1.0}
|
||||
--Gear Lamps
|
||||
[68] = "%1d", -- L_GEAR_UP {0.0, 1.0}
|
||||
[69] = "%1d", -- L_GEAR_DOWN {0.0, 1.0}
|
||||
[70] = "%1d", -- R_GEAR_UP {0.0, 1.0}
|
||||
[71] = "%1d", -- R_GEAR_DOWN {0.0, 1.0}
|
||||
[68] = "%.f", -- L_GEAR_UP {0.0, 1.0}
|
||||
[69] = "%.f", -- L_GEAR_DOWN {0.0, 1.0}
|
||||
[70] = "%.f", -- R_GEAR_UP {0.0, 1.0}
|
||||
[71] = "%.f", -- R_GEAR_DOWN {0.0, 1.0}
|
||||
--Flaps Lamps
|
||||
[72] = "%1d", -- FLAPS_UP {0.0, 1.0}
|
||||
[73] = "%1d", -- FLAPS_START {0.0, 1.0}
|
||||
[72] = "%.f", -- FLAPS_UP {0.0, 1.0}
|
||||
[73] = "%.f", -- FLAPS_START {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
|
||||
[160] = "%1d", -- Cold Start/Wind Screen Washer {0, 1}
|
||||
--Engine Control Panel
|
||||
@@ -88,7 +102,7 @@ gES_GlassCockpitConfigArguments =
|
||||
--Fuel system
|
||||
[90] = "%.1f", -- Fuel Tank Selector Valve (CLOSE/FORWARD/AFT/BOTH) {0.0, 0.1, 0.2, 0.3}
|
||||
[99] = "%.1f", -- Fuel Gauge Selector (FORWARD/NONE/AFT) {0.0, 0.5, 1.0}
|
||||
--[161] = "%1d", -- "MW-B4 Selector (Not Functional)
|
||||
[161] = "%1d", -- MW-B4 Selector (Not Functional)
|
||||
[162] = "%1d", -- Primer Pump {0, 1}
|
||||
--electric system
|
||||
[79] = "%1d", -- Electric Kill-switch
|
||||
@@ -143,7 +157,7 @@ gES_GlassCockpitConfigArguments =
|
||||
--Trimmer
|
||||
[77] = "%1d", -- Stabilizer Trimmer Up/Down {-1, 0, 1}
|
||||
--Clock
|
||||
[24] = "%.2f", -- Turnable Bezel (axis) in 0.2 steps
|
||||
[24] = "%.4f", -- Turnable Bezel (axis) in 0.2 steps
|
||||
[25] = "%.2f", -- Wind/Set Knob (axis) in 0.1 steps
|
||||
[26] = "%1d", -- Start - Stop Button {0, 1}
|
||||
[28] = "%1d", -- Stopwatch Button {0, 1}
|
||||
@@ -184,88 +198,47 @@ gES_GlassCockpitConfigArguments =
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance
|
||||
function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice)
|
||||
if gES_GlassCockpitType == 1 then
|
||||
-- HELIOS Version 1.3
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
-- HawgTouch Version 1.6
|
||||
-- Altimeter_km, Altimeter_m, Altimeter_Pressure
|
||||
SendData("2000", string.format("%0.3f;%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(35),
|
||||
mainPanelDevice:get_argument_value(32),
|
||||
mainPanelDevice:get_argument_value(33)))
|
||||
|
||||
-- LwAtt - AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball
|
||||
SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(38),
|
||||
mainPanelDevice:get_argument_value(37),
|
||||
mainPanelDevice:get_argument_value(40),
|
||||
mainPanelDevice:get_argument_value(41)))
|
||||
|
||||
-- LwHead - CompassHeading, CommandedCourse liefert nur 0.000
|
||||
SendData("2002", string.format("%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(45),
|
||||
mainPanelDevice:get_argument_value(44)))
|
||||
|
||||
-- LwClock - CLOCK_currtime_hours, CLOCK_currtime_minutes, CLOCK_currtime_seconds, CLOCK_chrono_minutes
|
||||
SendData("2003", string.format("%0.3f;%0.3f;%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(21),
|
||||
mainPanelDevice:get_argument_value(22),
|
||||
mainPanelDevice:get_argument_value(23),
|
||||
mainPanelDevice:get_argument_value(27)))
|
||||
|
||||
-- LwDblP - Oil_Pressure; Fuel_Pressure;
|
||||
SendData("2004", string.format("%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(95),
|
||||
mainPanelDevice:get_argument_value(94)))
|
||||
|
||||
-- now not ID
|
||||
-- LwAFN2 - AFN2_Horizontal_Needle, AFN2_Vertical_Needle, AFN2_Signal_Lamp
|
||||
--SendData("2005", string.format("%0.3f;%0.3f;%0.3f",
|
||||
-- mainPanelDevice:get_argument_value(),
|
||||
-- mainPanelDevice:get_argument_value(),
|
||||
-- mainPanelDevice:get_argument_value()))
|
||||
|
||||
-- Gear - L_GEAR_UP, L_GEAR_DOWN, R_GEAR_UP, R_GEAR_DOWN, FLAPS_UP, FLAPS_START, FLAPS_DOWN
|
||||
SendData("2007", string.format("%0.3f;%0.3f;%0.3f;%0.3f;%0.3f;%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(68),
|
||||
mainPanelDevice:get_argument_value(69),
|
||||
mainPanelDevice:get_argument_value(70),
|
||||
mainPanelDevice:get_argument_value(71),
|
||||
mainPanelDevice:get_argument_value(72),
|
||||
mainPanelDevice:get_argument_value(73),
|
||||
mainPanelDevice:get_argument_value(74)))
|
||||
-- Ammo counter 1
|
||||
SendData("2008", string.format("%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(52),
|
||||
mainPanelDevice:get_argument_value(50)))
|
||||
-- Ammo counter 2
|
||||
SendData("2009", string.format("%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(55),
|
||||
mainPanelDevice:get_argument_value(164)))
|
||||
-- Ammo counter 3
|
||||
SendData("2010", string.format("%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(58),
|
||||
mainPanelDevice:get_argument_value(165)))
|
||||
-- Ammo counter 4
|
||||
SendData("2011", string.format("%0.3f;%0.3f",
|
||||
mainPanelDevice:get_argument_value(61),
|
||||
mainPanelDevice:get_argument_value(166)))
|
||||
end
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
--[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0}
|
||||
--[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0}
|
||||
--[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0}
|
||||
--[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0}
|
||||
--[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
ExportScript.Tools.SendData(50, string.format("%.4f", mainPanelDevice:get_argument_value(50))) -- Gun_Fire_1 {0.0, 1.0}
|
||||
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}
|
||||
ExportScript.Tools.SendData(166, string.format("%.4f", mainPanelDevice:get_argument_value(166))) -- Gun_Fire_4 {0.0, 1.0}
|
||||
ExportScript.Tools.SendData(113, string.format("%.4f", mainPanelDevice:get_argument_value(113))) -- Oxygen_Flow_Blinker {0.0, 1.0}
|
||||
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()) --
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
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
|
||||
|
||||
-----------------------------------------------------
|
||||
@@ -273,48 +246,56 @@ end
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSConfigLowImportance
|
||||
function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice)
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ProcessHARDWAREConfigLowImportance(mainPanelDevice)
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
every frame export to hardware
|
||||
export in low tick interval to DAC
|
||||
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
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params()))
|
||||
WriteToLog('CMSP: '..dump(list_indication(7)))
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 13, 1 do
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
--WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 73, 1 do
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
WriteToLog(ltmp2..': '..dump(ltmp1))
|
||||
WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1)))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function genericRadio(key, value, hardware)
|
||||
end
|
||||
-----------------------------
|
||||
@@ -0,0 +1,727 @@
|
||||
-- J-11A Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.J11A = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / J-11A --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-MACH Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1600hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
ExportScript.AF.FC_Russian_AOA_Su2733()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_20000()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, main scala, second scala, ExportID)
|
||||
ExportScript.AF.FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 70, 71)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, main scala, second scala, ExportID)
|
||||
ExportScript.AF.FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 72, 73)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU27(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
-- Engine Lamps, Start and Afterburner
|
||||
ExportScript.AF.FC_EngineLamps_SU2733(lFunctionTyp)
|
||||
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.MechanicalDevicesIndicator(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
|
||||
--ExportScript.Tools.WriteToLog('lMechInfo.noseflap.value: '..ExportScript.Tools.dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
ExportScript.AF.FC_Russian_AirIntake()
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU27(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.MechanicalDevicesIndicator(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
ExportScript.AF.FC_EngineLamps_SU2733(lFunctionTyp)
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem()
|
||||
ExportScript.AF.PPDSPPanel()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.SightingSystem()
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 )
|
||||
end
|
||||
|
||||
function ExportScript.AF.PPDSPPanel()
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
--[chaff] = number: "96"
|
||||
--[flare] = number: "96"
|
||||
|
||||
local lChaffLED = ExportScript.Tools.round(lSnares.chaff / 12, 0, "ceil") + 1
|
||||
local lFlareLED = ExportScript.Tools.round(lSnares.flare / 12, 0, "ceil") + 1
|
||||
|
||||
ExportScript.Tools.SendDataDAC("800", (lChaffLED <= 1 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("801", (lChaffLED <= 2 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("802", (lChaffLED <= 3 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("803", (lChaffLED <= 4 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("804", (lChaffLED <= 5 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("805", (lChaffLED <= 6 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("806", (lChaffLED <= 7 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("807", (lChaffLED <= 8 and 0 or 1) )
|
||||
|
||||
ExportScript.Tools.SendDataDAC("810", (lFlareLED <= 1 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("811", (lFlareLED <= 2 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("812", (lFlareLED <= 3 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("813", (lFlareLED <= 4 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("814", (lFlareLED <= 5 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("815", (lFlareLED <= 6 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("816", (lFlareLED <= 7 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("817", (lFlareLED <= 8 and 0 or 1) )
|
||||
end
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lAccelerationUnits: '..ExportScript.Tools.dump(lAccelerationUnits))
|
||||
ExportScript.Tools.SendDataDAC("732", (lAccelerationUnits.y > 8.0 and 1 or 0) ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FuelQuantityIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("300", string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10) ) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
ExportScript.Tools.SendDataDAC("304", (lEngineInfo.fuel_internal < 5600.0 and 1 or 0) ) -- Tank warning 1
|
||||
ExportScript.Tools.SendDataDAC("305", (lEngineInfo.fuel_internal < 4500.0 and 1 or 0) ) -- Tank warning 2
|
||||
ExportScript.Tools.SendDataDAC("306", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0) ) -- Tank warning 3
|
||||
ExportScript.Tools.SendDataDAC("307", (lEngineInfo.fuel_internal < 800.0 and 1 or 0) ) -- Tank warning 4
|
||||
ExportScript.Tools.SendDataDAC("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0) ) -- Bingo Fuel
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
local lTotalFuel_9_3 = 0
|
||||
local lTotalFuel_5_0 = 0
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
|
||||
if lTotalFuel < 9000 then
|
||||
if lTotalFuel > 3000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 3000 -- minimaler Eingangswert
|
||||
x_max = 9000 -- maximaler Eingangswert
|
||||
x = 8000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 6000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 1.66666666666666666666666666667e-4 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0,5 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.83333 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_9_3 = 1.6666666666666666666666666666667e-4 * lTotalFuel + -0.5
|
||||
else
|
||||
lTotalFuel_9_3 = 0.0
|
||||
end
|
||||
else
|
||||
lTotalFuel_9_3 = 1.0
|
||||
end
|
||||
if lTotalFuel < 5000 then
|
||||
lTotalFuel_5_0 = lTotalFuel / 5000
|
||||
else
|
||||
lTotalFuel_5_0 = 1.0
|
||||
end
|
||||
|
||||
-- TotalFuel_5_0
|
||||
-- TotalFuel_9_3
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- BingoLight
|
||||
ExportScript.Tools.SendData(300, lTotalFuel_5_0)
|
||||
ExportScript.Tools.SendData(301, lTotalFuel_9_3)
|
||||
ExportScript.Tools.SendData(302, (lEngineInfo.fuel_internal < 5600.0 and 1 or 0)) -- Tank warning 1
|
||||
ExportScript.Tools.SendData(303, (lEngineInfo.fuel_internal < 4500.0 and 1 or 0)) -- Tank warning 2
|
||||
ExportScript.Tools.SendData(304, (lEngineInfo.fuel_internal < 1500.0 and 1 or 0)) -- Tank warning 3
|
||||
ExportScript.Tools.SendData(305, (lEngineInfo.fuel_internal < 800.0 and 1 or 0)) -- Tank warning 4
|
||||
ExportScript.Tools.SendData(306, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.MechanicalDevicesIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--ExportScript.Tools.WriteToLog('lTrueAirSpeed: '..ExportScript.Tools.dump(lTrueAirSpeed))
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ) ) -- gear warning light
|
||||
ExportScript.Tools.SendDataDAC("501", (lMechInfo.gear.value > 0.85 and 1 or 0) ) -- nose gear
|
||||
ExportScript.Tools.SendDataDAC("502", (lMechInfo.gear.value > 0.95 and 1 or 0) ) -- left gear
|
||||
ExportScript.Tools.SendDataDAC("503", (lMechInfo.gear.value > 0.97 and 1 or 0) ) -- right gear
|
||||
|
||||
ExportScript.Tools.SendDataDAC("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0) ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
ExportScript.Tools.SendDataDAC("531", (lMechInfo.flaps.value > 0.93 and 1 or 0) ) -- flap
|
||||
ExportScript.Tools.SendDataDAC("532", ((lMechInfo.gear.value > 0.5 and lMechInfo.gear.nose.rod > 0.02) and 1 or 0) ) -- Intake FOD shields
|
||||
ExportScript.Tools.SendDataDAC("533", ((lMechInfo.gear.status == 0 and lMechInfo.flaps.value > 0.93) and 1 or 0) ) -- Flaps Warning, same light as gear warning light, but blinking light
|
||||
|
||||
ExportScript.Tools.SendDataDAC("541", (lMechInfo.parachute.value < 0.5 and 1 or 0) ) -- Parachute
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
local lWarningLight = 0.0
|
||||
|
||||
--lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 0.5 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = ((lMechInfo.gear.status == 0 and lMechInfo.flaps.value > 0.93) and 1.0 or lWarningLight ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
|
||||
ExportScript.Tools.SendData(500, string.format("%.1f", lWarningLight))
|
||||
ExportScript.Tools.SendData(501, (lMechInfo.gear.value > 0.85 and 1 or 0)) -- nose gear
|
||||
ExportScript.Tools.SendData(502, (lMechInfo.gear.value > 0.95 and 1 or 0)) -- left gear
|
||||
ExportScript.Tools.SendData(503, (lMechInfo.gear.value == 1 and 1 or 0)) -- right gear
|
||||
ExportScript.Tools.SendData(510, (lMechInfo.speedbrakes.value > 0.1 and 1 or 0)) -- speedbreakes on > 0.1 (0 - 1)
|
||||
ExportScript.Tools.SendData(531, (lMechInfo.flaps.value > 0.93 and 1 or 0)) -- flap
|
||||
ExportScript.Tools.SendData(532, ((lMechInfo.gear.value > 0.5 and lMechInfo.gear.nose.rod > 0.02) and 1 or 0)) -- Intake FOD shields
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FC_WeaponPanel_SU27(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanelPresend == nil then
|
||||
ExportScript.AF.TmpWeaponPanelPresend = {[101] = 0, [102] = 0, [103] = 0, [104] = 0, [105] = 0, [106] = 0, [107] = 0, [108] = 0, [109] = 0, [110] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanelActive == nil then
|
||||
ExportScript.AF.TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanel == nil then
|
||||
ExportScript.AF.TmpWeaponPanel = {[231] = 0, [232] = 0, [233] = 0, [234] = 0, [235] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.EventNumberFC_WeaponPanel == nil then
|
||||
ExportScript.AF.EventNumberFC_WeaponPanel = 0
|
||||
end
|
||||
|
||||
if(ExportScript.AF.EventNumberFC_WeaponPanel < ExportScript.AF.EventNumber) then
|
||||
ExportScript.AF.EventNumberFC_WeaponPanel = ExportScript.AF.EventNumber
|
||||
|
||||
-- defination
|
||||
ExportScript.AF.PayloadInfo = LoGetPayloadInfo()
|
||||
if ExportScript.AF.PayloadInfo ~= nil then
|
||||
if ExportScript.AF.CurrentStationTmp == nil then
|
||||
ExportScript.AF.CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if ExportScript.AF.PayloadInfo.CurrentStation > 0 and
|
||||
ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then
|
||||
ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation
|
||||
|
||||
ExportScript.AF.TmpStationToPanel = {}
|
||||
ExportScript.AF.TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- left
|
||||
ExportScript.AF.TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- right
|
||||
ExportScript.AF.TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202 }
|
||||
ExportScript.AF.TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209 }
|
||||
ExportScript.AF.TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203 }
|
||||
ExportScript.AF.TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208 }
|
||||
ExportScript.AF.TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204 }
|
||||
ExportScript.AF.TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207 }
|
||||
ExportScript.AF.TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205 }
|
||||
ExportScript.AF.TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206 }
|
||||
|
||||
-- ExportScript.AF.TmpWeaponPanelActive reset
|
||||
for i = 201, 210, 1 do
|
||||
ExportScript.AF.TmpWeaponPanelActive[i] = 0
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation] ~= nil then
|
||||
ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value
|
||||
|
||||
table.foreach(ExportScript.AF.PayloadInfo.Stations, ExportScript.AF.WeaponStatusPanel_selectCurrentPayloadStation) -- corresponding station
|
||||
end
|
||||
end
|
||||
|
||||
local lWeaponType = 0.0 -- transversely striped
|
||||
if ExportScript.AF.PayloadInfo.CurrentStation > 0 then
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level1 == 4 then
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle
|
||||
lWeaponType = 0.1 -- MSL
|
||||
elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket
|
||||
lWeaponType = 0.2 -- RCT
|
||||
end
|
||||
elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb
|
||||
lWeaponType = 0.3 -- BB
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
---------------------------------------------------
|
||||
| | | | | | | | | | |
|
||||
1 2 3 4 5 C 6 7 8 9 10 -- display
|
||||
1 3 5 7 9 10 8 6 4 2 -- Paylod ID
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
|
||||
-- WeaponPresend1 {0, 1}
|
||||
-- WeaponPresend2 {0, 1}
|
||||
-- WeaponPresend3 {0, 1}
|
||||
-- WeaponPresend4 {0, 1}
|
||||
-- WeaponPresend5 {0, 1}
|
||||
-- WeaponPresend6 {0, 1}
|
||||
-- WeaponPresend7 {0, 1}
|
||||
-- WeaponPresend8 {0, 1}
|
||||
-- WeaponPresend9 {0, 1}
|
||||
-- WeaponPresend10 {0, 1}
|
||||
-- WeaponActive1 {0, 1}
|
||||
-- WeaponActive2 {0, 1}
|
||||
-- WeaponActive3 {0, 1}
|
||||
-- WeaponActive4 {0, 1}
|
||||
-- WeaponActive5 {0, 1}
|
||||
-- WeaponActive6 {0, 1}
|
||||
-- WeaponActive7 {0, 1}
|
||||
-- WeaponActive8 {0, 1}
|
||||
-- WeaponActive9 {0, 1}
|
||||
-- WeaponActive10 {0, 1}
|
||||
|
||||
ExportScript.AF.TmpWeaponPanelPresend[101] = (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0) -- weapon presend panel 1
|
||||
ExportScript.AF.TmpWeaponPanelPresend[102] = (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0) -- weapon presend panel 2
|
||||
ExportScript.AF.TmpWeaponPanelPresend[103] = (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0) -- weapon presend panel 3
|
||||
ExportScript.AF.TmpWeaponPanelPresend[104] = (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0) -- weapon presend panel 4
|
||||
ExportScript.AF.TmpWeaponPanelPresend[105] = (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0) -- weapon presend panel 5
|
||||
ExportScript.AF.TmpWeaponPanelPresend[106] = (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0) -- weapon presend panel 6
|
||||
ExportScript.AF.TmpWeaponPanelPresend[107] = (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0) -- weapon presend panel 7
|
||||
ExportScript.AF.TmpWeaponPanelPresend[108] = (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0) -- weapon presend panel 8
|
||||
ExportScript.AF.TmpWeaponPanelPresend[109] = (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0) -- weapon presend panel 9
|
||||
ExportScript.AF.TmpWeaponPanelPresend[110] = (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0) -- weapon presend panel 10
|
||||
--ExportScript.AF.TmpWeaponPanelActive[201] -- weapon active panel 1
|
||||
--ExportScript.AF.TmpWeaponPanelActive[202] -- weapon active panel 2
|
||||
--ExportScript.AF.TmpWeaponPanelActive[203] -- weapon active panel 3
|
||||
--ExportScript.AF.TmpWeaponPanelActive[204] -- weapon active panel 4
|
||||
--ExportScript.AF.TmpWeaponPanelActive[205] -- weapon active panel 5
|
||||
--ExportScript.AF.TmpWeaponPanelActive[206] -- weapon active panel 6
|
||||
--ExportScript.AF.TmpWeaponPanelActive[207] -- weapon active panel 7
|
||||
--ExportScript.AF.TmpWeaponPanelActive[208] -- weapon active panel 8
|
||||
--ExportScript.AF.TmpWeaponPanelActive[209] -- weapon active panel 9
|
||||
--ExportScript.AF.TmpWeaponPanelActive[210] -- weapon active panel 10
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do
|
||||
ExportScript.Tools.SendData(key, value)
|
||||
end
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do
|
||||
ExportScript.Tools.SendData(key, value)
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do
|
||||
ExportScript.Tools.SendDataDAC(key, value)
|
||||
end
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do
|
||||
ExportScript.Tools.SendDataDAC(key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,852 @@
|
||||
-- L-39C
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.L39C = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
-- Front Seat
|
||||
-- Mechanic clock
|
||||
[67] = "%.4f", -- CLOCK currtime hours
|
||||
[68] = "%.4f", -- CLOCK currtime minutes
|
||||
[70] = "%.4f", -- CLOCK seconds meter time seconds
|
||||
[73] = "%.4f", -- CLOCK flight time meter status
|
||||
[71] = "%.4f", -- CLOCK flight hours
|
||||
[72] = "%.4f", -- CLOCK flight minutes
|
||||
[69] = "%.4f", -- CLOCK seconds meter time minutes
|
||||
-- Radar altimeter RV-5
|
||||
[58] = "%.4f", -- RV-5 RALT {0.0, 0.086, 0.439, 0.878, 0.955}{0.0, 20.0, 100.0, 700.0, 800.0}
|
||||
[59] = "%.4f", -- RV-5 DangerRALT index {0.0, 0.094, 0.48, 0.998}{0.0, 20.0, 100.0, 700.0}
|
||||
[63] = "%.f", -- RV-5 DangerRALT lamp
|
||||
[62] = "%.4f", -- RV-5 warning flag
|
||||
-- Variometer
|
||||
[74] = "%.4f", -- Variometer {-1.0, -0.875, -0.775, -0.44, 0.0, 0.44, 0.775, 0.875, 1.0}{-80.0, -50.0, -20.0, -10.0, 0.0, 10.0, 20.0, 50.0, 80.0}
|
||||
[76] = "%.4f", -- Variometer sideslip {-1.0, 1.0}
|
||||
[75] = "%.4f", -- Variometer turn {-1.0, -0.58, -0.275, 0.275, 0.58, 1.0} {-math.rad(5.7), math.rad(-3.8), math.rad(-1.9), math.rad(1.9), math.rad(3.8), math.rad(5.7)}
|
||||
-- KPP (ADI)
|
||||
[38] = "%.4f", -- KPP 1273K roll {-1.0, 1.0} {-math.pi, math.pi}
|
||||
--[31] = "%.4f", -- KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
--[40] = "%.4f", -- KPP 1273K sideslip {-1.0, 1.0}
|
||||
[35] = "%.4f", -- KPP Course Deviation Bar {-1.0, 1.0}
|
||||
[34] = "%.4f", -- KPP Alt Deviation Bar {-1.0, 1.0}
|
||||
[36] = "%1d", -- KPP Glide Beacon
|
||||
[37] = "%1d", -- KPP Localizer Beacon
|
||||
[29] = "%.4f", -- KPP Arretir
|
||||
[32] = "%.4f", -- KPP SDU Roll {-1.0, 1.0}
|
||||
[33] = "%.4f", -- KPP SDU Pitch {-1.0, 1.0}
|
||||
-- NPP (HSI)
|
||||
--[41] = "%.4f", -- HSI heading {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
--[42] = "%.4f", -- HSI commanded course needle (yellow needle) {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
[43] = "%.4f", -- HSI bearing needle {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
[47] = "%.4f", -- HSI Course Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[45] = "%.4f", -- HSI Alt Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[46] = "%.4f", -- HSI Glide Beacon G
|
||||
[44] = "%.4f", -- HSI Localizer Beacon K
|
||||
-- RSBN
|
||||
--[189] = "%.4f", -- RSBN NAV Chan {0.0, 0.39} {1.0, 40.0}
|
||||
--[190] = "%.4f", -- RSBN LAND Chan {0.0, 0.39} {1.0, 40.0}
|
||||
[66] = "%.4f", -- RSBN Range 100
|
||||
[65] = "%.4f", -- RSBN Range 10
|
||||
[64] = "%.4f", -- RSBN Range 1
|
||||
[580] = "%.4f", -- RSBN PanelLightsLmp
|
||||
-- Barometric altimeter VD-20
|
||||
[52] = "%.4f", -- VD-20 km {0.0, 1.0}{0.0, 20.0}
|
||||
[53] = "%.4f", -- VD-20 m {0.0, 1.0}{0.0, 1000.0}
|
||||
[54] = "%.4f", -- VD-20 km Ind {0.0, 1.0}{0.0, 20.0}
|
||||
[55] = "%.4f", -- VD-20 m Ind {0.0, 1.0}{0.0, 1000.0}
|
||||
--[56] = "%.4f", -- VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
-- Barometric altimeter
|
||||
-- Altimeter Feet , copy of A-10 altimeter
|
||||
[637] = "%.4f", -- Altimeter_100_footPtr {0.0, 1.0}{0.0, 1000.0}
|
||||
[632] = "%.4f", -- Altimeter_10000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[631] = "%.4f", -- Altimeter_1000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[630] = "%.4f", -- Altimeter_100_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[636] = "%.4f", -- pressure_setting_0 {0.0, 1.0}{0.0, 10.0}
|
||||
[635] = "%.4f", -- pressure_setting_1 {0.0, 1.0}{0.0, 10.0}
|
||||
[634] = "%.4f", -- pressure_setting_2 {0.0, 1.0}{0.0, 10.0}
|
||||
[633] = "%.4f", -- pressure_setting_3 {0.0, 1.0}{0.0, 10.0}
|
||||
-- AIRSPEED AND MACH
|
||||
[49] = "%.4f", -- IAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[50] = "%.4f", -- TAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[51] = "%.4f", -- MACH
|
||||
-- RKL-41
|
||||
[77] = "%.4f", -- RKL-41 needle {0.0, 1.0}{0.0, math.pi * 2.0}
|
||||
[156] = "%.4f", -- RKL-41 Signal
|
||||
[531] = "%.4f", -- KM-8 heading {0.0, 1.0}{0.0, math.pi * 2.0}
|
||||
[530] = "%.4f", -- KM-8 variation {1.0, -1.0}{-math.pi, math.pi}
|
||||
-- electric interface
|
||||
[92] = "%.4f", -- Voltmeter {0.0, 1.0}{0.0, 40.0}
|
||||
[93] = "%.4f", -- Ampermeter {0.0, 1.0}{-100.0, 300.0}
|
||||
-- oxygen interface
|
||||
[301] = "%.4f", -- OxygenPressure {0.0, 0.025, 0.925, 1.0}{0.0, 10.0, 150.0, 160.0}
|
||||
[302] = "%.4f", -- FlowBlinker
|
||||
-- accelerometer
|
||||
[86] = "%.4f", -- Acceleration {0.0, 1.0}{-5.0, 10.0}
|
||||
[88] = "%.4f", -- AccelerationMin {0.31, 0.695}{-5.0, 1.0}
|
||||
[87] = "%.4f", -- AccelerationMax {0.0, 1.0}{-5.0, 10.0}
|
||||
--
|
||||
[95] = "%.4f", -- CockpitAlt {0.0, 1.0}{0.0, 20000.0}
|
||||
[96] = "%.4f", -- PressDiff {0.0, 0.102, 0.202, 0.398, 0.779, 1.0}{-0.04, -0.02, 0.0, 0.1, 0.4, 0.6}
|
||||
-- Hydro Pressure
|
||||
[198] = "%.4f", -- MainHydro PRESS {0.0, 1.0}{0.0, 200.0}
|
||||
[200] = "%.4f", -- AuxHydro PRESS {0.0, 1.0}{0.0, 200.0}
|
||||
[98] = "%.4f", -- BrakeLMainHydro PRESS {0.0, 1.0}{0.0, 60.0}
|
||||
[99] = "%.4f", -- BrakeRMainHydro PRESS {0.0, 1.0}{0.0, 60.0}
|
||||
[100] = "%.4f", -- BrakeAuxHydro PRESS {0.0, 1.0}{0.0, 60.0}
|
||||
-- Fuel Quantity
|
||||
[91] = "%.4f", -- Fuel Quantity {0.0, 0.127, 0.239, 0.35, 0.458, 0.56, 0.685, 0.82, 1.0}{0.0, 100.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 825.0}
|
||||
-- Fan RPM
|
||||
[85] = "%.4f", -- Fan RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Compressor RPM
|
||||
[84] = "%.4f", -- Compressor RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Oil
|
||||
[83] = "%.4f", -- Oil Temp {0.0, 0.323, 0.576, 0.817, 1.0}{-50.0, 0.0, 50.0, 100.0, 150.0}
|
||||
[82] = "%.4f", -- Oil Press {0.0, 0.077, 1.0}{-1.0, 0.0, 6.0}
|
||||
-- Fuel Press
|
||||
[81] = "%.4f", -- Fuel Press {0.0, 0.06, 0.148, 0.323, 0.547, 0.659, 0.801, 1.0}{-1.0, 0.0, 20.0, 40.0, 60.0, 70.0, 80.0, 100.0}
|
||||
-- Engine Temp
|
||||
[90] = "%.4f", -- Engine Temp {0.0, 1.0}{0.0, 900.0}
|
||||
-- EngineVibration
|
||||
[94] = "%.4f", -- EngineVibration {0.0, 1.0}{0.0, 100.0}
|
||||
-- PitchTrimInd
|
||||
[247] = "%.4f", -- PitchTrimInd {1.0, -1.0}{-1.0, 1.0}
|
||||
-- lights system
|
||||
--[533] = "%.4f", -- CptInstrumentLightsIntensity
|
||||
--[558] = "%.4f", -- CompassLightIntensity
|
||||
--[555] = "%.4f", -- EmergencyLightIntensity
|
||||
-- RKL-41 Radio Compass
|
||||
[561] = "%.f", -- FarNDBSelectorLamp
|
||||
[570] = "%.f", -- NearNDBSelectorLamp
|
||||
[563] = "%.f", -- PanelLights
|
||||
-- BrakeHandle
|
||||
[127] = "%.4f", -- BrakeHandle
|
||||
-- Lamps
|
||||
[18] = "%.f", -- MRP 56
|
||||
[6] = "%.f", -- MainGenerator
|
||||
[9] = "%.f", -- ReserveGennerator
|
||||
[12] = "%.f", -- Inverter115
|
||||
[16] = "%.f", -- Inverter363
|
||||
[316] = "%.f", -- GroundPower
|
||||
[278] = "%.f", -- FlapsUp
|
||||
[279] = "%.f", -- FlapsTO
|
||||
[280] = "%.f", -- FlapsDn
|
||||
[117] = "%.f", -- AirBrakes
|
||||
[113] = "%.f", -- GearDown front
|
||||
[112] = "%.f", -- GearDown left
|
||||
[114] = "%.f", -- GearDown right
|
||||
[110] = "%.f", -- GearUp front
|
||||
[109] = "%.f", -- GearUp left
|
||||
[111] = "%.f", -- GearUp right
|
||||
[115] = "%.f", -- ExtendGears
|
||||
[116] = "%.f", -- DoorsOut
|
||||
[185] = "%.f", -- RSBN Azim Correction
|
||||
[186] = "%.f", -- RSBN Range Correction
|
||||
[15] = "%.f", -- BreakdownFinished
|
||||
[123] = "%.f", -- GA TILT
|
||||
[206] = "%.f", -- GA TILT PU26
|
||||
[2] = "%.f", -- DangerAltitude
|
||||
[27] = "%.f", -- EmergFuel
|
||||
[23] = "%.f", -- TurboStarter
|
||||
[4] = "%.f", -- Remain150
|
||||
[7] = "%.f", -- DoNotStart
|
||||
[26] = "%.f", -- FuelFilter
|
||||
[14] = "%.f", -- WingTanks
|
||||
[246] = "%.f", -- TrimmerRollNeutral
|
||||
[3] = "%.f", -- MachMeterLamp
|
||||
[10] = "%.f", -- CanopyNotClosed
|
||||
[556] = "%.f", -- LeftPitot
|
||||
[557] = "%.f", -- RightPitot
|
||||
[8] = "%.f", -- Vibration
|
||||
[1] = "%.f", -- Fire
|
||||
[28] = "%.f", -- EngineTemperature700
|
||||
[24] = "%.f", -- EngineTemperature730
|
||||
[20] = "%.f", -- EngineMinOilPressure
|
||||
[359] = "%.f", -- RSBN Azim Correct
|
||||
[362] = "%.f", -- RSBN Range Correct
|
||||
[19] = "%.f", -- HSI Accordance
|
||||
[11] = "%.f", -- CockpitPressure
|
||||
[22] = "%.f", -- ConditioningClosed
|
||||
[25] = "%.f", -- Defrost
|
||||
[21] = "%.f", -- Ice
|
||||
[182] = "%.f", -- RIO HeatingOk
|
||||
[5] = "%.f", -- HydraulicPressureDrop
|
||||
[253] = "%.f", -- MasterDanger
|
||||
[17] = "%.f", -- EmergConditioning
|
||||
[562] = "%.f", -- RadioUnderControl
|
||||
-- Back Seat
|
||||
-- Mechanic clock
|
||||
[405] = "%.4f", -- Backseat - CLOCK currtime hours
|
||||
[406] = "%.4f", -- Backseat - CLOCK currtime minutes
|
||||
[408] = "%.4f", -- Backseat - CLOCK seconds meter time seconds
|
||||
[411] = "%.4f", -- Backseat - CLOCK flight time meter status
|
||||
[409] = "%.4f", -- Backseat - CLOCK flight hours
|
||||
[410] = "%.4f", -- Backseat - CLOCK flight minutes
|
||||
[407] = "%.4f", -- Backseat - CLOCK seconds meter time minutes
|
||||
-- Radar altimeter RV-5
|
||||
[396] = "%.4f", -- Backseat - RV-5 RALT {0.0, 0.086, 0.439, 0.878, 0.955}{0.0, 20.0, 100.0, 700.0, 800.0}
|
||||
[397] = "%.4f", -- Backseat - RV-5 DangerRALT index {0.0, 0.094, 0.48, 0.998}{0.0, 20.0, 100.0, 700.0}
|
||||
[401] = "%.f", -- Backseat - RV-5 DangerRALT lamp
|
||||
[400] = "%.4f", -- Backseat - RV-5 warning flag
|
||||
-- Variometer
|
||||
[416] = "%.4f", -- Backseat - Variometer {-1.0, -0.875, -0.775, -0.44, 0.0, 0.44, 0.775, 0.875, 1.0}{-80.0, -50.0, -20.0, -10.0, 0.0, 10.0, 20.0, 50.0, 80.0}
|
||||
[418] = "%.4f", -- Backseat - Variometer sideslip {-1.0, 1.0}
|
||||
[417] = "%.4f", -- Backseat - Variometer turn {-1.0, 1.0} {-math.rad(6.0), math.rad(6.0)}
|
||||
-- KPP (ADI)
|
||||
[375] = "%.4f", -- Backseat - KPP 1273K roll {-1.0, 1.0} {-math.pi, math.pi}
|
||||
[368] = "%.4f", -- Backseat - KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
[377] = "%.4f", -- Backseat - KPP 1273K sideslip {-1.0, 1.0}
|
||||
[372] = "%.4f", -- Backseat - KPP Course Deviation Bar {-1.0, 1.0}
|
||||
[373] = "%.4f", -- Backseat - KPP Glide Beacon
|
||||
[374] = "%.4f", -- Backseat - KPP Localizer Beacon
|
||||
[366] = "%.4f", -- Backseat - KPP Arretir
|
||||
[369] = "%.4f", -- Backseat - KPP SDU Roll {-1.0, 1.0}
|
||||
[370] = "%.4f", -- Backseat - KPP SDU Pitch {-1.0, 1.0}
|
||||
-- NPP HSI
|
||||
[378] = "%.4f", -- Backseat - HSI2 heading {1.0, 0.0}{0.0, math.pi * 2.0}
|
||||
[379] = "%.4f", -- Backseat - HSI2 commanded course needle {1.0, 0.0}{0.0, math.pi * 2.0}
|
||||
[380] = "%.4f", -- Backseat - HSI2 bearing needle {1.0, 0.0}{0.0, math.pi * 2.0}
|
||||
[384] = "%.4f", -- Backseat - HSI2 Course Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[382] = "%.4f", -- Backseat - HSI2 Alt Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[383] = "%.4f", -- Backseat - HSI2 Glide Beacon
|
||||
[381] = "%.4f", -- Backseat - HSI2 Localizer Beacon
|
||||
-- RSPN
|
||||
[404] = "%.4f", -- Backseat - RSBN Range 100
|
||||
[403] = "%.4f", -- Backseat - RSBN Range 10
|
||||
[402] = "%.4f", -- Backseat - RSBN Range 1
|
||||
-- Barometric altimeter VD-20 instructor
|
||||
[389] = "%.4f", -- Backseat - VD-20 km {0.0, 1.0}{0.0, 20.0}
|
||||
[390] = "%.4f", -- Backseat - VD-20 m {0.0, 1.0}{0.0, 1000.0}
|
||||
[391] = "%.4f", -- Backseat - VD-20 km Ind {0.0, 1.0}{0.0, 20.0}
|
||||
[392] = "%.4f", -- Backseat - VD-20 m Ind {0.0, 1.0}{0.0, 1000.0}
|
||||
--[393] = "%.4f", -- Backseat - VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
-- Barometric altimeter
|
||||
-- Altimeter Feet , copy of A-10 altimeter
|
||||
[737] = "%.4f", -- Altimeter_100_footPtr {0.0, 1.0}{0.0, 1000.0}
|
||||
[732] = "%.4f", -- Altimeter_10000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[731] = "%.4f", -- Altimeter_1000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[730] = "%.4f", -- Altimeter_100_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[736] = "%.4f", -- pressure_setting_0 {0.0, 1.0}{0.0, 10.0}
|
||||
[735] = "%.4f", -- pressure_setting_1 {0.0, 1.0}{0.0, 10.0}
|
||||
[734] = "%.4f", -- pressure_setting_2 {0.0, 1.0}{0.0, 10.0}
|
||||
[733] = "%.4f", -- pressure_setting_3 {0.0, 1.0}{0.0, 10.0}
|
||||
-- AIRSPEED AND MACH
|
||||
[386] = "%.4f", -- Backseat - IAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[387] = "%.4f", -- Backseat - TAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[388] = "%.4f", -- Backseat - MACH 2
|
||||
-- RKL-41
|
||||
[420] = "%.4f", -- Backseat - RKL-41 needle {0.0, 1.0}{0.0, math.pi * 2.0}
|
||||
[513] = "%.4f", -- Backseat - RKL-41 Signal
|
||||
-- oxygen interface
|
||||
[477] = "%.4f", -- Backseat - OxygenPressure {0.0, 0.025, 0.925, 1.0}{0.0, 10.0, 150.0, 160.0}
|
||||
[478] = "%.4f", -- Backseat - FlowBlinker
|
||||
-- accelerometer
|
||||
[550] = "%.4f", -- Backseat - CockpitAlt {0.0, 1.0}{0.0, 20000.0}
|
||||
[551] = "%.4f", -- Backseat - PressDiff {0.0, 0.102, 0.202, 0.398, 0.779, 1.0}{-0.04, -0.02, 0.0, 0.1, 0.4, 0.6}
|
||||
-- Fuel Quantity
|
||||
[427] = "%.4f", -- Backseat - Fuel Quantity {0.0, 0.127, 0.239, 0.35, 0.458, 0.56, 0.685, 0.82, 1.0}{0.0, 100.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 825.0}
|
||||
-- Fan RPM
|
||||
[425] = "%.4f", -- Backseat - Fan RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Compressor RPM
|
||||
[424] = "%.4f", -- Backseat - Compressor RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Oil
|
||||
[423] = "%.4f", -- Backseat - Oil Temp {0.0, 0.323, 0.576, 0.817, 1.0}{-50.0, 0.0, 50.0, 100.0, 150.0}
|
||||
[422] = "%.4f", -- Backseat - Oil Press {0.0, 0.077, 1.0}{-1.0, 0.0, 6.0}
|
||||
-- Fuel Press
|
||||
[421] = "%.4f", -- Backseat - Fuel Press {0.0, 0.06, 0.148, 0.323, 0.547, 0.659, 0.801, 1.0}{-1.0, 0.0, 20.0, 40.0, 60.0, 70.0, 80.0, 100.0}
|
||||
-- lights system
|
||||
--[559] = "%.4f", -- Backseat - CptInstrumentLightsIntensity
|
||||
-- RKL-41 Radio Compass
|
||||
[564] = "%.f", -- Backseat - FarNDBSelectorLamp CP
|
||||
[571] = "%.f", -- Backseat - NearNDBSelectorLamp CP
|
||||
[566] = "%.f", -- Backseat - RKL PanelLights
|
||||
-- BrakeHandle
|
||||
[542] = "%.4f", -- Backseat - BrakeHandle CP
|
||||
-- Lamps
|
||||
[358] = "%.f", -- Backseat - MRP 56 Instructor
|
||||
[347] = "%.f", -- Backseat - MainGen Instructor
|
||||
[350] = "%.f", -- Backseat - ReserveGen Instructor
|
||||
[353] = "%.f", -- Backseat - Inverter115 Instructor
|
||||
[357] = "%.f", -- Backseat - Inverter363 Instructor
|
||||
[462] = "%.f", -- Backseat - FlapsUp
|
||||
[463] = "%.f", -- Backseat - FlapsTO
|
||||
[464] = "%.f", -- Backseat - FlapsDn
|
||||
[436] = "%.f", -- Backseat - AirBrakes
|
||||
[432] = "%.f", -- Backseat - GearDown front
|
||||
[431] = "%.f", -- Backseat - GearDown left
|
||||
[433] = "%.f", -- Backseat - GearDown right
|
||||
[429] = "%.f", -- Backseat - GearUp front
|
||||
[428] = "%.f", -- Backseat - GearUp left
|
||||
[430] = "%.f", -- Backseat - GearUp right
|
||||
[434] = "%.f", -- Backseat - ExtendGears
|
||||
[435] = "%.f", -- Backseat - DoorsOu
|
||||
[356] = "%.f", -- Backseat - BreakdownFinished
|
||||
[443] = "%.f", -- Backseat - GA TILT
|
||||
[343] = "%.f", -- Backseat - DangerAltitudeInstructor
|
||||
[365] = "%.f", -- Backseat - EmergFuel
|
||||
[345] = "%.f", -- Backseat - Remain150
|
||||
[348] = "%.f", -- Backseat - DoNotStart
|
||||
[364] = "%.f", -- Backseat - FuelFilter
|
||||
[355] = "%.f", -- Backseat - WingTanks
|
||||
[441] = "%.f", -- Backseat - TrimmerRollNeutral
|
||||
[442] = "%.f", -- Backseat - TrimmerPitchNeutral
|
||||
[344] = "%.f", -- Backseat - MachMeterLamp
|
||||
[351] = "%.f", -- Backseat - CanopyNotClosed
|
||||
[349] = "%.f", -- Backseat - Vibration
|
||||
[342] = "%.f", -- Backseat - Fire
|
||||
[352] = "%.f", -- Backseat - CockpitPressure
|
||||
[361] = "%.f", -- Backseat - ConditioningClosed
|
||||
[363] = "%.f", -- Backseat - Defrost
|
||||
[360] = "%.f", -- Backseat - Ice
|
||||
[346] = "%.f", -- Backseat - HydraulicPressureDrop
|
||||
[455] = "%.f", -- Backseat - MasterDanger
|
||||
[565] = "%.f", -- Backseat - RadioUnderControl
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Front Seat
|
||||
-- ASP-3NMU Gunsight
|
||||
[101] = "%1d", -- ASP-3NMU Gunsight Mode, GYRO/FIXED
|
||||
[102] = "%.1f", -- ASP-3NMU Gunsight Brightness Knob (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[103] = "%.1f", -- ASP-3NMU Gunsight Target Wingspan Adjustment Dial (meters) (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[104] = "%1d", -- ASP-3NMU Gunsight Color Filter, ON/OFF
|
||||
[105] = "%1d", -- ASP-3NMU Gunsight Fixed Reticle Mask Lever
|
||||
[106] = "%.1f", -- ASP-3NMU Gunsight Mirror Depression (Axis) {0.0, 1.0} in 0.05 Steps
|
||||
[107] = "%.1f", -- ASP-3NMU Gunsight Target Distance (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- CLOCK
|
||||
[335] = "%1d", -- Mech clock left lever Button
|
||||
[336] = "%.1f", -- Mech clock left lever (Axis) {0.0, 1.0} in 0.04 Steps
|
||||
[337] = "%1d", -- Mech clock right lever Button
|
||||
[338] = "%.1f", -- Mech clock right lever (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Baro Altimeter
|
||||
[57] = "%.f2", -- Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.6 Steps
|
||||
-- Radar Altimeter
|
||||
[60] = "%1d", -- RV-5M Radio Altimeter Test Button
|
||||
[61] = "%.2f", -- RV-5M Radio Altimeter Decision Height Knob (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- GMK
|
||||
[204] = "%1d", -- GMK-1AE GMC Hemisphere Selection Switch, N(orth)/S(outh)
|
||||
[207] = "%1d", -- GMK-1AE GMC Mode Switch, MC(Magnetic Compass Mode)/GC(Directional Gyro Mode)
|
||||
[205] = "%1d", -- GMK-1AE GMC Test Switch, 0(degrees)/OFF/300(degrees) - Use to check heading indication accuracy {-1.0,0.0,1.0}
|
||||
[208] = "%1d", -- GMK-1AE GMC Course Selector Switch, CCW/OFF/CW {-1.0,0.0,1.0}
|
||||
[209] = "%.2f", -- GMK-1AE GMC Latitude Selector Knob (Axis) {0.0, 1.0} in 0.02 Steps
|
||||
-- Gyro
|
||||
[124] = "%1d", -- MC Synchronization Button - Push to synchronize (level flight only)
|
||||
-- Magnetic Variation
|
||||
[532] = "%.2f", -- Magnetic Declination set Knob (Axis) {0.0, 1.0} in 0.05 Steps
|
||||
-- KPP-1273K (ADI)
|
||||
[30] = "%1d", -- KPP-1273K Attitude Director Indicator (ADI) Cage Button
|
||||
[39] = "%.2f", -- KPP-1273K Attitude Director Indicator (ADI) Pitch Trim Knob {-1.0, 1.0} in 0.05 Steps
|
||||
[177] = "%1d", -- SDU Switch, ON/OFF
|
||||
[460] = "%1d", -- AGD Pitch Failure
|
||||
[461] = "%1d", -- AGD Bank Failure
|
||||
-- NPP (HSI)
|
||||
[48] = "%.2f", -- HSI Course set Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[526] = "%1d", -- Course Accordance
|
||||
[458] = "%1d", -- GMK Failure
|
||||
-- ISKRA (RSBN)
|
||||
[178] = "%.1f", -- RSBN Mode Switch, LANDING/NAVIGATION/GLIDE PATH {0.0,0.1,0.2}
|
||||
[179] = "%1d", -- RSBN Identification Button
|
||||
[180] = "%1d", -- RSBN Test Button - Push to test
|
||||
[181] = "%.2f", -- RSBN Control Box Lighting Intensity Knob (Axis) {0.0, 0.8} in 0.04 Steps
|
||||
[184] = "%.2f", -- RSBN Volume Knob (Axis) {0.0, 0.8} in 0.04 Steps
|
||||
[187] = "%1d", -- Initial Azimuth {-1.0,0.0,1.0}
|
||||
[188] = "%1d", -- Initial Range {-1.0,0.0,1.0}
|
||||
[191] = "%.3f", -- RSBN Navigation Channel Selector Knob (Axis) {0.0, 1.0} in 0.025 Steps
|
||||
[192] = "%1d", -- RSBN Landing Channel Selector Knob (Axis) {0.0, 1.0} in 0.025 Steps
|
||||
[193] = "%1d", -- Set 0 Azimuth
|
||||
[201] = "%.2f", -- RSBN Field Elevation Knob (Axis) {0.0, 1.0} in 0.02 Steps
|
||||
[297] = "%1d", -- RSBN Listen Callsign Button - Push to listen
|
||||
[527] = "%1d", -- RSBN Emergency Landing Switch, ON/OFF
|
||||
-- Variometer
|
||||
[569] = "%.1f", -- Variometer adjustment knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RKL-41
|
||||
[119] = "%1d", -- RKL-41 ADF Outer-Inner Beacon (Far-Near NDB) Switch
|
||||
[157] = "%.2f", -- RKL-41 ADF Volume Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[161] = "%1d", -- RKL-41 ADF Brightness Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[159] = "%1d", -- RKL-41 ADF Mode Switch, TLF(A3)/TLG(A1,A2)
|
||||
[160] = "%.1f", -- RKL-41 ADF Function Selector Switch, OFF/COMP(AUTO)/COMP(MAN)/ANT/LOOP {0.0,0.1,0.2,0.3,0.4}
|
||||
[162] = "%1d", -- RKL-41 ADF Loop Switch, LEFT/OFF/RIGHT {-1.0,0.0,1.0}
|
||||
[158] = "%1d", -- RKL-41 ADF Control Switch, TAKE CONTROL/HAND OVER CONTROL
|
||||
[165] = "%.2f", -- RKL-41 ADF Far NDB Frequency Tune (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[163] = "%.4f", -- RKL-41 ADF Far NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[164] = "%.1f", -- RKL-41 ADF Far NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
[168] = "%.2f", -- RKL-41 ADF Near NDB Frequency Tune (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[166] = "%.4f", -- RKL-41 ADF Near NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[167] = "%.1f", -- RKL-41 ADF Near NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
[459] = "%1d", -- ARK Failure
|
||||
-- electric system
|
||||
[141] = "%1d", -- Battery Switch, ON/OFF
|
||||
[142] = "%1d", -- Main Generator Switch, ON/OFF
|
||||
[143] = "%1d", -- Emergency Generator Switch, ON/OFF
|
||||
[502] = "%1d", -- Net Switch, ON/OFF
|
||||
[169] = "%1d", -- Emergency Engine Instruments Power Switch, ON/OFF
|
||||
[315] = "%1d", -- Turbo Button
|
||||
[313] = "%1d", -- Stop Turbo Switch, ON/OFF
|
||||
[326] = "%1d", -- Engine Button
|
||||
[320] = "%1d", -- Emergency Fuel Switch
|
||||
[322] = "%.1f", -- Engine Start Mode Switch, START/FALSE START/COLD CRANKING {0.0,0.1,0.2}
|
||||
[144] = "%1d", -- CB Engine Switch, ON/OFF
|
||||
[145] = "%1d", -- CB AGD-GMK Switch, ON/OFF
|
||||
[146] = "%1d", -- CB Inverter 1 (AC 115V) Switch, ON/OFF
|
||||
[147] = "%1d", -- CB Inverter 2 (AC 115V) Switch, ON/OFF
|
||||
[148] = "%1d", -- CB RDO (ICS and Radio) Switch, ON/OFF
|
||||
[149] = "%1d", -- CB MRP-RV (Marker Beacon Receiver and Radio Altimeter) Switch, ON/OFF
|
||||
[150] = "%1d", -- CB RSBN (ISKRA) Switch, ON/OFF
|
||||
[151] = "%1d", -- CB IFF (SRO) Emergency Connection Switch, ON/OFF
|
||||
[152] = "%1d", -- CB RSBN (ISKRA) Emergency Connection Switch, ON/OFF
|
||||
[153] = "%1d", -- CB Wing Tanks Switch, ON/OFF
|
||||
[154] = "%1d", -- CB RIO-3 De-Icing Signal Switch, ON/OFF
|
||||
[155] = "%1d", -- CB SDU Switch, ON/OFF
|
||||
[505] = "%1d", -- CB Weapon Switch, ON/OFF
|
||||
[211] = "%1d", -- CB Air Conditioning, ON/OFF
|
||||
[212] = "%1d", -- CB Anti-Ice, ON/OFF
|
||||
[213] = "%1d", -- CB Pitot Left, ON/OFF
|
||||
[214] = "%1d", -- CB Pitot Right, ON/OFF
|
||||
[215] = "%1d", -- CB PT-500C, ON/OFF
|
||||
[216] = "%1d", -- CB ARC, ON/OFF
|
||||
[217] = "%1d", -- CB SRO, ON/OFF
|
||||
[218] = "%1d", -- CB Seat-Helmet, ON/OFF
|
||||
[219] = "%1d", -- CB Gears, ON/OFF
|
||||
[220] = "%1d", -- CB Control, ON/OFF
|
||||
[221] = "%1d", -- CB Signaling, ON/OFF
|
||||
[222] = "%1d", -- CB Nav. Lights, ON/OFF
|
||||
[223] = "%1d", -- CB Spotlight Left, ON/OFF
|
||||
[224] = "%1d", -- CB Spotlight Right, ON/OFF
|
||||
[225] = "%1d", -- CB Red Lights, ON/OFF
|
||||
[226] = "%1d", -- CB White Lights, ON/OFF
|
||||
[227] = "%1d", -- CB Start Panel, ON/OFF
|
||||
[228] = "%1d", -- CB Booster Pump, ON/OFF
|
||||
[229] = "%1d", -- CB Ignition 1, ON/OFF
|
||||
[230] = "%1d", -- CB Ignition 2, ON/OFF
|
||||
[231] = "%1d", -- CB Engine Instruments, ON/OFF
|
||||
[232] = "%1d", -- CB Fire, ON/OFF
|
||||
[233] = "%1d", -- CB Emergency Jettison, ON/OFF
|
||||
[234] = "%1d", -- CB SARPP, ON/OFF
|
||||
[503] = "%1d", -- CB Seat, ON/OFF
|
||||
[504] = "%1d", -- CB Signal, ON/OFF
|
||||
[512] = "%1d", -- CB Ground Intercom, ON/OFF
|
||||
[294] = "%1d", -- Standby (Left) Pitot Tube Heating Button - Push to turn heating on
|
||||
[295] = "%1d", -- Main (Right) Pitot Tube Heating Button - Push to turn heating on
|
||||
[292] = "%1d", -- Standby (Left) Pitot Tube Heating Off Button - Push to turn heating off
|
||||
[293] = "%1d", -- Standby (Left) Pitot Tube Heating Off Button - Push to turn heating off
|
||||
-- lights system
|
||||
[176] = "%.1f", -- Navigation Lights Mode Control Switch, FLICKER/OFF/FIXED {0.0,0.5,1.0}
|
||||
[175] = "%.1f", -- Navigation Lights Intensity Control Switch, DIM(30%)/BRT(60%)/MAX(100%) {0.0,0.5,1.0}
|
||||
[311] = "%1d", -- Taxi and Landing Lights (Searchlights) Control Switch, TAXI/OFF/LANDING {-1.0,0.0,1.0}
|
||||
[330] = "%1d", -- Instrument Lighting Switch, Red/OFF/White {-1.0,0.0,1.0}
|
||||
[331] = "%.1f", -- Instrument Lights Intensity Knob (Axis) {0.1,0.9} in 0.1 Steps
|
||||
[249] = "%1d", -- Emergency Instrument Light Switch, ON/OFF
|
||||
[202] = "%.1f", -- Warning-Light Intensity Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[203] = "%1d", -- Warning-Light Check Button - Push to check
|
||||
-- Weapon System
|
||||
[254] = "%1d", -- CB Armament System Power Switch, ON/OFF
|
||||
[255] = "%1d", -- CB UB-16 Rocket Firing Control Circuit Power Switch, ON/OFF
|
||||
[256] = "%1d", -- CB ASP-FKP (Gunsight and Gun Camera) Power Switch, ON/OFF
|
||||
[257] = "%1d", -- CB Missile Seeker Heating Circuit Power Switch, ON/OFF
|
||||
[258] = "%1d", -- CB Missile Seeker Glowing Circuit Power Switch, ON/OFF
|
||||
[259] = "%.1f", -- Missile Seeker Tone Volume Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[268] = "%1d", -- Arm/Safe Bombs Emergency Jettison Switch, LIVE/BLANK
|
||||
[271] = "%.1f", -- Rockets Firing Mode Selector Switch, AUT./2RS/4RS {0.0,0.1,0.2}
|
||||
[509] = "%1d", -- Arm/Safe Bombs Emergency Jettison Switch, LIVE/BOMBS/BLANK {-1.0,0.0,1.0}
|
||||
[507] = "%1d", -- Emergency Jettison Switch, ON/OFF
|
||||
[273] = "%1d", -- EKSR-46 Signal Flare Dispenser Power Switch, ON/OFF
|
||||
[274] = "%1d", -- EKSR-46 Yellow Signal Flare Launch Button
|
||||
[275] = "%1d", -- EKSR-46 Green Signal Flare Launch Button
|
||||
[276] = "%1d", -- EKSR-46 Red Signal Flare Launch Button
|
||||
[277] = "%1d", -- EKSR-46 White Signal Flare Launch Button
|
||||
[260] = "%1d", -- Missile/Bomb Release Selector Switch, PORT(Left)/STARB-BOTH(Right for Missiles/Both)
|
||||
[270] = "%1d", -- Emergency Jettison Outboard Stations Switch, ON/OFF
|
||||
-- oxygen system
|
||||
[303] = "%1d", -- Emergency Oxygen Switch, ON/OFF
|
||||
[304] = "%1d", -- Diluter Demand Switch, 100% / MIX
|
||||
[307] = "%1d", -- Helmet Ventilation Switch, ON/OFF
|
||||
[306] = "%.2f", -- Oxygen Supply Valve (CLOSE - CW, OPEN - CCW) (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[484] = "%.2f", -- Oxygen Interconnaction Valve (CLOSE - CW, OPEN - CCW) (Axis) {0.0,1.0} in 0.05 Steps
|
||||
-- sarpp
|
||||
[298] = "%1d", -- SARPP Flight Recorder, ON/OFF
|
||||
-- fuel system
|
||||
[296] = "%1d", -- Fuel Shut-Off Lever
|
||||
-- air system
|
||||
[245] = "%.1f", -- ECS and Pressurization Handle, OFF/CANOPIES SEALED/ECS ON (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[172] = "%.2f", -- Cabin Air Conditioning Control Switch, OFF/HEAT/COOL/AUTOMATIC {0.0,0.25} in 0.05 Steps
|
||||
[173] = "%.1f", -- Cabin Air Temperature Controller Rheostat (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[121] = "%.2f", -- Diffuser and Flight Suit Air Conditioning Control Switch, HEAT/AUTO/COOL {0.0,0.25} in 0.05 Steps
|
||||
[120] = "%.1f", -- Diffuser and Flight Suit Temperature Rheostat (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[511] = "%1d", -- Conditioning Shutoff Switch, OPEN/FRONT PILOT CONTROL/CLOSE {-1.0,0.0,1.0}
|
||||
-- anti-icing system
|
||||
[174] = "%1d", -- De-Icing Mode Switch, MANUAL/AUTOMATIC/OFF {0.0,0.1,0.2}
|
||||
[183] = "%1d", -- RIO-3 De-Icing Sensor Heating Circuit Check Button - Push to test
|
||||
-- helmet heating
|
||||
[309] = "%1d", -- Helmet Visor Quick Heating Button - Push to heat
|
||||
[308] = "%1d", -- Helmet Heating Mode Switch, AUTO/OFF/ON {0.0,0.5,1.0}
|
||||
[310] = "%.1f", -- Helmet Heating Temperature Rheostat (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- SPU-9
|
||||
[209] = "%1d", -- Reserve Intercom Switch, ON/OFF
|
||||
[291] = "%1d", -- ADF Audio Switch, ADF/OFF
|
||||
[288] = "%1d", -- Intercom Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[289] = "%1d", -- Radio Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[134] = "%1d", -- Radio Button
|
||||
[133] = "%1d", -- Intercom Button
|
||||
-- R-832M
|
||||
[287] = "%1d", -- Radio Control Switch, ON/OFF
|
||||
[286] = "%1d", -- Squelch Switch, ON/OFF
|
||||
[284] = "%1d", -- R-832M Preset Channel Selector Knob (Axis) {0.0,1.0} in 20 0.05 Steps
|
||||
-- engine systems
|
||||
[329] = "%1d", -- IV-300 Engine Vibration Test Button - Push to test
|
||||
[328] = "%1d", -- Fire Extinguish Button - Push to extinguish
|
||||
[272] = "%1d", -- Fire Warning Signal Test Switch, I/OFF/II {-1.0,0.0,1.0}
|
||||
[324] = "%1d", -- RT-12 JPT Regulator Manual Disable Switch, RT-12 DISABLED/RT-12 ENABLED
|
||||
[243] = "%1d", -- RT-12 JPT Regulator Power Switch, ON/OFF
|
||||
[242] = "%1d", -- RT-12 JPT Regulator Test Switch, I/OFF/II {-1.0,0.0,1.0}
|
||||
[499] = "%1d", -- EGT Indicator Switch, FRONT/REAR
|
||||
-- control system
|
||||
[281] = "%1d", -- Flaps Flight Position (0 degrees) Button
|
||||
[282] = "%1d", -- Flaps Takeoff Position (25 degrees) Button
|
||||
[283] = "%1d", -- Flaps Landing Position (44 degrees) Button
|
||||
[549] = "%1d", -- Throttle Limiter
|
||||
[135] = "%1d", -- Air Brake Switch {0.0,1.0}
|
||||
[136] = "%1d", -- Air Brake Switch (2nd position) {0.0,1.0}
|
||||
[118] = "%1d", -- Landing Gear Control Lever {-1.0,0.0,1.0}
|
||||
[334] = "%.1f", -- Emergency/Parking Wheel Brake Lever {0.0,1.0} in 0.1 Steps
|
||||
[334] = "%1d", -- Parking Brake Lever Flag - Push to remove parking brake
|
||||
[197] = "%1d", -- Main and Emergency Hydraulic Systems Interconnection Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[194] = "%1d", -- Emergency Landing Gear Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[195] = "%1d", -- Emergency Flaps Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[196] = "%1d", -- RAT (Emergency Generator) Emergency Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[456] = "%1d", -- Full Pressure Failure Lever, ON/STBY/FAILURE {-0.5,0.0,0.5}
|
||||
[457] = "%1d", -- Static Pressure Failure Lever, ON/STBY/FAILURE {-0.5,0.0,0.5}
|
||||
-- accelerometer
|
||||
[89] = "%1d", -- Reset Limits
|
||||
-- canopy
|
||||
[998] = "%1d", -- Canopy Handle
|
||||
[285] = "%1d", -- Forward Canopy Lock Handle
|
||||
[244] = "%1d", -- Forward Canopy Emergency Jettison Handle
|
||||
-- Pitot Selector
|
||||
[333] = "%1d", -- Pitot Tube Selector Lever, STBY(Left)/MAIN(Right)
|
||||
-- Back Seat
|
||||
-- CLOCK
|
||||
[412] = "%1d", -- Backseat - Mech clock left lever Button
|
||||
[413] = "%.1f", -- Backseat - Mech clock left lever (Axis) {0.0, 1.0} in 0.04 Steps
|
||||
[414] = "%1d", -- Backseat - Mech clock right lever Button
|
||||
[415] = "%.1f", -- Backseat - Mech clock right lever (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Baro Altimeter
|
||||
[394] = "%.f2", -- Backseat - Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.6 Steps
|
||||
-- Radar Altimeter
|
||||
[398] = "%1d", -- Backseat - RV-5M Radio Altimeter Test Button
|
||||
[399] = "%.2f", -- Backseat - RV-5M Radio Altimeter Decision Height Knob (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- GMK
|
||||
-- Gyro
|
||||
[444] = "%1d", -- Backseat - MC Synchronization Button - Push to synchronize (level flight only)
|
||||
-- KPP-1273K (ADI)
|
||||
[367] = "%1d", -- Backseat - KPP-1273K Attitude Director Indicator (ADI) Cage Button
|
||||
[376] = "%.2f", -- Backseat - KPP-1273K Attitude Director Indicator (ADI) Pitch Trim Knob (Axis) {-1.0, 1.0} in 0.05 Steps
|
||||
-- NPP (HSI)
|
||||
[385] = "%.2f", -- Backseat - HSI Course set knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
-- Variometer
|
||||
[419] = "%.1f", -- Backseat - Variometer adjustment knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RKL-41
|
||||
[440] = "%1d", -- Backseat - RKL-41 ADF Outer-Inner Beacon (Far-Near NDB) Switch
|
||||
[514] = "%.2f", -- Backseat - RKL-41 ADF Volume Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[518] = "%.2f", -- Backseat - RKL-41 ADF Brightness Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[516] = "%1d", -- Backseat - RKL-41 ADF Mode Switch, TLF(A3)/TLG(A1,A2)
|
||||
[517] = "%.1f", -- Backseat - RKL-41 ADF Function Selector Switch, OFF/COMP(AUTO)/COMP(MAN)/ANT/LOOP {0.0,0.1,0.2,0.3,0.4}
|
||||
[519] = "%1d", -- Backseat - RKL-41 ADF Loop Switch, LEFT/OFF/RIGHT
|
||||
[515] = "%1d", -- Backseat - RKL-41 ADF Control Switch, TAKE CONTROL/HAND OVER CONTROL
|
||||
[522] = "%.2f", -- Backseat - RKL-41 ADF Far NDB Frequency Tune (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[520] = "%.4f", -- Backseat - RKL-41 ADF Far NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[521] = "%.1f", -- Backseat - RKL-41 ADF Far NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
[525] = "%.2f", -- Backseat - RKL-41 ADF Near NDB Frequency Tune (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[523] = "%.4f", -- Backseat - RKL-41 ADF Near NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[524] = "%.1f", -- Backseat - RKL-41 ADF Near NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
-- electric system
|
||||
[488] = "%1d", -- Backseat - Turbo Button
|
||||
[494] = "%1d", -- Backseat - Engine Button
|
||||
[490] = "%1d", -- Backseat - Stop Engine Switch
|
||||
[492] = "%1d", -- Backseat - Emergency Fuel Switch
|
||||
-- lights system
|
||||
[486] = "%1d", -- Backseat - Taxi and Landing Lights (Searchlights) Control Switch, TAXI/OFF/LANDING {-1.0,0.0,1.0}
|
||||
[497] = "%1d", -- Backseat - Instrument Lighting Switch, Red/OFF/White {-1.0,0.0,1.0}
|
||||
[498] = "%.1f", -- Backseat - Instrument Lights Intensity Knob (Axis) {0.1,0.9} in 0.1 Steps
|
||||
[537] = "%.1f", -- Backseat - Warning-Light Intensity Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[538] = "%1d", -- Backseat - Warning-Light Check Button - Push to check
|
||||
-- oxygen system
|
||||
[479] = "%1d", -- Backseat - Emergency Oxygen Switch, ON/OFF
|
||||
[480] = "%1d", -- Backseat - Diluter Demand Switch, 100% / MIX
|
||||
[482] = "%.4f", -- Backseat - Oxygen Supply Valve (CLOSE - CW, OPEN - CCW) (Axis) {0.0,1.0} in 0.05 Steps
|
||||
-- fuel system
|
||||
[475] = "%1d", -- Backseat - Fuel Shut-Off Lever
|
||||
-- air system
|
||||
[245] = "%.1f", -- Backseat - ECS and Pressurization Handle, OFF/CANOPIES SEALED/ECS ON (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- SPU-9
|
||||
[473] = "%1d", -- Backseat - Reserve Intercom Switch, ON/OFF
|
||||
[474] = "%1d", -- Backseat - ADF Audio Switch, ADF/OFF
|
||||
[471] = "%1d", -- Backseat - Intercom Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[472] = "%1d", -- Backseat - Radio Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[547] = "%1d", -- Backseat - Radio Button
|
||||
[546] = "%1d", -- Backseat - Intercom Button
|
||||
-- R-832M
|
||||
[470] = "%1d", -- Backseat - Radio Control Switch, ON/OFF
|
||||
[469] = "%1d", -- Backseat - Squelch Switch, ON/OFF
|
||||
[468] = "%1d", -- Backseat - R-832M Preset Channel Selector Knob (Axis) {0.0,1.0} in 20 0.05 Steps
|
||||
-- control system
|
||||
[465] = "%1d", -- Backseat - Flaps Flight Position (0 degrees) Button
|
||||
[466] = "%1d", -- Backseat - Flaps Takeoff Position (25 degrees) Button
|
||||
[467] = "%1d", -- Backseat - Flaps Landing Position (44 degrees) Button
|
||||
[548] = "%1d", -- Backseat - Air Brake Switch {-1.0, 0.0, 1.0}
|
||||
[437] = "%1d", -- Backseat - Landing Gear Control Lever {0.0,0.5,1.0} ??? eigentlich 4 Positionen
|
||||
[501] = "%.1f", -- Backseat - Emergency Wheel Brake Lever {0.0,1.0} in 0.1 Steps
|
||||
[536] = "%1d", -- Backseat - Main and Emergency Hydraulic Systems Interconnection Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[533] = "%1d", -- Backseat - Emergency Landing Gear Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[534] = "%1d", -- Backseat - Emergency Flaps Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[535] = "%1d", -- Backseat - RAT (Emergency Generator) Emergency Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
-- canopy
|
||||
[999] = "%1d", -- Backseat - Canopy Handle
|
||||
[485] = "%1d", -- Backseat - Canopy Lock Handle
|
||||
[539] = "%1d", -- Backseat - Canopy Emergency Jettison Handle
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- Front Seat
|
||||
|
||||
-- ADI correction
|
||||
--[31] = "%.4f", -- KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
--[40] = "%.4f", -- KPP 1273K sideslip {-1.0, 1.0}
|
||||
local lPitch = mainPanelDevice:get_argument_value(31)
|
||||
|
||||
lPitch = lPitch * 2
|
||||
|
||||
ExportScript.Tools.SendData(31, string.format("%.4f", lPitch))
|
||||
ExportScript.Tools.SendData(40, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(40)))) -- negate
|
||||
|
||||
-- HSI correction
|
||||
--[41] = "%.4f", -- HSI heading {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
--[42] = "%.4f", -- HSI commanded course needle (wihte needle) {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
local lCommandCourse = mainPanelDevice:get_argument_value(42)
|
||||
|
||||
lCommandCourse = lCommandCourse + 0.5 -- 180 degree turn
|
||||
|
||||
ExportScript.Tools.SendData(41, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(41)))) -- negate
|
||||
ExportScript.Tools.SendData(42, string.format("%.4f", lCommandCourse))
|
||||
|
||||
-- Back Seat
|
||||
|
||||
-- ADI correction
|
||||
--[368] = "%.4f", -- KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
--[377] = "%.4f", -- KPP 1273K sideslip {-1.0, 1.0}
|
||||
local lPitch2 = mainPanelDevice:get_argument_value(368)
|
||||
|
||||
lPitch2 = lPitch2 * 2
|
||||
|
||||
ExportScript.Tools.SendData(368, string.format("%.4f", lPitch2))
|
||||
ExportScript.Tools.SendData(377, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(377)))) -- negate
|
||||
|
||||
-- HSI correction
|
||||
--[378] = "%.4f", -- HSI heading {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
--[379] = "%.4f", -- HSI commanded course needle (wihte needle) {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
local lCommandCourse2 = mainPanelDevice:get_argument_value(379)
|
||||
|
||||
lCommandCourse2 = lCommandCourse2 + 0.5 -- 180 degree turn
|
||||
|
||||
ExportScript.Tools.SendData(378, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(378))))-- negate
|
||||
ExportScript.Tools.SendData(379, string.format("%.4f", lCommandCourse2))
|
||||
|
||||
-- VD-20 Presseure correction
|
||||
--[56] = "%.4f", -- VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
local lVD_20_PRESS = mainPanelDevice:get_argument_value(56)
|
||||
--ExportScript.Tools.WriteToLog('Pressure: '..ExportScript.Tools.dump(lVD_20_PRESS))
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 0.89 -- maximaler Ausgabewert
|
||||
x_min = 0.0 -- minimaler Eingangswert
|
||||
x_max = 0.76793104410172 -- maximaler Eingangswert
|
||||
x = 0.57506740093231 -- aktueller Eingangswert
|
||||
|
||||
d_y = 0.89 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 0.76793104410172 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 1.158958225267568124678891052043 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.0000000000000000000000000000002387929418604 (2.387929418604e-32) -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.66648 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
if gVD_20_PRESS ~= lVD_20_PRESS then
|
||||
gVD_20_PRESS = lVD_20_PRESS
|
||||
lVD_20_PRESS = 1.158958225267568124678891052043 * lVD_20_PRESS + 0.0000000000000000000000000000002387929418604
|
||||
--ExportScript.Tools.WriteToLog('Pressure2: '..ExportScript.Tools.dump(lVD_20_PRESS))
|
||||
ExportScript.Tools.SendData(56, string.format("%.4f", lVD_20_PRESS))
|
||||
end
|
||||
|
||||
--[393] = "%.4f", -- Backseat - VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
local lVD_20_PRESS_Backseat = mainPanelDevice:get_argument_value(393)
|
||||
--ExportScript.Tools.WriteToLog('Pressure: '..ExportScript.Tools.dump(lVD_20_PRESS_Backseat))
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 0.89 -- maximaler Ausgabewert
|
||||
x_min = 0.0 -- minimaler Eingangswert
|
||||
x_max = 0.76793104410172 -- maximaler Eingangswert
|
||||
x = 0.57506740093231 -- aktueller Eingangswert
|
||||
|
||||
d_y = 0.89 -- Delta Ausga
|
||||
d_x = 0.76793104410172 -- Delta Eingangswerte (x_max
|
||||
m = 1.158958225267568124678891052043 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.0000000000000000000000000000002387929418604 (2.387929418604e-32) -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.66648 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
if gVD_20_PRESS_Backseat ~= lVD_20_PRESS_Backseat then
|
||||
gVD_20_PRESS_Backseat = lVD_20_PRESS_Backseat
|
||||
lVD_20_PRESS_Backseat = 1.158958225267568124678891052043 * lVD_20_PRESS_Backseat + 0.0000000000000000000000000000002387929418604
|
||||
--ExportScript.Tools.WriteToLog('Pressure2: '..ExportScript.Tools.dump(lVD_20_PRESS_Backseat))
|
||||
ExportScript.Tools.SendData(393, string.format("%.4f", lVD_20_PRESS_Backseat))
|
||||
end
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- R_832M Channel
|
||||
local R_832M = {[0.0]="0",[0.05]="1",[0.1]="2",[0.15]="3",[0.2]="4",[0.25]="5",[0.3]="6",[0.35]="7",[0.4]="8",[0.45]="9",[0.5]="10",[0.55]="11",[0.6]="12",[0.65]="13",[0.7]="14",[0.75]="15",[0.8]="16",[0.85]="17",[0.9]="18",[0.95]="19"}
|
||||
ExportScript.Tools.SendData(2000, R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
--ExportScript.Tools.WriteToLog('R_832M Channel: '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(284))..', '..R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
|
||||
-- R_832M Frequency
|
||||
local lR_832M_F = GetDevice(19)
|
||||
if lR_832M_F:is_on() then
|
||||
--ExportScript.Tools.SendData(2001, string.format("%7.3f", lR_832M_F:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2001, ExportScript.Tools.RoundFreqeuncy(lR_832M_F:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('R_832M Frequency: '..ExportScript.Tools.dump(string.format("%7.3f", lR_832M_F:get_frequency()/1000000)))
|
||||
else
|
||||
ExportScript.Tools.SendData(2001, " ")
|
||||
end
|
||||
|
||||
-- RSBN
|
||||
--[189] = "%.4f", -- RSBN NAV Chan {0.0, 0.39} {1.0, 40.0}
|
||||
--[190] = "%.4f", -- RSBN LAND Chan {0.0, 0.39} {1.0, 40.0}
|
||||
local lRSBN_Chan = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="21",[0.21]="22",[0.22]="23",[0.23]="24",[0.24]="25",[0.25]="26",[0.26]="27",[0.27]="28",[0.28]="29",[0.29]="30",[0.30]="31",[0.31]="32",[0.32]="33",[0.33]="34",[0.34]="35",[0.35]="36",[0.36]="37",[0.37]="38",[0.38]="39",[0.39]="40"}
|
||||
ExportScript.Tools.SendData(189, lRSBN_Chan[ExportScript.Tools.round(mainPanelDevice:get_argument_value(189), 2)])
|
||||
--ExportScript.Tools.WriteToLog('RSBN 1: '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(189)))
|
||||
--ExportScript.Tools.WriteToLog('RSBN 2: '..ExportScript.Tools.dump(ExportScript.Tools.round(mainPanelDevice:get_argument_value(189), 2)))
|
||||
|
||||
ExportScript.Tools.SendData(190, lRSBN_Chan[ExportScript.Tools.round(mainPanelDevice:get_argument_value(190), 2)])
|
||||
--ExportScript.Tools.WriteToLog('RSBN 1: '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(190)))
|
||||
--ExportScript.Tools.WriteToLog('RSBN 2: '..ExportScript.Tools.dump(ExportScript.Tools.round(mainPanelDevice:get_argument_value(190), 2)))
|
||||
|
||||
-- Cockpit Light
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {222, 225, 226, 497})
|
||||
-- CB Nav. Lights, CB Red Lights, CB White Lights, Backseat - Instrument Lighting Switch
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF RADIO:get frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- R_832M Channel
|
||||
local R_832M = {[0.0]="0",[0.05]="1",[0.1]="2",[0.15]="3",[0.2]="4",[0.25]="5",[0.3]="6",[0.35]="7",[0.4]="8",[0.45]="9",[0.5]="10",[0.55]="11",[0.6]="12",[0.65]="13",[0.7]="14",[0.75]="15",[0.8]="16",[0.85]="17",[0.9]="18",[0.95]="19"}
|
||||
ExportScript.Tools.SendDataDAC(2000, R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
--ExportScript.Tools.WriteToLog('R_832M Channel: '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(284))..', '..R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
|
||||
|
||||
-- R_832M Frequency
|
||||
local lR_832M_F = GetDevice(19)
|
||||
if lR_832M_F:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC(2001, string.format("%7.3f", lR_832M_F:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC(2001, ExportScript.Tools.RoundFreqeuncy(lR_832M_F:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('R_832M Frequency: '..ExportScript.Tools.dump(string.format("%7.3f", lR_832M_F:get_frequency()/1000000)))
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC(2001, " ")
|
||||
end
|
||||
|
||||
-- RSBN
|
||||
--[189] = "%.4f", -- RSBN NAV Chan {0.0, 0.39} {1.0, 40.0}
|
||||
--[190] = "%.4f", -- RSBN LAND Chan {0.0, 0.39} {1.0, 40.0}
|
||||
local lRSBN_Chan = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="21",[0.21]="22",[0.22]="23",[0.23]="24",[0.24]="25",[0.25]="26",[0.26]="27",[0.27]="28",[0.28]="29",[0.29]="30",[0.30]="31",[0.31]="32",[0.32]="33",[0.33]="34",[0.34]="35",[0.35]="36",[0.36]="37",[0.37]="38",[0.38]="39",[0.39]="40"}
|
||||
ExportScript.Tools.SendDataDAC(189, lRSBN_Chan[ExportScript.Tools.round(mainPanelDevice:get_argument_value(189), 2)])
|
||||
|
||||
ExportScript.Tools.SendDataDAC(190, lRSBN_Chan[ExportScript.Tools.round(mainPanelDevice:get_argument_value(190), 2)])
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-- global VD-20 Pressure variable
|
||||
gVD_20_PRESS = 0
|
||||
gVD_20_PRESS_Backseat = 0
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,852 @@
|
||||
-- L-39ZA
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.L39ZA = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
-- Front Seat
|
||||
-- Mechanic clock
|
||||
[67] = "%.4f", -- CLOCK currtime hours
|
||||
[68] = "%.4f", -- CLOCK currtime minutes
|
||||
[70] = "%.4f", -- CLOCK seconds meter time seconds
|
||||
[73] = "%.4f", -- CLOCK flight time meter status
|
||||
[71] = "%.4f", -- CLOCK flight hours
|
||||
[72] = "%.4f", -- CLOCK flight minutes
|
||||
[69] = "%.4f", -- CLOCK seconds meter time minutes
|
||||
-- Radar altimeter RV-5
|
||||
[58] = "%.4f", -- RV-5 RALT {0.0, 0.086, 0.439, 0.878, 0.955}{0.0, 20.0, 100.0, 700.0, 800.0}
|
||||
[59] = "%.4f", -- RV-5 DangerRALT index {0.0, 0.094, 0.48, 0.998}{0.0, 20.0, 100.0, 700.0}
|
||||
[63] = "%.f", -- RV-5 DangerRALT lamp
|
||||
[62] = "%.4f", -- RV-5 warning flag
|
||||
-- Variometer
|
||||
[74] = "%.4f", -- Variometer {-1.0, -0.875, -0.775, -0.44, 0.0, 0.44, 0.775, 0.875, 1.0}{-80.0, -50.0, -20.0, -10.0, 0.0, 10.0, 20.0, 50.0, 80.0}
|
||||
[76] = "%.4f", -- Variometer sideslip {-1.0, 1.0}
|
||||
[75] = "%.4f", -- Variometer turn {-1.0, -0.58, -0.275, 0.275, 0.58, 1.0} {-math.rad(5.7), math.rad(-3.8), math.rad(-1.9), math.rad(1.9), math.rad(3.8), math.rad(5.7)}
|
||||
-- KPP (ADI)
|
||||
[38] = "%.4f", -- KPP 1273K roll {-1.0, 1.0} {-math.pi, math.pi}
|
||||
--[31] = "%.4f", -- KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
--[40] = "%.4f", -- KPP 1273K sideslip {-1.0, 1.0}
|
||||
[35] = "%.4f", -- KPP Course Deviation Bar {-1.0, 1.0}
|
||||
[34] = "%.4f", -- KPP Alt Deviation Bar {-1.0, 1.0}
|
||||
[36] = "%1d", -- KPP Glide Beacon
|
||||
[37] = "%1d", -- KPP Localizer Beacon
|
||||
[29] = "%.4f", -- KPP Arretir
|
||||
[32] = "%.4f", -- KPP SDU Roll {-1.0, 1.0}
|
||||
[33] = "%.4f", -- KPP SDU Pitch {-1.0, 1.0}
|
||||
-- NPP (HSI)
|
||||
--[41] = "%.4f", -- HSI heading {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
--[42] = "%.4f", -- HSI commanded course needle (yellow needle) {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
[43] = "%.4f", -- HSI bearing needle {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
[47] = "%.4f", -- HSI Course Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[45] = "%.4f", -- HSI Alt Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[46] = "%.4f", -- HSI Glide Beacon G
|
||||
[44] = "%.4f", -- HSI Localizer Beacon K
|
||||
-- RSBN
|
||||
[189] = "%.4f", -- RSBN NAV Chan {0.0, 0.39} {1.0, 40.0}
|
||||
[190] = "%.4f", -- RSBN LAND Chan {0.0, 0.39} {1.0, 40.0}
|
||||
[66] = "%.4f", -- RSBN Range 100
|
||||
[65] = "%.4f", -- RSBN Range 10
|
||||
[64] = "%.4f", -- RSBN Range 1
|
||||
[580] = "%.4f", -- RSBN PanelLightsLmp
|
||||
-- Barometric altimeter VD-20
|
||||
[52] = "%.4f", -- VD-20 km {0.0, 1.0}{0.0, 20.0}
|
||||
[53] = "%.4f", -- VD-20 m {0.0, 1.0}{0.0, 1000.0}
|
||||
[54] = "%.4f", -- VD-20 km Ind {0.0, 1.0}{0.0, 20.0}
|
||||
[55] = "%.4f", -- VD-20 m Ind {0.0, 1.0}{0.0, 1000.0}
|
||||
--[56] = "%.4f", -- VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
-- Barometric altimeter
|
||||
-- Altimeter Feet , copy of A-10 altimeter
|
||||
[637] = "%.4f", -- Altimeter_100_footPtr {0.0, 1.0}{0.0, 1000.0}
|
||||
[632] = "%.4f", -- Altimeter_10000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[631] = "%.4f", -- Altimeter_1000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[630] = "%.4f", -- Altimeter_100_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[636] = "%.4f", -- pressure_setting_0 {0.0, 1.0}{0.0, 10.0}
|
||||
[635] = "%.4f", -- pressure_setting_1 {0.0, 1.0}{0.0, 10.0}
|
||||
[634] = "%.4f", -- pressure_setting_2 {0.0, 1.0}{0.0, 10.0}
|
||||
[633] = "%.4f", -- pressure_setting_3 {0.0, 1.0}{0.0, 10.0}
|
||||
-- AIRSPEED AND MACH
|
||||
[49] = "%.4f", -- IAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[50] = "%.4f", -- TAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[51] = "%.4f", -- MACH
|
||||
-- RKL-41
|
||||
[77] = "%.4f", -- RKL-41 needle {0.0, 1.0}{0.0, math.pi * 2.0}
|
||||
[156] = "%.4f", -- RKL-41 Signal
|
||||
[531] = "%.4f", -- KM-8 heading {0.0, 1.0}{0.0, math.pi * 2.0}
|
||||
[530] = "%.4f", -- KM-8 variation {1.0, -1.0}{-math.pi, math.pi}
|
||||
-- electric interface
|
||||
[92] = "%.4f", -- Voltmeter {0.0, 1.0}{0.0, 40.0}
|
||||
[93] = "%.4f", -- Ampermeter {0.0, 1.0}{-100.0, 300.0}
|
||||
-- oxygen interface
|
||||
[301] = "%.4f", -- OxygenPressure {0.0, 0.025, 0.925, 1.0}{0.0, 10.0, 150.0, 160.0}
|
||||
[302] = "%.4f", -- FlowBlinker
|
||||
-- accelerometer
|
||||
[86] = "%.4f", -- Acceleration {0.0, 1.0}{-5.0, 10.0}
|
||||
[88] = "%.4f", -- AccelerationMin {0.31, 0.695}{-5.0, 1.0}
|
||||
[87] = "%.4f", -- AccelerationMax {0.0, 1.0}{-5.0, 10.0}
|
||||
--
|
||||
[95] = "%.4f", -- CockpitAlt {0.0, 1.0}{0.0, 20000.0}
|
||||
[96] = "%.4f", -- PressDiff {0.0, 0.102, 0.202, 0.398, 0.779, 1.0}{-0.04, -0.02, 0.0, 0.1, 0.4, 0.6}
|
||||
-- Hydro Pressure
|
||||
[198] = "%.4f", -- MainHydro PRESS {0.0, 1.0}{0.0, 200.0}
|
||||
[200] = "%.4f", -- AuxHydro PRESS {0.0, 1.0}{0.0, 200.0}
|
||||
[98] = "%.4f", -- BrakeLMainHydro PRESS {0.0, 1.0}{0.0, 60.0}
|
||||
[99] = "%.4f", -- BrakeRMainHydro PRESS {0.0, 1.0}{0.0, 60.0}
|
||||
[100] = "%.4f", -- BrakeAuxHydro PRESS {0.0, 1.0}{0.0, 60.0}
|
||||
-- Fuel Quantity
|
||||
[91] = "%.4f", -- Fuel Quantity {0.0, 0.127, 0.239, 0.35, 0.458, 0.56, 0.685, 0.82, 1.0}{0.0, 100.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 825.0}
|
||||
-- Fan RPM
|
||||
[85] = "%.4f", -- Fan RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Compressor RPM
|
||||
[84] = "%.4f", -- Compressor RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Oil
|
||||
[83] = "%.4f", -- Oil Temp {0.0, 0.323, 0.576, 0.817, 1.0}{-50.0, 0.0, 50.0, 100.0, 150.0}
|
||||
[82] = "%.4f", -- Oil Press {0.0, 0.077, 1.0}{-1.0, 0.0, 6.0}
|
||||
-- Fuel Press
|
||||
[81] = "%.4f", -- Fuel Press {0.0, 0.06, 0.148, 0.323, 0.547, 0.659, 0.801, 1.0}{-1.0, 0.0, 20.0, 40.0, 60.0, 70.0, 80.0, 100.0}
|
||||
-- Engine Temp
|
||||
[90] = "%.4f", -- Engine Temp {0.0, 1.0}{0.0, 900.0}
|
||||
-- EngineVibration
|
||||
[94] = "%.4f", -- EngineVibration {0.0, 1.0}{0.0, 100.0}
|
||||
-- PitchTrimInd
|
||||
[247] = "%.4f", -- PitchTrimInd {1.0, -1.0}{-1.0, 1.0}
|
||||
-- lights system
|
||||
--[533] = "%.4f", -- CptInstrumentLightsIntensity
|
||||
--[558] = "%.4f", -- CompassLightIntensity
|
||||
--[555] = "%.4f", -- EmergencyLightIntensity
|
||||
-- RKL-41 Radio Compass
|
||||
[561] = "%.f", -- FarNDBSelectorLamp
|
||||
[570] = "%.f", -- NearNDBSelectorLamp
|
||||
[563] = "%.f", -- PanelLights
|
||||
-- BrakeHandle
|
||||
[127] = "%.4f", -- BrakeHandle
|
||||
-- Lamps
|
||||
[18] = "%.f", -- MRP 56
|
||||
[6] = "%.f", -- MainGenerator
|
||||
[9] = "%.f", -- ReserveGennerator
|
||||
[12] = "%.f", -- Inverter115
|
||||
[16] = "%.f", -- Inverter363
|
||||
[316] = "%.f", -- GroundPower
|
||||
[278] = "%.f", -- FlapsUp
|
||||
[279] = "%.f", -- FlapsTO
|
||||
[280] = "%.f", -- FlapsDn
|
||||
[117] = "%.f", -- AirBrakes
|
||||
[113] = "%.f", -- GearDown front
|
||||
[112] = "%.f", -- GearDown left
|
||||
[114] = "%.f", -- GearDown right
|
||||
[110] = "%.f", -- GearUp front
|
||||
[109] = "%.f", -- GearUp left
|
||||
[111] = "%.f", -- GearUp right
|
||||
[115] = "%.f", -- ExtendGears
|
||||
[116] = "%.f", -- DoorsOut
|
||||
[185] = "%.f", -- RSBN Azim Correction
|
||||
[186] = "%.f", -- RSBN Range Correction
|
||||
[15] = "%.f", -- BreakdownFinished
|
||||
[123] = "%.f", -- GA TILT
|
||||
[206] = "%.f", -- GA TILT PU26
|
||||
[2] = "%.f", -- DangerAltitude
|
||||
[27] = "%.f", -- EmergFuel
|
||||
[23] = "%.f", -- TurboStarter
|
||||
[4] = "%.f", -- Remain150
|
||||
[7] = "%.f", -- DoNotStart
|
||||
[26] = "%.f", -- FuelFilter
|
||||
[14] = "%.f", -- WingTanks
|
||||
[246] = "%.f", -- TrimmerRollNeutral
|
||||
[3] = "%.f", -- MachMeterLamp
|
||||
[10] = "%.f", -- CanopyNotClosed
|
||||
[556] = "%.f", -- LeftPitot
|
||||
[557] = "%.f", -- RightPitot
|
||||
[8] = "%.f", -- Vibration
|
||||
[1] = "%.f", -- Fire
|
||||
[28] = "%.f", -- EngineTemperature700
|
||||
[24] = "%.f", -- EngineTemperature730
|
||||
[20] = "%.f", -- EngineMinOilPressure
|
||||
[359] = "%.f", -- RSBN Azim Correct
|
||||
[362] = "%.f", -- RSBN Range Correct
|
||||
[19] = "%.f", -- HSI Accordance
|
||||
[11] = "%.f", -- CockpitPressure
|
||||
[22] = "%.f", -- ConditioningClosed
|
||||
[25] = "%.f", -- Defrost
|
||||
[21] = "%.f", -- Ice
|
||||
[182] = "%.f", -- RIO HeatingOk
|
||||
[5] = "%.f", -- HydraulicPressureDrop
|
||||
[253] = "%.f", -- MasterDanger
|
||||
[17] = "%.f", -- EmergConditioning
|
||||
[562] = "%.f", -- RadioUnderControl
|
||||
[13] = "%.f", -- EmptyWingFuelTanks
|
||||
-- Back Seat
|
||||
-- Mechanic clock
|
||||
[405] = "%.4f", -- Backseat - CLOCK currtime hours
|
||||
[406] = "%.4f", -- Backseat - CLOCK currtime minutes
|
||||
[408] = "%.4f", -- Backseat - CLOCK seconds meter time seconds
|
||||
[411] = "%.4f", -- Backseat - CLOCK flight time meter status
|
||||
[409] = "%.4f", -- Backseat - CLOCK flight hours
|
||||
[410] = "%.4f", -- Backseat - CLOCK flight minutes
|
||||
[407] = "%.4f", -- Backseat - CLOCK seconds meter time minutes
|
||||
-- Radar altimeter RV-5
|
||||
[396] = "%.4f", -- Backseat - RV-5 RALT {0.0, 0.086, 0.439, 0.878, 0.955}{0.0, 20.0, 100.0, 700.0, 800.0}
|
||||
[397] = "%.4f", -- Backseat - RV-5 DangerRALT index {0.0, 0.094, 0.48, 0.998}{0.0, 20.0, 100.0, 700.0}
|
||||
[401] = "%.f", -- Backseat - RV-5 DangerRALT lamp
|
||||
[400] = "%.4f", -- Backseat - RV-5 warning flag
|
||||
-- Variometer
|
||||
[416] = "%.4f", -- Backseat - Variometer {-1.0, -0.875, -0.775, -0.44, 0.0, 0.44, 0.775, 0.875, 1.0}{-80.0, -50.0, -20.0, -10.0, 0.0, 10.0, 20.0, 50.0, 80.0}
|
||||
[418] = "%.4f", -- Backseat - Variometer sideslip {-1.0, 1.0}
|
||||
[417] = "%.4f", -- Backseat - Variometer turn {-1.0, 1.0} {-math.rad(6.0), math.rad(6.0)}
|
||||
-- KPP (ADI)
|
||||
[375] = "%.4f", -- Backseat - KPP 1273K roll {-1.0, 1.0} {-math.pi, math.pi}
|
||||
[368] = "%.4f", -- Backseat - KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
[377] = "%.4f", -- Backseat - KPP 1273K sideslip {-1.0, 1.0}
|
||||
[372] = "%.4f", -- Backseat - KPP Course Deviation Bar {-1.0, 1.0}
|
||||
[373] = "%.4f", -- Backseat - KPP Glide Beacon
|
||||
[374] = "%.4f", -- Backseat - KPP Localizer Beacon
|
||||
[366] = "%.4f", -- Backseat - KPP Arretir
|
||||
[369] = "%.4f", -- Backseat - KPP SDU Roll {-1.0, 1.0}
|
||||
[370] = "%.4f", -- Backseat - KPP SDU Pitch {-1.0, 1.0}
|
||||
-- NPP HSI
|
||||
[378] = "%.4f", -- Backseat - HSI2 heading {1.0, 0.0}{0.0, math.pi * 2.0}
|
||||
[379] = "%.4f", -- Backseat - HSI2 commanded course needle {1.0, 0.0}{0.0, math.pi * 2.0}
|
||||
[380] = "%.4f", -- Backseat - HSI2 bearing needle {1.0, 0.0}{0.0, math.pi * 2.0}
|
||||
[384] = "%.4f", -- Backseat - HSI2 Course Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[382] = "%.4f", -- Backseat - HSI2 Alt Deviation Bar {-0.8, 0.8}{-1.0, 1.0}
|
||||
[383] = "%.4f", -- Backseat - HSI2 Glide Beacon
|
||||
[381] = "%.4f", -- Backseat - HSI2 Localizer Beacon
|
||||
-- RSPN
|
||||
[404] = "%.4f", -- Backseat - RSBN Range 100
|
||||
[403] = "%.4f", -- Backseat - RSBN Range 10
|
||||
[402] = "%.4f", -- Backseat - RSBN Range 1
|
||||
-- Barometric altimeter VD-20 instructor
|
||||
[389] = "%.4f", -- Backseat - VD-20 km {0.0, 1.0}{0.0, 20.0}
|
||||
[390] = "%.4f", -- Backseat - VD-20 m {0.0, 1.0}{0.0, 1000.0}
|
||||
[391] = "%.4f", -- Backseat - VD-20 km Ind {0.0, 1.0}{0.0, 20.0}
|
||||
[392] = "%.4f", -- Backseat - VD-20 m Ind {0.0, 1.0}{0.0, 1000.0}
|
||||
--[393] = "%.4f", -- Backseat - VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
-- Barometric altimeter
|
||||
-- Altimeter Feet , copy of A-10 altimeter
|
||||
[737] = "%.4f", -- Altimeter_100_footPtr {0.0, 1.0}{0.0, 1000.0}
|
||||
[732] = "%.4f", -- Altimeter_10000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[731] = "%.4f", -- Altimeter_1000_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[730] = "%.4f", -- Altimeter_100_footCount {0.0, 1.0}{0.0, 10.0}
|
||||
[736] = "%.4f", -- pressure_setting_0 {0.0, 1.0}{0.0, 10.0}
|
||||
[735] = "%.4f", -- pressure_setting_1 {0.0, 1.0}{0.0, 10.0}
|
||||
[734] = "%.4f", -- pressure_setting_2 {0.0, 1.0}{0.0, 10.0}
|
||||
[733] = "%.4f", -- pressure_setting_3 {0.0, 1.0}{0.0, 10.0}
|
||||
-- AIRSPEED AND MACH
|
||||
[386] = "%.4f", -- Backseat - IAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[387] = "%.4f", -- Backseat - TAS {0.0, 0.08, 0.186, 0.296, 0.436, 0.55, 0.635, 0.705, 0.765, 0.824, 1.0}{0.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 1200.0}
|
||||
[388] = "%.4f", -- Backseat - MACH 2
|
||||
-- RKL-41
|
||||
[420] = "%.4f", -- Backseat - RKL-41 needle {0.0, 1.0}{0.0, math.pi * 2.0}
|
||||
[513] = "%.4f", -- Backseat - RKL-41 Signal
|
||||
-- oxygen interface
|
||||
[477] = "%.4f", -- Backseat - OxygenPressure {0.0, 0.025, 0.925, 1.0}{0.0, 10.0, 150.0, 160.0}
|
||||
[478] = "%.4f", -- Backseat - FlowBlinker
|
||||
-- accelerometer
|
||||
[550] = "%.4f", -- Backseat - CockpitAlt {0.0, 1.0}{0.0, 20000.0}
|
||||
[551] = "%.4f", -- Backseat - PressDiff {0.0, 0.102, 0.202, 0.398, 0.779, 1.0}{-0.04, -0.02, 0.0, 0.1, 0.4, 0.6}
|
||||
-- Fuel Quantity
|
||||
[427] = "%.4f", -- Backseat - Fuel Quantity {0.0, 0.127, 0.239, 0.35, 0.458, 0.56, 0.685, 0.82, 1.0}{0.0, 100.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 825.0}
|
||||
-- Fan RPM
|
||||
[425] = "%.4f", -- Backseat - Fan RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Compressor RPM
|
||||
[424] = "%.4f", -- Backseat - Compressor RPM {0.0, 0.09, 0.18, 0.28, 0.372, 0.468, 0.555, 0.645, 0.733, 0.822, 0.909, 1.0}{0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}
|
||||
-- Oil
|
||||
[423] = "%.4f", -- Backseat - Oil Temp {0.0, 0.323, 0.576, 0.817, 1.0}{-50.0, 0.0, 50.0, 100.0, 150.0}
|
||||
[422] = "%.4f", -- Backseat - Oil Press {0.0, 0.077, 1.0}{-1.0, 0.0, 6.0}
|
||||
-- Fuel Press
|
||||
[421] = "%.4f", -- Backseat - Fuel Press {0.0, 0.06, 0.148, 0.323, 0.547, 0.659, 0.801, 1.0}{-1.0, 0.0, 20.0, 40.0, 60.0, 70.0, 80.0, 100.0}
|
||||
-- lights system
|
||||
--[559] = "%.4f", -- Backseat - CptInstrumentLightsIntensity
|
||||
-- RKL-41 Radio Compass
|
||||
[564] = "%.f", -- Backseat - FarNDBSelectorLamp CP
|
||||
[571] = "%.f", -- Backseat - NearNDBSelectorLamp CP
|
||||
[566] = "%.f", -- Backseat - RKL PanelLights
|
||||
-- BrakeHandle
|
||||
[542] = "%.4f", -- Backseat - BrakeHandle CP
|
||||
-- Lamps
|
||||
[358] = "%.f", -- Backseat - MRP 56 Instructor
|
||||
[347] = "%.f", -- Backseat - MainGen Instructor
|
||||
[350] = "%.f", -- Backseat - ReserveGen Instructor
|
||||
[353] = "%.f", -- Backseat - Inverter115 Instructor
|
||||
[357] = "%.f", -- Backseat - Inverter363 Instructor
|
||||
[462] = "%.f", -- Backseat - FlapsUp
|
||||
[463] = "%.f", -- Backseat - FlapsTO
|
||||
[464] = "%.f", -- Backseat - FlapsDn
|
||||
[436] = "%.f", -- Backseat - AirBrakes
|
||||
[432] = "%.f", -- Backseat - GearDown front
|
||||
[431] = "%.f", -- Backseat - GearDown left
|
||||
[433] = "%.f", -- Backseat - GearDown right
|
||||
[429] = "%.f", -- Backseat - GearUp front
|
||||
[428] = "%.f", -- Backseat - GearUp left
|
||||
[430] = "%.f", -- Backseat - GearUp right
|
||||
[434] = "%.f", -- Backseat - ExtendGears
|
||||
[435] = "%.f", -- Backseat - DoorsOu
|
||||
[356] = "%.f", -- Backseat - BreakdownFinished
|
||||
[443] = "%.f", -- Backseat - GA TILT
|
||||
[343] = "%.f", -- Backseat - DangerAltitudeInstructor
|
||||
[365] = "%.f", -- Backseat - EmergFuel
|
||||
[345] = "%.f", -- Backseat - Remain150
|
||||
[348] = "%.f", -- Backseat - DoNotStart
|
||||
[364] = "%.f", -- Backseat - FuelFilter
|
||||
[355] = "%.f", -- Backseat - WingTanks
|
||||
[441] = "%.f", -- Backseat - TrimmerRollNeutral
|
||||
[442] = "%.f", -- Backseat - TrimmerPitchNeutral
|
||||
[344] = "%.f", -- Backseat - MachMeterLamp
|
||||
[351] = "%.f", -- Backseat - CanopyNotClosed
|
||||
[349] = "%.f", -- Backseat - Vibration
|
||||
[342] = "%.f", -- Backseat - Fire
|
||||
[352] = "%.f", -- Backseat - CockpitPressure
|
||||
[361] = "%.f", -- Backseat - ConditioningClosed
|
||||
[363] = "%.f", -- Backseat - Defrost
|
||||
[360] = "%.f", -- Backseat - Ice
|
||||
[346] = "%.f", -- Backseat - HydraulicPressureDrop
|
||||
[455] = "%.f", -- Backseat - MasterDanger
|
||||
[565] = "%.f", -- Backseat - RadioUnderControl
|
||||
[354] = "%.f", -- Backseat - EmptyWingFuelTanks
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Front Seat
|
||||
-- ASP-3NMU Gunsight
|
||||
[101] = "%1d", -- ASP-3NMU Gunsight Mode, GYRO/FIXED
|
||||
[102] = "%.1f", -- ASP-3NMU Gunsight Brightness Knob (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[103] = "%.1f", -- ASP-3NMU Gunsight Target Wingspan Adjustment Dial (meters) (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[104] = "%1d", -- ASP-3NMU Gunsight Color Filter, ON/OFF
|
||||
[105] = "%1d", -- ASP-3NMU Gunsight Fixed Reticle Mask Lever
|
||||
[106] = "%.1f", -- ASP-3NMU Gunsight Mirror Depression (Axis) {0.0, 1.0} in 0.05 Steps
|
||||
[107] = "%.1f", -- ASP-3NMU Gunsight Target Distance (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- CLOCK
|
||||
[335] = "%1d", -- Mech clock left lever Button
|
||||
[336] = "%.1f", -- Mech clock left lever (Axis) {0.0, 1.0} in 0.04 Steps
|
||||
[337] = "%1d", -- Mech clock right lever Button
|
||||
[338] = "%.1f", -- Mech clock right lever (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Baro Altimeter
|
||||
[57] = "%.f2", -- Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.6 Steps
|
||||
-- Radar Altimeter
|
||||
[60] = "%1d", -- RV-5M Radio Altimeter Test Button
|
||||
[61] = "%.2f", -- RV-5M Radio Altimeter Decision Height Knob (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- GMK
|
||||
[204] = "%1d", -- GMK-1AE GMC Hemisphere Selection Switch, N(orth)/S(outh)
|
||||
[207] = "%1d", -- GMK-1AE GMC Mode Switch, MC(Magnetic Compass Mode)/GC(Directional Gyro Mode)
|
||||
[205] = "%1d", -- GMK-1AE GMC Test Switch, 0(degrees)/OFF/300(degrees) - Use to check heading indication accuracy {-1.0,0.0,1.0}
|
||||
[208] = "%1d", -- GMK-1AE GMC Course Selector Switch, CCW/OFF/CW {-1.0,0.0,1.0}
|
||||
[209] = "%.2f", -- GMK-1AE GMC Latitude Selector Knob (Axis) {0.0, 1.0} in 0.02 Steps
|
||||
-- Gyro
|
||||
[124] = "%1d", -- MC Synchronization Button - Push to synchronize (level flight only)
|
||||
-- Magnetic Variation
|
||||
[532] = "%.2f", -- Magnetic Declination set Knob (Axis) {0.0, 1.0} in 0.05 Steps
|
||||
-- KPP-1273K (ADI)
|
||||
[30] = "%1d", -- KPP-1273K Attitude Director Indicator (ADI) Cage Button
|
||||
[39] = "%.2f", -- KPP-1273K Attitude Director Indicator (ADI) Pitch Trim Knob {-1.0, 1.0} in 0.05 Steps
|
||||
[177] = "%1d", -- SDU Switch, ON/OFF
|
||||
[460] = "%1d", -- AGD Pitch Failure
|
||||
[461] = "%1d", -- AGD Bank Failure
|
||||
-- NPP (HSI)
|
||||
[48] = "%.2f", -- HSI Course set Knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[526] = "%1d", -- Course Accordance
|
||||
[458] = "%1d", -- GMK Failure
|
||||
-- ISKRA (RSBN)
|
||||
[178] = "%.1f", -- RSBN Mode Switch, LANDING/NAVIGATION/GLIDE PATH {0.0,0.1,0.2}
|
||||
[179] = "%1d", -- RSBN Identification Button
|
||||
[180] = "%1d", -- RSBN Test Button - Push to test
|
||||
[181] = "%.2f", -- RSBN Control Box Lighting Intensity Knob (Axis) {0.0, 0.8} in 0.04 Steps
|
||||
[184] = "%.2f", -- RSBN Volume Knob (Axis) {0.0, 0.8} in 0.04 Steps
|
||||
[187] = "%1d", -- Initial Azimuth {-1.0,0.0,1.0}
|
||||
[188] = "%1d", -- Initial Range {-1.0,0.0,1.0}
|
||||
[191] = "%.3f", -- RSBN Navigation Channel Selector Knob (Axis) {0.0, 1.0} in 0.025 Steps
|
||||
[192] = "%1d", -- RSBN Landing Channel Selector Knob (Axis) {0.0, 1.0} in 0.025 Steps
|
||||
[193] = "%1d", -- Set 0 Azimuth
|
||||
[201] = "%.2f", -- RSBN Field Elevation Knob (Axis) {0.0, 1.0} in 0.02 Steps
|
||||
[297] = "%1d", -- RSBN Listen Callsign Button - Push to listen
|
||||
[527] = "%1d", -- RSBN Emergency Landing Switch, ON/OFF
|
||||
-- Variometer
|
||||
[569] = "%.1f", -- Variometer adjustment knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RKL-41
|
||||
[119] = "%1d", -- RKL-41 ADF Outer-Inner Beacon (Far-Near NDB) Switch
|
||||
[157] = "%.2f", -- RKL-41 ADF Volume Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[161] = "%1d", -- RKL-41 ADF Brightness Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[159] = "%1d", -- RKL-41 ADF Mode Switch, TLF(A3)/TLG(A1,A2)
|
||||
[160] = "%.1f", -- RKL-41 ADF Function Selector Switch, OFF/COMP(AUTO)/COMP(MAN)/ANT/LOOP {0.0,0.1,0.2,0.3,0.4}
|
||||
[162] = "%1d", -- RKL-41 ADF Loop Switch, LEFT/OFF/RIGHT {-1.0,0.0,1.0}
|
||||
[158] = "%1d", -- RKL-41 ADF Control Switch, TAKE CONTROL/HAND OVER CONTROL
|
||||
[165] = "%.2f", -- RKL-41 ADF Far NDB Frequency Tune (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[163] = "%.4f", -- RKL-41 ADF Far NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[164] = "%.1f", -- RKL-41 ADF Far NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
[168] = "%.2f", -- RKL-41 ADF Near NDB Frequency Tune (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[166] = "%.4f", -- RKL-41 ADF Near NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[167] = "%.1f", -- RKL-41 ADF Near NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
[459] = "%1d", -- ARK Failure
|
||||
-- electric system
|
||||
[141] = "%1d", -- Battery Switch, ON/OFF
|
||||
[142] = "%1d", -- Main Generator Switch, ON/OFF
|
||||
[143] = "%1d", -- Emergency Generator Switch, ON/OFF
|
||||
[502] = "%1d", -- Net Switch, ON/OFF
|
||||
[169] = "%1d", -- Emergency Engine Instruments Power Switch, ON/OFF
|
||||
[315] = "%1d", -- Turbo Button
|
||||
[313] = "%1d", -- Stop Turbo Switch, ON/OFF
|
||||
[326] = "%1d", -- Engine Button
|
||||
[320] = "%1d", -- Emergency Fuel Switch
|
||||
[322] = "%.1f", -- Engine Start Mode Switch, START/FALSE START/COLD CRANKING {0.0,0.1,0.2}
|
||||
[144] = "%1d", -- CB Engine Switch, ON/OFF
|
||||
[145] = "%1d", -- CB AGD-GMK Switch, ON/OFF
|
||||
[146] = "%1d", -- CB Inverter 1 (AC 115V) Switch, ON/OFF
|
||||
[147] = "%1d", -- CB Inverter 2 (AC 115V) Switch, ON/OFF
|
||||
[148] = "%1d", -- CB RDO (ICS and Radio) Switch, ON/OFF
|
||||
[149] = "%1d", -- CB MRP-RV (Marker Beacon Receiver and Radio Altimeter) Switch, ON/OFF
|
||||
[150] = "%1d", -- CB RSBN (ISKRA) Switch, ON/OFF
|
||||
[151] = "%1d", -- CB IFF (SRO) Emergency Connection Switch, ON/OFF
|
||||
[152] = "%1d", -- CB RSBN (ISKRA) Emergency Connection Switch, ON/OFF
|
||||
[153] = "%1d", -- CB Wing Tanks Switch, ON/OFF
|
||||
[154] = "%1d", -- CB RIO-3 De-Icing Signal Switch, ON/OFF
|
||||
[155] = "%1d", -- CB SDU Switch, ON/OFF
|
||||
[628] = "%1d", -- CB Heating AOA Sensor Switch, ON/OFF
|
||||
[505] = "%1d", -- CB Weapon Switch, ON/OFF
|
||||
[211] = "%1d", -- CB Air Conditioning, ON/OFF
|
||||
[212] = "%1d", -- CB Anti-Ice, ON/OFF
|
||||
[213] = "%1d", -- CB Pitot Left, ON/OFF
|
||||
[214] = "%1d", -- CB Pitot Right, ON/OFF
|
||||
[215] = "%1d", -- CB PT-500C, ON/OFF
|
||||
[216] = "%1d", -- CB ARC, ON/OFF
|
||||
[217] = "%1d", -- CB SRO, ON/OFF
|
||||
[218] = "%1d", -- CB Seat-Helmet, ON/OFF
|
||||
[219] = "%1d", -- CB Gears, ON/OFF
|
||||
[220] = "%1d", -- CB Control, ON/OFF
|
||||
[221] = "%1d", -- CB Signaling, ON/OFF
|
||||
[222] = "%1d", -- CB Nav. Lights, ON/OFF
|
||||
[223] = "%1d", -- CB Spotlight Left, ON/OFF
|
||||
[224] = "%1d", -- CB Spotlight Right, ON/OFF
|
||||
[225] = "%1d", -- CB Red Lights, ON/OFF
|
||||
[226] = "%1d", -- CB White Lights, ON/OFF
|
||||
[227] = "%1d", -- CB Start Panel, ON/OFF
|
||||
[228] = "%1d", -- CB Booster Pump, ON/OFF
|
||||
[229] = "%1d", -- CB Ignition 1, ON/OFF
|
||||
[230] = "%1d", -- CB Ignition 2, ON/OFF
|
||||
[231] = "%1d", -- CB Engine Instruments, ON/OFF
|
||||
[232] = "%1d", -- CB Fire, ON/OFF
|
||||
[233] = "%1d", -- CB Emergency Jettison, ON/OFF
|
||||
[234] = "%1d", -- CB SARPP, ON/OFF
|
||||
[503] = "%1d", -- CB Seat, ON/OFF
|
||||
[504] = "%1d", -- CB Signal, ON/OFF
|
||||
[512] = "%1d", -- CB Ground Intercom, ON/OFF
|
||||
[294] = "%1d", -- Standby (Left) Pitot Tube Heating Button - Push to turn heating on
|
||||
[295] = "%1d", -- Main (Right) Pitot Tube Heating Button - Push to turn heating on
|
||||
[292] = "%1d", -- Standby (Left) Pitot Tube Heating Off Button - Push to turn heating off
|
||||
[293] = "%1d", -- Standby (Left) Pitot Tube Heating Off Button - Push to turn heating off
|
||||
-- lights system
|
||||
[176] = "%.1f", -- Navigation Lights Mode Control Switch, FLICKER/OFF/FIXED {0.0,0.5,1.0}
|
||||
[175] = "%.1f", -- Navigation Lights Intensity Control Switch, DIM(30%)/BRT(60%)/MAX(100%) {0.0,0.5,1.0}
|
||||
[311] = "%1d", -- Taxi and Landing Lights (Searchlights) Control Switch, TAXI/OFF/LANDING {-1.0,0.0,1.0}
|
||||
[330] = "%1d", -- Instrument Lighting Switch, Red/OFF/White {-1.0,0.0,1.0}
|
||||
[331] = "%.1f", -- Instrument Lights Intensity Knob (Axis) {0.1,0.9} in 0.1 Steps
|
||||
[249] = "%1d", -- Emergency Instrument Light Switch, ON/OFF
|
||||
[202] = "%.1f", -- Warning-Light Intensity Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[203] = "%1d", -- Warning-Light Check Button - Push to check
|
||||
-- Weapon System
|
||||
[254] = "%1d", -- CB Armament System Power Switch, ON/OFF
|
||||
[255] = "%1d", -- CB Missile Firing Control Circuit Power Switch, ON/OFF
|
||||
[256] = "%1d", -- CB ASP-FKP (Gunsight and Gun Camera) Power Switch, ON/OFF
|
||||
[257] = "%1d", -- CB Missile Seeker Heating Circuit Power Switch, ON/OFF
|
||||
[258] = "%1d", -- CB Missile Seeker Glowing Circuit Power Switch, ON/OFF
|
||||
[259] = "%.1f", -- Missile Seeker Tone Volume Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[268] = "%1d", -- Arm/Safe Bombs Emergency Jettison Switch, LIVE/BLANK
|
||||
[271] = "%.1f", -- Rockets Firing Mode Selector Switch, AUT./2RS/4RS {0.0,0.1,0.2}
|
||||
[509] = "%1d", -- Arm/Safe Bombs Emergency Jettison Switch, LIVE/BOMBS/BLANK {-1.0,0.0,1.0}
|
||||
[507] = "%1d", -- Emergency Jettison Switch, ON/OFF
|
||||
[273] = "%1d", -- EKSR-46 Signal Flare Dispenser Power Switch, ON/OFF
|
||||
[274] = "%1d", -- EKSR-46 Yellow Signal Flare Launch Button
|
||||
[275] = "%1d", -- EKSR-46 Green Signal Flare Launch Button
|
||||
[276] = "%1d", -- EKSR-46 Red Signal Flare Launch Button
|
||||
[277] = "%1d", -- EKSR-46 White Signal Flare Launch Button
|
||||
[260] = "%1d", -- Missile/Bomb Release Selector Switch, PORT(Left)/STARB-BOTH(Right for Missiles/Both)
|
||||
[583] = "%1d", -- Gun+PK3 Switch
|
||||
[590] = "%1d", -- Emergency Jettison Inboard Stations Switch, ON/OFF
|
||||
[607] = "%1d", -- Pyro Charge Apply {0.0,0.5,1.0}
|
||||
[576] = "%1d", -- Gsh-23 Arm/Safe
|
||||
[585] = "%1d", -- Outboard Stations Select
|
||||
[586] = "%1d", -- Outboard Stations Deselect
|
||||
[587] = "%1d", -- Inboard Stations Select
|
||||
[588] = "%1d", -- Inboard Stations Deselect
|
||||
[577] = "%1d", -- Charge Outer Guns
|
||||
[578] = "%1d", -- Charge Inner Guns
|
||||
[592] = "%1d", -- Emergency Launch Missiles
|
||||
[597] = "%1d", -- Arm Outer Guns
|
||||
[598] = "%1d", -- Arm Inner Guns
|
||||
[596] = "%1d", -- Arm Bombs
|
||||
[584] = "%1d", -- Bombs Series {-1.0,0.0,1.0}
|
||||
[270] = "%1d", -- Emergency Jettison Outboard Stations Switch, ON/OFF
|
||||
[629] = "%1d", -- CB Weapon Switch, ON/OFF
|
||||
[599] = "%1d", -- Deblock Guns
|
||||
-- oxygen system
|
||||
[303] = "%1d", -- Emergency Oxygen Switch, ON/OFF
|
||||
[304] = "%1d", -- Diluter Demand Switch, 100% / MIX
|
||||
[307] = "%1d", -- Helmet Ventilation Switch, ON/OFF
|
||||
[306] = "%.2f", -- Oxygen Supply Valve (CLOSE - CW, OPEN - CCW) (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[484] = "%.2f", -- Oxygen Interconnaction Valve (CLOSE - CW, OPEN - CCW) (Axis) {0.0,1.0} in 0.05 Steps
|
||||
-- sarpp
|
||||
[298] = "%1d", -- SARPP Flight Recorder, ON/OFF
|
||||
-- fuel system
|
||||
[296] = "%1d", -- Fuel Shut-Off Lever
|
||||
-- air system
|
||||
[245] = "%.1f", -- ECS and Pressurization Handle, OFF/CANOPIES SEALED/ECS ON (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[172] = "%.2f", -- Cabin Air Conditioning Control Switch, OFF/HEAT/COOL/AUTOMATIC {0.0,0.25} in 0.05 Steps
|
||||
[173] = "%.1f", -- Cabin Air Temperature Controller Rheostat (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[121] = "%.2f", -- Diffuser and Flight Suit Air Conditioning Control Switch, HEAT/AUTO/COOL {0.0,0.25} in 0.05 Steps
|
||||
[120] = "%.1f", -- Diffuser and Flight Suit Temperature Rheostat (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[511] = "%1d", -- Conditioning Shutoff Switch, OPEN/FRONT PILOT CONTROL/CLOSE {-1.0,0.0,1.0}
|
||||
-- anti-icing system
|
||||
[174] = "%1d", -- De-Icing Mode Switch, MANUAL/AUTOMATIC/OFF {0.0,0.1,0.2}
|
||||
[183] = "%1d", -- RIO-3 De-Icing Sensor Heating Circuit Check Button - Push to test
|
||||
-- helmet heating
|
||||
[309] = "%1d", -- Helmet Visor Quick Heating Button - Push to heat
|
||||
[308] = "%1d", -- Helmet Heating Mode Switch, AUTO/OFF/ON {0.0,0.5,1.0}
|
||||
[310] = "%.1f", -- Helmet Heating Temperature Rheostat (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- SPU-9
|
||||
[209] = "%1d", -- Reserve Intercom Switch, ON/OFF
|
||||
[291] = "%1d", -- ADF Audio Switch, ADF/OFF
|
||||
[288] = "%1d", -- Intercom Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[289] = "%1d", -- Radio Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[134] = "%1d", -- Radio Button
|
||||
[133] = "%1d", -- Intercom Button
|
||||
-- R-832M
|
||||
[287] = "%1d", -- Radio Control Switch, ON/OFF
|
||||
[286] = "%1d", -- Squelch Switch, ON/OFF
|
||||
[284] = "%1d", -- R-832M Preset Channel Selector Knob (Axis) {0.0,1.0} in 20 0.05 Steps
|
||||
-- engine systems
|
||||
[329] = "%1d", -- IV-300 Engine Vibration Test Button - Push to test
|
||||
[328] = "%1d", -- Fire Extinguish Button - Push to extinguish
|
||||
[272] = "%1d", -- Fire Warning Signal Test Switch, I/OFF/II {-1.0,0.0,1.0}
|
||||
[324] = "%1d", -- RT-12 JPT Regulator Manual Disable Switch, RT-12 DISABLED/RT-12 ENABLED
|
||||
[243] = "%1d", -- RT-12 JPT Regulator Power Switch, ON/OFF
|
||||
[242] = "%1d", -- RT-12 JPT Regulator Test Switch, I/OFF/II {-1.0,0.0,1.0}
|
||||
[499] = "%1d", -- EGT Indicator Switch, FRONT/REAR
|
||||
-- control system
|
||||
[281] = "%1d", -- Flaps Flight Position (0 degrees) Button
|
||||
[282] = "%1d", -- Flaps Takeoff Position (25 degrees) Button
|
||||
[283] = "%1d", -- Flaps Landing Position (44 degrees) Button
|
||||
[549] = "%1d", -- Throttle Limiter
|
||||
[135] = "%1d", -- Air Brake Switch {0.0,1.0}
|
||||
[136] = "%1d", -- Air Brake Switch (2nd position) {0.0,1.0}
|
||||
[118] = "%1d", -- Landing Gear Control Lever {-1.0,0.0,1.0}
|
||||
[334] = "%.1f", -- Emergency/Parking Wheel Brake Lever {0.0,1.0} in 0.1 Steps
|
||||
[334] = "%1d", -- Parking Brake Lever Flag - Push to remove parking brake
|
||||
[197] = "%1d", -- Main and Emergency Hydraulic Systems Interconnection Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[194] = "%1d", -- Emergency Landing Gear Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[195] = "%1d", -- Emergency Flaps Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[196] = "%1d", -- RAT (Emergency Generator) Emergency Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[456] = "%1d", -- Full Pressure Failure Lever, ON/STBY/FAILURE {-0.5,0.0,0.5}
|
||||
[457] = "%1d", -- Static Pressure Failure Lever, ON/STBY/FAILURE {-0.5,0.0,0.5}
|
||||
-- accelerometer
|
||||
[89] = "%1d", -- Reset Limits
|
||||
-- canopy
|
||||
[998] = "%1d", -- Canopy Handle
|
||||
[285] = "%1d", -- Forward Canopy Lock Handle
|
||||
[244] = "%1d", -- Forward Canopy Emergency Jettison Handle
|
||||
-- Pitot Selector
|
||||
[333] = "%1d", -- Pitot Tube Selector Lever, STBY(Left)/MAIN(Right)
|
||||
-- Back Seat
|
||||
-- CLOCK
|
||||
[412] = "%1d", -- Backseat - Mech clock left lever Button
|
||||
[413] = "%.1f", -- Backseat - Mech clock left lever (Axis) {0.0, 1.0} in 0.04 Steps
|
||||
[414] = "%1d", -- Backseat - Mech clock right lever Button
|
||||
[415] = "%.1f", -- Backseat - Mech clock right lever (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Baro Altimeter
|
||||
[394] = "%.f2", -- Backseat - Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.6 Steps
|
||||
-- Radar Altimeter
|
||||
[398] = "%1d", -- Backseat - RV-5M Radio Altimeter Test Button
|
||||
[399] = "%.2f", -- Backseat - RV-5M Radio Altimeter Decision Height Knob (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- GMK
|
||||
-- Gyro
|
||||
[444] = "%1d", -- Backseat - MC Synchronization Button - Push to synchronize (level flight only)
|
||||
-- KPP-1273K (ADI)
|
||||
[367] = "%1d", -- Backseat - KPP-1273K Attitude Director Indicator (ADI) Cage Button
|
||||
[376] = "%.2f", -- Backseat - KPP-1273K Attitude Director Indicator (ADI) Pitch Trim Knob (Axis) {-1.0, 1.0} in 0.05 Steps
|
||||
-- NPP (HSI)
|
||||
[385] = "%.2f", -- Backseat - HSI Course set knob (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
-- Variometer
|
||||
[419] = "%.1f", -- Backseat - Variometer adjustment knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RKL-41
|
||||
[440] = "%1d", -- Backseat - RKL-41 ADF Outer-Inner Beacon (Far-Near NDB) Switch
|
||||
[514] = "%.2f", -- Backseat - RKL-41 ADF Volume Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[518] = "%.2f", -- Backseat - RKL-41 ADF Brightness Knob (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[516] = "%1d", -- Backseat - RKL-41 ADF Mode Switch, TLF(A3)/TLG(A1,A2)
|
||||
[517] = "%.1f", -- Backseat - RKL-41 ADF Function Selector Switch, OFF/COMP(AUTO)/COMP(MAN)/ANT/LOOP {0.0,0.1,0.2,0.3,0.4}
|
||||
[519] = "%1d", -- Backseat - RKL-41 ADF Loop Switch, LEFT/OFF/RIGHT
|
||||
[515] = "%1d", -- Backseat - RKL-41 ADF Control Switch, TAKE CONTROL/HAND OVER CONTROL
|
||||
[522] = "%.2f", -- Backseat - RKL-41 ADF Far NDB Frequency Tune (Axis) {1.0, 0.0} in 0.05 Steps
|
||||
[520] = "%.4f", -- Backseat - RKL-41 ADF Far NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[521] = "%.1f", -- Backseat - RKL-41 ADF Far NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
[525] = "%.2f", -- Backseat - RKL-41 ADF Near NDB Frequency Tune (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[523] = "%.4f", -- Backseat - RKL-41 ADF Near NDB 100kHz rotary (Axis) {0.0,0.938} in 0.0588 Steps
|
||||
[524] = "%.1f", -- Backseat - RKL-41 ADF Near NDB 10kHz rotary (Axis) {0.0,0.9} in 0.1 Steps
|
||||
-- electric system
|
||||
[488] = "%1d", -- Backseat - Turbo Button
|
||||
[494] = "%1d", -- Backseat - Engine Button
|
||||
[490] = "%1d", -- Backseat - Stop Engine Switch
|
||||
[492] = "%1d", -- Backseat - Emergency Fuel Switch
|
||||
-- lights system
|
||||
[486] = "%1d", -- Backseat - Taxi and Landing Lights (Searchlights) Control Switch, TAXI/OFF/LANDING {-1.0,0.0,1.0}
|
||||
[497] = "%1d", -- Backseat - Instrument Lighting Switch, Red/OFF/White {-1.0,0.0,1.0}
|
||||
[498] = "%.1f", -- Backseat - Instrument Lights Intensity Knob (Axis) {0.1,0.9} in 0.1 Steps
|
||||
[537] = "%.1f", -- Backseat - Warning-Light Intensity Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[538] = "%1d", -- Backseat - Warning-Light Check Button - Push to check
|
||||
-- oxygen system
|
||||
[479] = "%1d", -- Backseat - Emergency Oxygen Switch, ON/OFF
|
||||
[480] = "%1d", -- Backseat - Diluter Demand Switch, 100% / MIX
|
||||
[482] = "%.4f", -- Backseat - Oxygen Supply Valve (CLOSE - CW, OPEN - CCW) (Axis) {0.0,1.0} in 0.05 Steps
|
||||
-- fuel system
|
||||
[475] = "%1d", -- Backseat - Fuel Shut-Off Lever
|
||||
-- air system
|
||||
[245] = "%.1f", -- Backseat - ECS and Pressurization Handle, OFF/CANOPIES SEALED/ECS ON (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- SPU-9
|
||||
[473] = "%1d", -- Backseat - Reserve Intercom Switch, ON/OFF
|
||||
[474] = "%1d", -- Backseat - ADF Audio Switch, ADF/OFF
|
||||
[471] = "%1d", -- Backseat - Intercom Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[472] = "%1d", -- Backseat - Radio Volume Knob (Axis) {0.0,0.8} in 0.05 Steps
|
||||
[547] = "%1d", -- Backseat - Radio Button
|
||||
[546] = "%1d", -- Backseat - Intercom Button
|
||||
-- R-832M
|
||||
[470] = "%1d", -- Backseat - Radio Control Switch, ON/OFF
|
||||
[469] = "%1d", -- Backseat - Squelch Switch, ON/OFF
|
||||
[468] = "%1d", -- Backseat - R-832M Preset Channel Selector Knob (Axis) {0.0,1.0} in 20 0.05 Steps
|
||||
-- control system
|
||||
[465] = "%1d", -- Backseat - Flaps Flight Position (0 degrees) Button
|
||||
[466] = "%1d", -- Backseat - Flaps Takeoff Position (25 degrees) Button
|
||||
[467] = "%1d", -- Backseat - Flaps Landing Position (44 degrees) Button
|
||||
[548] = "%1d", -- Backseat - Air Brake Switch {-1.0, 0.0, 1.0}
|
||||
[437] = "%1d", -- Backseat - Landing Gear Control Lever {0.0,0.5,1.0} ??? eigentlich 4 Positionen
|
||||
[501] = "%.1f", -- Backseat - Emergency Wheel Brake Lever {0.0,1.0} in 0.1 Steps
|
||||
[536] = "%1d", -- Backseat - Main and Emergency Hydraulic Systems Interconnection Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[533] = "%1d", -- Backseat - Emergency Landing Gear Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[534] = "%1d", -- Backseat - Emergency Flaps Extension Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
[535] = "%1d", -- Backseat - RAT (Emergency Generator) Emergency Lever, FORWARD(OFF)/BACKWARD(ON)
|
||||
-- canopy
|
||||
[999] = "%1d", -- Backseat - Canopy Handle
|
||||
[485] = "%1d", -- Backseat - Canopy Lock Handle
|
||||
[539] = "%1d", -- Backseat - Canopy Emergency Jettison Handle
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- Front Seat
|
||||
|
||||
-- ADI correction
|
||||
--[31] = "%.4f", -- KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
--[40] = "%.4f", -- KPP 1273K sideslip {-1.0, 1.0}
|
||||
local lPitch = mainPanelDevice:get_argument_value(31)
|
||||
|
||||
lPitch = lPitch * 2
|
||||
|
||||
ExportScript.Tools.SendData(31, string.format("%.4f", lPitch))
|
||||
ExportScript.Tools.SendData(40, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(40)))) -- negate
|
||||
|
||||
-- HSI correction
|
||||
--[41] = "%.4f", -- HSI heading {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
--[42] = "%.4f", -- HSI commanded course needle (yellow needle) {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
local lCommandCourse = mainPanelDevice:get_argument_value(42)
|
||||
|
||||
lCommandCourse = lCommandCourse + 0.5 -- 180 degree turn
|
||||
|
||||
ExportScript.Tools.SendData(41, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(41)))) -- negate
|
||||
ExportScript.Tools.SendData(42, string.format("%.4f", lCommandCourse))
|
||||
|
||||
-- Back Seat
|
||||
|
||||
-- ADI correction
|
||||
--[368] = "%.4f", -- KPP 1273K pitch {-0.5, 0.5} {-math.pi / 2.0, math.pi / 2.0}
|
||||
--[377] = "%.4f", -- KPP 1273K sideslip {-1.0, 1.0}
|
||||
local lPitch2 = mainPanelDevice:get_argument_value(368)
|
||||
|
||||
lPitch2 = lPitch2 * 2
|
||||
|
||||
ExportScript.Tools.SendData(368, string.format("%.4f", lPitch2))
|
||||
ExportScript.Tools.SendData(377, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(377)))) -- negate
|
||||
|
||||
-- HSI correction
|
||||
--[378] = "%.4f", -- HSI heading {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
--[379] = "%.4f", -- HSI commanded course needle (wihte needle) {1.0, 0.0} {0.0, math.pi * 2.0}
|
||||
local lCommandCourse2 = mainPanelDevice:get_argument_value(379)
|
||||
|
||||
lCommandCourse2 = lCommandCourse2 + 0.5 -- 180 degree turn
|
||||
|
||||
ExportScript.Tools.SendData(378, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(378)))) -- negate
|
||||
ExportScript.Tools.SendData(379, string.format("%.4f", lCommandCourse2))
|
||||
|
||||
-- VD-20 Presseure correction
|
||||
--[56] = "%.4f", -- VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
local lVD_20_PRESS = mainPanelDevice:get_argument_value(56)
|
||||
--ExportScript.Tools.WriteToLog('Pressure: '..ExportScript.Tools.dump(lVD_20_PRESS))
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 0.89 -- maximaler Ausgabewert
|
||||
x_min = 0.0 -- minimaler Eingangswert
|
||||
x_max = 0.76793104410172 -- maximaler Eingangswert
|
||||
x = 0.57506740093231 -- aktueller Eingangswert
|
||||
|
||||
d_y = 0.89 -- Delta Ausga
|
||||
d_x = 0.76793104410172 -- Delta Eingangswerte (x_max
|
||||
m = 1.158958225267568124678891052043 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.0000000000000000000000000000002387929418604 (2.387929418604e-32) -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.66648 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
if gVD_20_PRESS ~= lVD_20_PRESS then
|
||||
gVD_20_PRESS = lVD_20_PRESS
|
||||
lVD_20_PRESS = 1.158958225267568124678891052043 * lVD_20_PRESS + 0.0000000000000000000000000000002387929418604
|
||||
--ExportScript.Tools.WriteToLog('Pressure2: '..ExportScript.Tools.dump(lVD_20_PRESS))
|
||||
ExportScript.Tools.SendData(56, string.format("%.4f", lVD_20_PRESS))
|
||||
end
|
||||
|
||||
--[393] = "%.4f", -- Backseat - VD-20 PRESS {0.0, 1.0}{670.0, 826.0}
|
||||
local lVD_20_PRESS_Backseat = mainPanelDevice:get_argument_value(393)
|
||||
--ExportScript.Tools.WriteToLog('Pressure: '..ExportScript.Tools.dump(lVD_20_PRESS_Backseat))
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 0.89 -- maximaler Ausgabewert
|
||||
x_min = 0.0 -- minimaler Eingangswert
|
||||
x_max = 0.76793104410172 -- maximaler Eingangswert
|
||||
x = 0.57506740093231 -- aktueller Eingangswert
|
||||
|
||||
d_y = 0.89 -- Delta Ausga
|
||||
d_x = 0.76793104410172 -- Delta Eingangswerte (x_max
|
||||
m = 1.158958225267568124678891052043 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 0.0000000000000000000000000000002387929418604 (2.387929418604e-32) -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.66648 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
if gVD_20_PRESS_Backseat ~= lVD_20_PRESS_Backseat then
|
||||
gVD_20_PRESS_Backseat = lVD_20_PRESS_Backseat
|
||||
lVD_20_PRESS_Backseat = 1.158958225267568124678891052043 * lVD_20_PRESS_Backseat + 0.0000000000000000000000000000002387929418604
|
||||
--ExportScript.Tools.WriteToLog('Pressure2: '..ExportScript.Tools.dump(lVD_20_PRESS_Backseat))
|
||||
ExportScript.Tools.SendData(393, string.format("%.4f", lVD_20_PRESS_Backseat))
|
||||
end
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- R_832M Channel
|
||||
local R_832M = {[0.0]="0",[0.05]="1",[0.1]="2",[0.15]="3",[0.2]="4",[0.25]="5",[0.3]="6",[0.35]="7",[0.4]="8",[0.45]="9",[0.5]="10",[0.55]="11",[0.6]="12",[0.65]="13",[0.7]="14",[0.75]="15",[0.8]="16",[0.85]="17",[0.9]="18",[0.95]="19"}
|
||||
ExportScript.Tools.SendData(2000, R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
--ExportScript.Tools.WriteToLog('R_832M Channel: '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(284))..', '..R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
|
||||
-- R_832M Frequency
|
||||
local lR_832M_F = GetDevice(19)
|
||||
if lR_832M_F:is_on() then
|
||||
--ExportScript.Tools.SendData(2001, string.format("%7.3f", lR_832M_F:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2001, ExportScript.Tools.RoundFreqeuncy(lR_832M_F:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('R_832M Frequency: '..ExportScript.Tools.dump(string.format("%7.3f", lR_832M_F:get_frequency()/1000000)))
|
||||
else
|
||||
ExportScript.Tools.SendData(2001, " ")
|
||||
end
|
||||
|
||||
-- Cockpit Light
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {222, 225, 226, 497})
|
||||
-- CB Nav. Lights, CB Red Lights, CB White Lights, Backseat - Instrument Lighting Switch
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF RADIO:get frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- R_832M Channel
|
||||
local R_832M = {[0.0]="0",[0.05]="1",[0.1]="2",[0.15]="3",[0.2]="4",[0.25]="5",[0.3]="6",[0.35]="7",[0.4]="8",[0.45]="9",[0.5]="10",[0.55]="11",[0.6]="12",[0.65]="13",[0.7]="14",[0.75]="15",[0.8]="16",[0.85]="17",[0.9]="18",[0.95]="19"}
|
||||
ExportScript.Tools.SendDataDAC(2000, R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
--ExportScript.Tools.WriteToLog('R_832M Channel: '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(284))..', '..R_832M[ExportScript.Tools.round(mainPanelDevice:get_argument_value(284), 2)])
|
||||
|
||||
|
||||
-- R_832M Frequency
|
||||
local lR_832M_F = GetDevice(19)
|
||||
if lR_832M_F:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC(2001, string.format("%7.3f", lR_832M_F:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC(2001, ExportScript.Tools.RoundFreqeuncy(lR_832M_F:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('R_832M Frequency: '..ExportScript.Tools.dump(string.format("%7.3f", lR_832M_F:get_frequency()/1000000)))
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC(2001, " ")
|
||||
end
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-- global VD-20 Pressure variable
|
||||
gVD_20_PRESS = 0
|
||||
gVD_20_PRESS_Backseat = 0
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,375 @@
|
||||
-- MiG-15Bis
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.MiG15bis = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
[225] = "%.4f", -- Canopy
|
||||
[223] = "%.4f", -- LeftCanopyLever
|
||||
[222] = "%.4f", -- RightCanopyLever
|
||||
[224] = "%.4f", -- AftCanopyLever
|
||||
[14] = "%.4f", -- Variometer {-75.0,-60.0,-45.0,-30.0,-15.0,-10.0,-5.0,0.0,5.0,10.0,15.0,30.0,45.0,60.0,75.0} {0.0,0.075,0.151,0.24,0.352,0.401,0.448,0.5,0.553,0.6,0.649,0.76,0.848,0.925,1.0}
|
||||
[28] = "%.4f", -- Altimeter_km {0.0, 10.0}{0.0, 1.0}
|
||||
[29] = "%.4f", -- Altimeter_m {0.0, 1000.0}{0.0, 1.0}
|
||||
[31] = "%.4f", -- Altimeter_Pressure {670, 790}{0.0, 1.0}
|
||||
[15] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0}
|
||||
[16] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0}
|
||||
[22] = "%.4f", -- CLOCK_flight_time_meter_status {0.0, 0.2}{0.5, 0.0}
|
||||
[18] = "%.4f", -- CLOCK_flight_hours {0.0, 12.0}{0.0, 1.0}
|
||||
[19] = "%.4f", -- CLOCK_flight_minutes {0.0, 60.0}{0.0, 1.0}
|
||||
[20] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0, 60.0}{0.0, 1.0}
|
||||
[17] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0, 60.0}{0.0, 1.0}
|
||||
[4] = "%.4f", -- IAS {100.0, 1100.0}{0.0, 1.0}
|
||||
[5] = "%.4f", -- TAS {100.0, 1100.0}{0.0, 1.0}
|
||||
[27] = "%.4f", -- MACH {0.0,0.3,0.95}{0.12,0.215,1.0}
|
||||
[6] = "%.4f", -- AGK_47B_roll {-1.0, 1.0}
|
||||
[7] = "%.4f", -- AGK_47B_pitch {1.0, -1.0}
|
||||
[11] = "%.4f", -- AGK_47B_failure_flag {0.0, 1.0}
|
||||
--[8] = "%.4f", -- AGK_47B_sideslip {-1.0, 1.0}
|
||||
[9] = "%.4f", -- AGK_47B_turn {-1.0, 1.0}
|
||||
[10] = "%.4f", -- AGK_47B_horizon {-1.0, 1.0}
|
||||
[35] = "%.4f", -- PRV_46_RAlt {-10.0, 0.0, 1200.0}{-1.0, 0.0, 1.0}
|
||||
[32] = "%.4f", -- PDK-45 HeadingScale {1.0, 0.0}
|
||||
[33] = "%.4f", -- PDK-45 Heading {1.0, 0.0}
|
||||
-- Weapon System
|
||||
[95] = "%.4f", -- N37D_Ready_Lamp
|
||||
[93] = "%.4f", -- NR23_TOP_Ready_Lamp
|
||||
[94] = "%.4f", -- NR23_BOTTOM_Ready_Lamp
|
||||
[100] = "%.4f", -- Tactical_Rel_Lamp
|
||||
[98] = "%.4f", -- LEFT_BOMB_Lamp
|
||||
[99] = "%.4f", -- RIGHT_BOMB_Lamp
|
||||
-- electric system
|
||||
[83] = "%.4f", -- VoltAmperMeter {-1.0, 0.0, 3.0}{-1.0, 0.0, 1.0}
|
||||
[244] = "%.4f", -- lamps_lightness
|
||||
-- hydraulic system
|
||||
[168] = "%.4f", -- HydraulicPressureMain {0.0, 250.0}{0.0, 1.0}
|
||||
[139] = "%.4f", -- HydraulicPressureGain {0.0, 150.0}{0.0, 1.0}
|
||||
[169] = "%.4f", -- HydraulicPressureAirFlaps {0.0, 80.0}{0.0, 1.0}
|
||||
[165] = "%.4f", -- HydraulicPressureAirGears {0.0, 80.0}{0.0, 1.0}
|
||||
[172] = "%.4f", -- HydraulicPressureMainAir {0.0, 250.0}{0.0, 1.0}
|
||||
-- gear system
|
||||
[121] = "%.4f", -- LeftBrakePressure {0.0, 12.0}{0.0, 1.0}
|
||||
[122] = "%.4f", -- RightBrakePressure {0.0, 12.0}{0.0, 1.0}
|
||||
-- fuel system
|
||||
[47] = "%.4f", -- FuelQuantity {-100.0,0.0,100.0,200.0,300.0,400.0,500.0,600.0,700.0,800.0,1050.0}{0.0,0.047,0.136,0.22,0.38,0.52,0.631,0.755,0.869,0.921,1.0}
|
||||
-- air system
|
||||
[188] = "%.4f", -- CanopyAirValveIndication
|
||||
[39] = "%.4f", -- CockpitAltitude {0.0,8000.0} {0.008,1.0}
|
||||
[40] = "%.4f", -- PressureDifference {-0.04,0.0,0.6} {0.0,0.243,1.0}
|
||||
-- oxygen system
|
||||
[48] = "%.4f", -- OxygenPressure {0.0,250.0} {0.0,1.0}
|
||||
[60] = "%.4f", -- FlowBlinker
|
||||
[49] = "%.4f", -- FlowPressure {0.0,150.0,170.0} {0.0,0.9,1.0}
|
||||
-- Engine
|
||||
[42] = "%.4f", -- EngineTachometer {0.0,15000.0} {0.0,1.0}
|
||||
[41] = "%.4f", -- EngineTemperature {300.0,900.0} {0.0,1.0}
|
||||
[45] = "%.4f", -- OilTemperature {-50.0,150.0} {0.0,1.0}
|
||||
[44] = "%.4f", -- OilPressure {0.0, 10.0} {0.0,1.0}
|
||||
[43] = "%.4f", -- EngineFuelPressure {0.0,100.0} {0.0,1.0}
|
||||
[46] = "%.4f", -- FuelPressure {0.0,10.0} {0.0,1.0}
|
||||
-- radio compass
|
||||
[238] = "%.4f", -- ARK5_Band {0.0, 2.0} {0.0, 0.4}
|
||||
[176] = "%.4f", -- ARK5_TuningMeter
|
||||
[175] = "%.4f", -- ARK5_Tuning {0.0, 0.2} {0.0, 1.0}
|
||||
[38] = "%.4f", -- ARK5_Bearing
|
||||
[239] = "%.4f", -- ARK5_FreqScale {0.0,0.5,1.0,1.5,2.0,2.5,3.0} {0.0,0.0695,0.14,0.2865,0.43,0.7155,1.0}
|
||||
-- Radio RSI-6K
|
||||
[235] = "%.4f", -- RadioAntennaPower
|
||||
[128] = "%.4f", -- RadioReceiverKnob {0.0, 0.2}{0.0, 1.0}
|
||||
[127] = "%.4f", -- RadioReceiverInd {0.0, 1.0}{0.036, 0.961}
|
||||
[144] = "%.4f", -- RadioReceiverGauge {0.0, 1.0}{0.026, 0.957}
|
||||
[245] = "%.4f", -- ASP_3N_Range
|
||||
-- Lamps
|
||||
-- electric system
|
||||
[57] = "%.f", -- lamp_GeneratorOff {-1.0, 1.0}{-1.0, 1.0}
|
||||
[58] = "%.f", -- lamp_Ignition {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- power plant
|
||||
[119] = "%.f", -- lamp_IsolatingValve {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- gear system
|
||||
[75] = "%.f", -- lamp_LeftGearExt {-1.0, 1.0}{-1.0, 1.0}
|
||||
[74] = "%.f", -- lamp_LeftGearRet {-1.0, 1.0}{-1.0, 1.0}
|
||||
[79] = "%.f", -- lamp_RightGearExt {-1.0, 1.0}{-1.0, 1.0}
|
||||
[78] = "%.f", -- lamp_RightGearRet {-1.0, 1.0}{-1.0, 1.0}
|
||||
[77] = "%.f", -- lamp_NoseGearExt {-1.0, 1.0}{-1.0, 1.0}
|
||||
[76] = "%.f", -- lamp_NoseGearRet {-1.0, 1.0}{-1.0, 1.0}
|
||||
[53] = "%.f", -- lamp_ExtendGears {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- fuel system
|
||||
[56] = "%.f", -- lamp_Remain300 {-1.0, 1.0}{-1.0, 1.0}
|
||||
[50] = "%.f", -- lamp_AftEmpty {-1.0, 1.0}{-1.0, 1.0}
|
||||
[52] = "%.f", -- lamp_DropTanks {-1.0, 1.0}{-1.0, 1.0}
|
||||
[51] = "%.f", -- lamp_BoostPressure {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- control system
|
||||
[113] = "%.f", -- lamp_TrimmerNeutral {-1.0, 1.0}{-1.0, 1.0}
|
||||
[59] = "%.f", -- lamp_FlapsExt {-1.0, 1.0}{-1.0, 1.0}
|
||||
[124] = "%.f", -- lamp_AirBrakeExt {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- fire extinguisher system
|
||||
[135] = "%.f", -- lamp_FireDetected {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- ARK-5
|
||||
[183] = "%.f", -- lamp_ARK_5 {-1.0, 1.0}{-1.0, 1.0}
|
||||
[218] = "%.f", -- light_ARK_5_scale {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- MRP-48P
|
||||
[54] = "%.f", -- lamp_Marker {-1.0, 1.0}{-1.0, 1.0}
|
||||
-- Light System
|
||||
[226] = "%.4f", -- light_LeftUV {-1.0, 1.0}{-1.0, 1.0}
|
||||
[215] = "%.4f", -- light_CenterUV {-1.0, 1.0}{-1.0, 1.0}
|
||||
[227] = "%.4f", -- light_RightUV {-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}
|
||||
-- Gun Camera
|
||||
[55] = "%.f" -- lamp_GunCamera {-1.0, 1.0}{-1.0, 1.0}
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
|
||||
-- Cockpit mechanics
|
||||
[221] = "%.4f", -- Emergency Canopy Jettison - Pull to jettison
|
||||
[223] = "%.4f", -- Left Canopy Lever, OPEN/CLOSE
|
||||
[222] = "%.4f", -- Right Canopy Lever, OPEN/CLOSE
|
||||
[224] = "%.4f", -- Aft Canopy Lever, OPEN/CLOSE
|
||||
-- Control system
|
||||
[114] = "%.4f", -- Elevator Trimmer Switch, PULL(CLIMB)/OFF/PUSH(DESCEND)
|
||||
[142] = "%.4f", -- Aileron Trimmer Switch, LEFT/OFF/RIGHT
|
||||
[207] = "%.4f", -- Wing Flaps Handle, RETRACT/NEUTRAL/20 degrees/55 degrees
|
||||
[125] = "%.4f", -- Airbrake Switch, CLOSE/OPEN
|
||||
[203] = "%.4f", -- Hydro Booster Lever, ON/OFF
|
||||
[204] = "%.4f", -- Throttle Friction Lever
|
||||
[198] = "%.4f", -- Airbrake Button, Hold to extend
|
||||
-- Electric system
|
||||
[84] = "%.4f", -- Ampere- & Voltmeter - Push to view Volts
|
||||
[149] = "%.4f", -- Air Start Switch, ON/OFF
|
||||
[81] = "%.4f", -- Pitot and Clock Heater Switch, ON/OFF
|
||||
[200] = "%.4f", -- Engine Start Button - Push to start
|
||||
[214] = "%.4f", -- Engine Start Button Cover
|
||||
-- Circuit Breakers
|
||||
[117] = "%.4f", -- Transfer Pump Switch, ON/OFF
|
||||
[115] = "%.4f", -- Booster Pump Switch, ON/OFF
|
||||
[120] = "%.4f", -- Ignition Switch, ON/OFF
|
||||
[116] = "%.4f", -- Instruments and Lights Switch, ON/OFF
|
||||
-- Right Panel
|
||||
[152] = "%.4f", -- Accumulator Switch, ON/OFF
|
||||
[153] = "%.4f", -- Generator Switch, ON/OFF
|
||||
[151] = "%.4f", -- Nose Light Master Switch, ON/OFF
|
||||
[154] = "%.4f", -- Trim Master Switch, ON/OFF
|
||||
[155] = "%.4f", -- AGK-47B Artificial Horizon + DGMK-3 Switch, ON/OFF
|
||||
[158] = "%.4f", -- Radio Switch, ON/OFF
|
||||
[157] = "%.4f", -- Bombs Switch, ON/OFF
|
||||
[156] = "%.4f", -- Emergency Drop Switch, ON/OFF
|
||||
[159] = "%.4f", -- ARK Switch, ON/OFF
|
||||
[160] = "%.4f", -- RV-2 Radio Altimeter Switch, ON/OFF
|
||||
[161] = "%.4f", -- NR-23 Cannon Switch, ON/OFF
|
||||
[162] = "%.4f", -- N-37D Cannon Switch, ON/OFF
|
||||
[163] = "%.4f", -- ASP-3N Gunsight Switch, ON/OFF
|
||||
[164] = "%.4f", -- S-13 Gun Camera Switch, ON/OFF
|
||||
-- HydroSystem
|
||||
[171] = "%.4f", -- Emergency Flaps Valve
|
||||
[167] = "%.4f", -- Emergency Gears Valve
|
||||
[170] = "%.4f", -- Emergency Flaps Valve Cover
|
||||
[166] = "%.4f", -- Emergency Gears Valve Cover
|
||||
[186] = "%.4f", -- Emergency System Filling Valve
|
||||
[242] = "%.4f", -- Air Net Valve
|
||||
[241] = "%.4f", -- Cockpit Filling Valve
|
||||
-- Gear System
|
||||
[71] = "%.4f", -- Landing Gear Handle, UP/DOWN
|
||||
[72] = "%.4f", -- Gear Lamps Test Button - Push to test
|
||||
[210] = "%.4f", -- Right Emergency Gear Release Handle
|
||||
[209] = "%.4f", -- Left Emergency Gear Release Handle
|
||||
[85] = "%.4f", -- Landing Gear Handle Lock, Lock/Unlock
|
||||
-- Fuel System
|
||||
[82] = "%.4f", -- Drop Tank Signal Switch, ON/OFF
|
||||
[141] = "%.4f", -- Oxygen Supply Valve
|
||||
[143] = "%.4f", -- Air Valve
|
||||
[243] = "%.4f", -- Oxygen Emergency Valve
|
||||
-- Conditioning and Heating System
|
||||
[187] = "%.4f", -- Cockpit Air Valve
|
||||
[86] = "%.4f", -- Ventilation Valve
|
||||
-- Internal Lights System
|
||||
[184] = "%.4f", -- Left UV Light Rheostat
|
||||
[185] = "%.4f", -- Right UV Light Rheostat
|
||||
[220] = "%.4f", -- Panels Light Rheostat
|
||||
-- Nav Lights System
|
||||
[111] = "%.4f", -- External Lights Switch, ON/OFF
|
||||
[80] = "%.4f", -- Nose Light Switch, ON/OFF
|
||||
-- Power Plant
|
||||
[208] = "%.4f", -- Engine Stop, CLOSE/OPEN
|
||||
[118] = "%.4f", -- Isolating Valve Switch, ON/OFF
|
||||
-- Fire Extinguisher System
|
||||
[136] = "%.4f", -- Engine Fire Extinguisher Button Cover
|
||||
[137] = "%.4f", -- Engine Fire Extinguisher Button
|
||||
[138] = "%.4f", -- Engine Fire Warning Light Test Button - Push to test
|
||||
-- Signal Flares
|
||||
[129] = "%.4f", -- Signal Flare Switch, ON/OFF
|
||||
[130] = "%.4f", -- Signal Flare Yellow Button
|
||||
[131] = "%.4f", -- Signal Flare Green Button
|
||||
[132] = "%.4f", -- Signal Flare Red Button
|
||||
[133] = "%.4f", -- Signal Flare White Button
|
||||
----------------------------------------------------
|
||||
-- Devices
|
||||
-- AGK-47B
|
||||
[12] = "%.4f", -- AGK-47B Artificial Horizon Cage - Pull to cage
|
||||
[13] = "%.4f", -- AGK-47B Artificial Horizon Zero Pitch Trim Knob
|
||||
--VD-15
|
||||
[30] = "%.4f", -- Barometric Pressure QFE Knob
|
||||
--PRV-46
|
||||
[36] = "%.4f", -- PRV-46 Radar Altimeter Indicator Range Switch, 120m/1200m AGL
|
||||
[37] = "%.4f", -- PRV-46 Radar Altimeter Indicator Power Switch, ON/OFF
|
||||
--PDK-45
|
||||
[34] = "%.4f", -- Heading Knob
|
||||
[61] = "%.4f", -- Fast Slave Button
|
||||
-- CLOCK
|
||||
[23] = "%.4f", -- AChS-1 Cockpit Chronograph Left Knob (button)
|
||||
[24] = "%.4f", -- AChS-1 Cockpit Chronograph Left Knob (rotary)
|
||||
[25] = "%.4f", -- AChS-1 Cockpit Chronograph Right Knob (button)
|
||||
[26] = "%.4f", -- AChS-1 Cockpit Chronograph Right Knob (rotary)
|
||||
-- Weapon System
|
||||
[92] = "%.4f", -- N-37D Cannon Reload Button
|
||||
[90] = "%.4f", -- NR-23 (Top) Cannon Reload Button
|
||||
[91] = "%.4f", -- NR-23 (Bottom) Cannon Reload Button
|
||||
[96] = "%.4f", -- Tactical Release Switch, ON/OFF
|
||||
[97] = "%.4f", -- Emergency Release Button
|
||||
[104] = "%.4f", -- Emergency Release Button Cover
|
||||
--ASP-3N Gunsight
|
||||
[101] = "%.4f", -- ASP-3N Gunsight Mode, GYRO/FIXED
|
||||
[106] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever
|
||||
[103] = "%.4f", -- ASP-3N Gunsight Fixed Reticle Mask Lever (rotary)
|
||||
[102] = "%.4f", -- ASP-3N Gunsight Brightness Knob (rotary)
|
||||
[201] = "%.4f", -- ASP-3N Gunsight Target Distance (rotary)
|
||||
[105] = "%.4f", -- ASP-3N Gunsight Color Filter, ON/OFF
|
||||
-- ARK-5 radio compass
|
||||
[180] = "%.4f", -- ARK-5 Audio Volume Control (rotary)
|
||||
[177] = "%.4f", -- ARK-5 Frequency Band Switch
|
||||
[174] = "%.4f", -- ARK-5 Function Selector Switch, OFF/COMP/ANT./LOOP
|
||||
[178] = "%.4f", -- ARK-5 LOOP L-R Switch
|
||||
--[] = "%.4f", -- ARK-5 Tuning Crank (rotary)
|
||||
[181] = "%.4f", -- ARK-5 Scale Light Control (rotary)
|
||||
[173] = "%.4f", -- ARK-5 TLG-TLF Switch
|
||||
[182] = "%.4f", -- ARK-5 Take Control Button
|
||||
[123] = "%.4f", -- ARK-5 Near/Far NDB Switch
|
||||
[146] = "%.4f", -- ARK-5 NDB 1 Switch
|
||||
[147] = "%.4f", -- ARK-5 NDB 2 Switch
|
||||
[148] = "%.4f", -- ARK-5 NDB 3 Switch
|
||||
-- RSI-6K radio
|
||||
[126] = "%.4f", -- RSI-6K Audio Volume Control (rotary)
|
||||
[232] = "%.4f", -- RSI-6K Wave Control (rotary)
|
||||
[230] = "%.4f", -- RSI-6K Antenna Control (rotary)
|
||||
[231] = "%.4f", -- RSI-6K Wave Lock
|
||||
[233] = "%.4f", -- RSI-6K Antenna Lock
|
||||
[128] = "%.4f", -- RSI-6K Receiver Tuning (rotary)
|
||||
[140] = "%.4f", -- RSI-6K Receive/ARK
|
||||
[240] = "%.4f", -- RSI-6K Forced Mode, ON/OFF
|
||||
[202] = "%.4f", -- Microphone Button
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
-- AGK_47B_sideslip negate
|
||||
--[8] = "%.4f", -- AGK_47B_sideslip {-1.0, 1.0}
|
||||
ExportScript.Tools.SendData(8, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(8)))) -- negate
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- Cockpit Light
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, 220)
|
||||
-- Panels Light Rheostat
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
+730
-831
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,294 @@
|
||||
-- MiG-29A Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.MiG29A = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / MiG-29A --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-TAS Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1000hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer
|
||||
ExportScript.AF.FC_Russian_AOA_MiG29()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1000m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_30000()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
|
||||
-- Machmeter
|
||||
ExportScript.AF.FC_Russian_Mach_MiG29()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
-- Weapon Panel
|
||||
--ExportScript.AF.FC_WeaponPanel_MiG29(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.FC_Russian_MDI_MiG29(lFunctionTyp)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FuelQuantityIndicator_MiG29(lFunctionTyp)
|
||||
|
||||
-- Airintake
|
||||
ExportScript.AF.FC_Russian_AirIntake() -- Bug: Airintake.value always 1
|
||||
|
||||
-- Hydraulic Pressure Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
-- Engine Lamps, Start and Afterburner
|
||||
ExportScript.AF.FC_EngineLamps_MiG29(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
end
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_MDI_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_FlareChaff_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_EngineLamps_MiG29(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem_MiG29()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lAccelerationUnits: '..ExportScript.Tools.dump(lAccelerationUnits))
|
||||
ExportScript.Tools.SendDataDAC("732", (lAccelerationUnits.y > 8.0 and 1 or 0) ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,294 @@
|
||||
-- MiG-29G Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.MiG29G = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / MiG-29G --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-TAS Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1000hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer
|
||||
ExportScript.AF.FC_Russian_AOA_MiG29()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1000m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_30000()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
|
||||
-- Machmeter
|
||||
ExportScript.AF.FC_Russian_Mach_MiG29()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
-- Weapon Panel
|
||||
--ExportScript.AF.FC_WeaponPanel_MiG29(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.FC_Russian_MDI_MiG29(lFunctionTyp)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FuelQuantityIndicator_MiG29(lFunctionTyp)
|
||||
|
||||
-- Airintake
|
||||
ExportScript.AF.FC_Russian_AirIntake() -- Bug: Airintake.value always 1
|
||||
|
||||
-- Hydraulic Pressure Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
-- Engine Lamps, Start and Afterburner
|
||||
ExportScript.AF.FC_EngineLamps_MiG29(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
end
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_MDI_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_FlareChaff_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_EngineLamps_MiG29(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem_MiG29()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lAccelerationUnits: '..ExportScript.Tools.dump(lAccelerationUnits))
|
||||
ExportScript.Tools.SendDataDAC("732", (lAccelerationUnits.y > 8.0 and 1 or 0) ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,294 @@
|
||||
-- MiG-29S Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.MiG29S = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / MiG-29S --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-TAS Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1000hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer
|
||||
ExportScript.AF.FC_Russian_AOA_MiG29()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1000m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_30000()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
|
||||
-- Machmeter
|
||||
ExportScript.AF.FC_Russian_Mach_MiG29()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
-- Weapon Panel
|
||||
--ExportScript.AF.FC_WeaponPanel_MiG29(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.FC_Russian_MDI_MiG29(lFunctionTyp)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FuelQuantityIndicator_MiG29(lFunctionTyp)
|
||||
|
||||
-- Airintake
|
||||
ExportScript.AF.FC_Russian_AirIntake() -- Bug: Airintake.value always 1
|
||||
|
||||
-- Hydraulic Pressure Indicator
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
-- Engine Lamps, Start and Afterburner
|
||||
ExportScript.AF.FC_EngineLamps_MiG29(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
end
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_MDI_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_FlareChaff_MiG29(lFunctionTyp)
|
||||
ExportScript.AF.FC_EngineLamps_MiG29(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem_MiG29()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lAccelerationUnits: '..ExportScript.Tools.dump(lAccelerationUnits))
|
||||
ExportScript.Tools.SendDataDAC("732", (lAccelerationUnits.y > 8.0 and 1 or 0) ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,331 @@
|
||||
-- P-51D-30-NA Export
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.P51D30NA = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- 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] = "%.4f", -- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,331 @@
|
||||
-- P-51D-25-NA Export
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.P51D25NA = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- 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] = "%.4f", -- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,709 @@
|
||||
-- SA342L
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.SA342L = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Gyro Panel
|
||||
[200] = "%.4f", -- Gyro_Needle_State {-1,1} Gyro Panel SYNC
|
||||
[201] = "%.f", -- Gyro_voyant_test Lamp {0,1}
|
||||
[202] = "%.f", -- Gyro_voyant_trim Lamp {0,1}
|
||||
[203] = "%.f", -- Gyro_voyant_bpp Lamp {0,1}
|
||||
-- Autopilot Panel
|
||||
[37] = "%.4f", -- T_Needle_State {-1,1} Pitch correction Indicator
|
||||
[38] = "%.4f", -- R_Needle_State {-1,1} Roll correction Indicator
|
||||
[39] = "%.4f", -- L_Needle_State {-1,1} Yaw correction Indicator
|
||||
--[196] = "%.4f", -- RWR_light {0,1} -- RWR background light
|
||||
--[] = "%.4f", -- PE_fondbright {0,1} ???
|
||||
--[353] = "%.4f", -- NADIR_fondbright {0,1} ???
|
||||
-- Flare Dispenser Lamps
|
||||
[233] = "%.f", -- Voyant_FD_On {0,1} Power On
|
||||
[231] = "%.f", -- Voyant_FD_G {0,1} select Left
|
||||
[232] = "%.f", -- Voyant_FD_D {0,1} select Right
|
||||
[227] = "%.f", -- Voyant_FD_LEU {0,1} Status LEU
|
||||
[223] = "%.f", -- Voyant_FD_G_vide1 {0,1} Status Left G
|
||||
[224] = "%.f", -- Voyant_FD_G_vide2 {0,1} Status Left VIDE
|
||||
[225] = "%.f", -- Voyant_FD_D_vide1 {0,1} Status Right G
|
||||
[226] = "%.f", -- Voyant_FD_D_vide2 {0,1} Status Right VIDE
|
||||
-- ADF Radio
|
||||
[158] = "%0.1f", -- ADF_nav1_centaine {0,1} X00.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[159] = "%0.1f", -- ADF_nav1_dizaine {0,1} 0X0.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[160] = "%0.1f", -- ADF_nav1_unite {0,1} 00X.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[161] = "%0.1f", -- ADF_nav1_dec {0,1} 000.X khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[162] = "%0.1f", -- ADF_nav2_centaine {0,1} X00.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[163] = "%0.1f", -- ADF_nav2_dizaine {0,1} 0X0.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[164] = "%0.1f", -- ADF_nav2_unite {0,1} 00X.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[165] = "%0.1f", -- ADF_nav2_dec {0,1} 000.X khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- ADF Gauge
|
||||
[113] = "%.4f", -- ADF_Fond Compass rose {0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360}{0.0,0.028,0.055,0.084,0.111,0.138,0.166,0.194,0.222,0.249,0.2775,0.305,0.332,0.36,0.388,0.415,0.4434,0.47,0.498,0.526,0.555,0.583,0.611,0.638,0.6665,0.694,0.722,0.75,0.776,0.805,0.833,0.861,0.8885,0.917,0.944,0.972,1.0}
|
||||
[102] = "%.4f", -- ADF_Aiguille_large Heading Needle large {-360.0,0.0,360.0}{-1.0,0.0,1.0}
|
||||
[103] = "%.4f", -- ADF_Aiguille_fine Heading Needle fine {-360.0,0.0,360.0}{-1.0,0.0,1.0}
|
||||
[107] = "%.1f", -- ADF_FlagCAP {0,1}
|
||||
[109] = "%.1f", -- ADF_FlagBut {0,1}
|
||||
[108] = "%.1f", -- ADF_FlagCompteur PX Flag {0,1}
|
||||
[110] = "%0.1f", -- ADF_compteur_Cent {0,1} X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[111] = "%0.1f", -- ADF_compteur_Dix {0,1} 0X0 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[112] = "%0.1f", -- ADF_compteur_Unit {0,1} 00X {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- CLOCK
|
||||
[41] = "%.3f", -- CLOCK_HOUR {0,1,2,3,4,5,6,7,8,9,10,11,12}{0,0.081,0.162,0.245,0.33,0.415,0.501,0.587,0.672,0.756,0.838,0.919,1}
|
||||
[42] = "%.3f", -- CLOCK_MINUTE {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60}{0,0.017,0.033,0.049,0.065,0.08,0.098,0.115,0.131,0.147,0.163,0.18,0.195,0.213,0.23,0.246,0.262,0.279,0.296,0.313,0.33,0.346,0.363,0.38,0.397,0.415,0.431,0.449,0.466,0.483,0.501,0.518,0.535,0.552,0.569,0.586,0.604,0.621,0.638,0.655,0.672,0.688,0.705,0.722,0.739,0.755,0.771,0.788,0.804,0.821,0.838,0.853,0.87,0.885,0.902,0.919,0.934,0.95,0.967,0.984,1}
|
||||
[43] = "%.3f", -- CLOCK_SECOND {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60}{0,0.017,0.033,0.049,0.065,0.08,0.098,0.115,0.131,0.147,0.163,0.18,0.195,0.213,0.23,0.246,0.262,0.279,0.296,0.313,0.33,0.346,0.363,0.38,0.397,0.415,0.431,0.449,0.466,0.483,0.501,0.518,0.535,0.552,0.569,0.586,0.604,0.621,0.638,0.655,0.672,0.688,0.705,0.722,0.739,0.755,0.771,0.788,0.804,0.821,0.838,0.853,0.87,0.885,0.902,0.919,0.934,0.95,0.967,0.984,1}
|
||||
[44] = "%.3f", -- CLOCK_MINI {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}{0,0.032,0.065,0.098,0.131,0.164,0.198,0.231,0.264,0.297,0.331,0.364,0.397,0.43,0.464,0.497,0.523,0.551,0.576,0.605,0.63,0.659,0.684,0.714,0.758,0.796,0.838,0.879,0.92,0.958,1}
|
||||
-- Wipers
|
||||
--[547] = "%.4f", -- EGPilote {-1,1}
|
||||
--[546] = "%.4f", -- EGCopilote {-1,1}
|
||||
-- LIGHTS
|
||||
--[40] = "%.4f", -- Lum_Plafond {0,1} Main Panel Lights
|
||||
--[142] = "%.4f", -- PBOIntensity {0,1} Main Panel Background lights
|
||||
--[144] = "%.4f", -- PUPIntensity {0,1} Lower Panel Background lights
|
||||
-- Baro altimetre
|
||||
[87] = "%.4f", -- Baro_Altimeter_thousands Needle {0.0,1.0}
|
||||
[573] = "%.4f", -- Baro_Altimeter_hundred Needle {0.0,1.0}
|
||||
[88] = "%0.1f", -- Baro_Altimeter_press_unite 000X {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[90] = "%0.1f", -- Baro_Altimeter_press_dix 00X0 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[92] = "%0.1f", -- Baro_Altimeter_press_cent 0X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[95] = "%0.1f", -- Baro_Altimeter_press_mille X000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- radar altimetre
|
||||
[94] = "%.4f", -- Radar_Altimeter {0,5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850}{0,0.019,0.035,0.072,0.109,0.147,0.18,0.214,0.247,0.283,0.316,0.345,0.376,0.407,0.438,0.469,0.501,0.564,0.606,0.648,0.676,0.706,0.732,0.756,0.775,0.794,0.811,0.829,0.843,0.858,0.87}
|
||||
[93] = "%.4f", -- DangerRALT_index {0,5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850}{0.0,0.0175,0.0338,0.0715,0.109,0.147,0.182,0.215,0.247,0.282,0.315,0.3445,0.377,0.407,0.439,0.47,0.5005,0.5628,0.6052,0.646,0.675,0.7058,0.7315,0.755,0.7747,0.793,0.8097,0.8272,0.8425,0.8575,0.8693}
|
||||
[97] = "%.f", -- RAltlamp {0,1}
|
||||
[98] = "%.f", -- RAlt_flag_Panne OFF Flag{0,1}
|
||||
[99] = "%.1f", -- RAlt_flag_MA A (Test) Flag{0,1}
|
||||
[91] = "%.1f", -- RAlt_knob_MA Power/Test Knop{0,1}
|
||||
-- TORQUE
|
||||
[16] = "%.3f", -- Torque {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110}{0.085,0.13,0.172,0.214,0.253,0.289,0.326,0.362,0.395,0.43,0.466,0.501,0.537,0.573,0.607,0.639,0.676,0.71,0.746,0.785,0.826,0.865,0.908}
|
||||
[55] = "%.3f", -- Torque_Bug {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110}{0.084,0.128,0.171,0.2134,0.252,0.2889,0.325,0.361,0.396,0.431,0.467,0.501,0.535,0.571,0.605,0.639,0.674,0.71,0.745,0.785,0.825,0.865,0.91}
|
||||
[17] = "%.f", -- VOYANT_TORQUE Lamp {0,1}
|
||||
-- Gyro_Compas
|
||||
[26] = "%.3f", -- Gyro_Compas {0,30,60,90,120,150,180,210,240,270,300,330,360}{0,0.083,0.167,0.251,0.334,0.418,0.5,0.583,0.667,0.751,0.832,0.917,1}
|
||||
-- Stby HA ADI
|
||||
[214] = "%.4f", -- StbyHA_Roll {-180,-90,-60,-30,-20,-10,0,10,20,30,60,90,180}{-1,-0.502,-0.335,-0.166,-0.11,-0.052,0,0.055,0.113,0.171,0.334,0.502,1}
|
||||
[213] = "%.4f", -- StbyHA_Pitch {-180,-150,-120,-90,-60,-50,-40,-30,-20,-15,-10,-5,0,5,10,15,20,30,40,50,60,90,120,150,180}{-1,-0.833,-0.667,-0.5,-0.333,-0.278,-0.223,-0.167,-0.111,-0.084,-0.057,-0.003,0,0.028,0.056,0.083,0.111,0.167,0.223,0.278,0.333,0.5,0.667,0.833,1}
|
||||
[211] = "%.1f", -- StdbyHA_Flag Fault Flag {0,1}
|
||||
[212] = "%.4f", -- Stdby_HA_W W Sympol {0,1}
|
||||
[217] = "%.4f", -- Stdby_HA_Curseur Knob Needle {0,1}
|
||||
-- QComb Fuel Indicator
|
||||
[137] = "%.3f", -- QComb {0,50,100,150,200,250,300,350,400,500}{0.093,0.243,0.354,0.428,0.521,0.621,0.692,0.771,0.834,0.932}
|
||||
-- Horizon Artificiel Principal
|
||||
[27] = "%.4f", -- Pitch_HA {-180,-170,-160,-150,-140,-130,-120,-110,-100,-90,-80,-70,-60,-50,-40,-30,-20,-10,0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180}{-1,-0.946,-0.898,-0.838,-0.78,-0.723,-0.667,-0.61,-0.556,-0.501,-0.446,-0.393,-0.334,-0.277,-0.223,-0.166,-0.104,-0.054,0,0.054,0.102,0.161,0.22,0.277,0.333,0.389,0.443,0.498,0.553,0.607,0.666,0.722,0.776,0.834,0.896,0.946,1}
|
||||
[28] = "%.4f", -- Roll_HA {-180,-90,-60,-30,-20,-10,0,10,20,30,60,90,180}{-1,-0.498,-0.331,-0.162,-0.111,-0.053,0,0.058,0.112,0.168,0.331,0.498,1}
|
||||
[20] = "%.4f", -- Bille_HA Slip Ball {-1,1}
|
||||
[18] = "%.1f", -- flag_GS_HA GS Flag {0,1}
|
||||
[19] = "%.1f", -- flag_HS_HA Fault Flag {0,1}
|
||||
[29] = "%.1f", -- flag_Lock_HA Lock Flag {0,1}
|
||||
[117] = "%.4f", -- Curseur_HA Knob Needle {0,1}
|
||||
[120] = "%.4f", -- W_HA W Sympol {-1,1}
|
||||
[118] = "%.4f", -- VerBar_HA Vertical Bar {-1,1}
|
||||
[119] = "%.4f", -- HorBar_HA Horizon Bar {-1,1}
|
||||
-- variometre
|
||||
[24] = "%.4f", -- Variometre {-800,-700,-600,-500,-400,-300,-200,-100,-50,0,50,100,200,300,400,500,600,700,800}{-0.481,-0.436,-0.391,-0.338,-0.28,-0.218,-0.153,-0.075,-0.035,0.0,0.035,0.071,0.139,0.202,0.264,0.32,0.372,0.418,0.463}
|
||||
-- IAS
|
||||
[51] = "%.4f", -- IAS {0,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370}{0,0.1,0.133,0.172,0.207,0.243,0.277,0.316,0.35,0.38,0.41,0.439,0.465,0.491,0.517,0.541,0.565,0.587,0.611,0.63,0.651,0.671,0.692,0.712,0.731,0.75,0.77,0.791,0.809,0.829,0.849,0.867,0.886}
|
||||
-- RPM
|
||||
[135] = "%.4f", -- Turbine_RPM large Needle {0,5000,10000,15000,20000,25000,29000,35000,40000,43500,45000,50000}{0.095,0.181,0.263,0.346,0.424,0.505,0.572,0.665,0.748,0.802,0.828,0.909}
|
||||
[52] = "%.4f", -- Rotor_RPM small Needle {0,50,100,150,200,250,262,316.29,361.05,387,400,450}{0.096,0.191,0.283,0.374,0.461,0.549,0.57,0.665,0.748,0.802,0.811,0.904}
|
||||
-- Voltmetre
|
||||
[14] = "%.3f", -- Voltmetre {0,5,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}{0.045,0.074,0.103,0.133,0.163,0.192,0.221,0.25,0.281,0.31,0.339,0.368,0.399,0.429,0.458,0.488,0.518,0.547,0.576,0.605,0.635,0.664,0.695,0.724}
|
||||
-- TQuatre Engine temperature Indicator
|
||||
[15] = "%.3f", -- TQuatre Engine Temp {0,100,200,300,400,500,600,700,800}{0.1575,0.228,0.3,0.3845,0.473,0.577,0.676,0.772,0.8625}
|
||||
-- TempExt outside temperature
|
||||
[25] = "%.3f", -- TempExt {-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70}{-0.758,-0.691,-0.625,-0.558,-0.492,-0.425,-0.359,-0.292,-0.224,-0.158,-0.09,-0.024,0.043,0.11,0.177,0.244,0.31,0.379,0.445,0.512,0.579,0.644,0.712}
|
||||
-- TempThm Oil Temperature Indicator
|
||||
[151] = "%.3f", -- TempThm Oil Temp {-20,-10,0,10,20,30,40,50,60,70,80,85,90,100}{0.046,0.102,0.157,0.213,0.268,0.323,0.38,0.435,0.492,0.547,0.603,0.63,0.659,0.715}
|
||||
-- Fuel Tank Indicator
|
||||
[152] = "%.3f", -- Gauge_RSupp {-1,0,0.25,0.5,0.75,1}{0,0.202,0.426,0.63,0.801,1}
|
||||
-- VHF AM Radio
|
||||
[133] = "%.1f", -- AM_Radio_freq_cent {0,1} X00.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[134] = "%.1f", -- AM_Radio_freq_dix {0,1} 0X0.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[136] = "%.1f", -- AM_Radio_freq_unite {0,1} 00X.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[138] = "%.1f", -- AM_Radio_freq_dixieme {0,1} 000.X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[139] = "%.2f", -- AM_Radio_freq_centieme {0,1} 000.0XX {00,25,50,75,00}{0.0,0.25,0.50,0.75,1.0}
|
||||
-- Lamps
|
||||
-- Voyant_DEM
|
||||
[300] = "%.f", -- Voyant_DEM Start lamp{0,1}
|
||||
-- Voyant_RLT
|
||||
[301] = "%.f", -- Voyant_RLT Idle lamp {0,1}
|
||||
-- Voyant_BLOC
|
||||
[302] = "%.f", -- Voyant_BLOC Blocked Engine lamp {0,1}
|
||||
-- RSUPP Fueltank
|
||||
[320] = "%.f", -- Voyant_RSupp Fueltank lamp {0,1}
|
||||
-- RCONV Convoy Fueltank
|
||||
[321] = "%.f", -- Voyant_RConv Convoy Fueltank lamüp {0,1}
|
||||
-- Voyant_FILTAS Sandfilter lamp
|
||||
[322] = "%.f", -- Voyant_FILTAS sandfilter lamp {0,1}
|
||||
-- Voyant_Alarme Master Alarme lamp
|
||||
[303] = "%.f", -- Voyant_Alarme Master Alarme lamp {0,1}
|
||||
-- AM_RADIO
|
||||
[141] = "%.f", -- AM_Radio_lamp {0,1}
|
||||
-- Tableau Alarme Lamps
|
||||
[1] = "%.f", -- TA_Pitot {0,1}
|
||||
[2] = "%.f", -- TA_Hmot {0,1}
|
||||
[3] = "%.f", -- TA_Hbtp {0,1}
|
||||
[4] = "%.f", -- TA_Hral {0,1}
|
||||
[5] = "%.f", -- TA_Gene {0,1}
|
||||
[6] = "%.f", -- TA_Alter {0,1}
|
||||
[7] = "%.f", -- TA_Bat {0,1}
|
||||
[8] = "%.f", -- TA_PA {0,1}
|
||||
[9] = "%.f", -- TA_Nav {0,1}
|
||||
[10] = "%.f", -- TA_Comb {0,1}
|
||||
[11] = "%.f", -- TA_Bphy {0,1}
|
||||
[12] = "%.f", -- TA_Lim {0,1}
|
||||
[13] = "%.f", -- TA_Filt {0,1}
|
||||
-- Intercomp Lamps
|
||||
[455] = "%.f", -- Intercomp VHF Light
|
||||
[456] = "%.f", -- Intercomp FM1 Light
|
||||
[457] = "%.f", -- Intercomp UHF Light
|
||||
}
|
||||
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- WEAPONS PANEL 1
|
||||
[354] = "%1d", -- WP1 - Off/On/Stsnfby {-1.0,0.0,1.0}
|
||||
[357] = "%.4f", -- WP1 - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- WEAPONS PANEL 2
|
||||
[372] = "%1d", -- WP2 - Ma Left
|
||||
[373] = "%1d", -- WP2 - Ma Left Cover
|
||||
[374] = "%1d", -- WP2 - Ma Right
|
||||
[375] = "%1d", -- WP2 - Ma Right Cover
|
||||
[376] = "%1d", -- WP2 - Seq Ripple selection
|
||||
-- PILOTSIGHT
|
||||
[171] = "%1d", -- PILOTSIGHT - Pilot Sight
|
||||
-- PILOT STICK
|
||||
--[50] = "%1d", -- PILOT STICK - Magnetic Brake
|
||||
--[53] = "%1d", -- PILOT STICK - Wiper once
|
||||
--[209] = "%1d", -- PILOT STICK - Autopilot Button
|
||||
--[293] = "%1d", -- PILOT STICK - Slave
|
||||
--[294] = "%1d", -- PILOT STICK - Auto-Hover
|
||||
-- WSO LEFT SIDE STICK
|
||||
[255] = "%1d", -- PE WSO STICK - Lasing Button Cover
|
||||
[256] = "%1d", -- PE WSO STICK - Lasing Button
|
||||
[257] = "%1d", -- PE WSO STICK - Missile Launch Cover
|
||||
[258] = "%1d", -- PE WSO STICK - Missile Launch Button
|
||||
[259] = "%1d", -- PE WSO STICK - Inversed Symbology Toggle
|
||||
[260] = "%1d", -- PE WSO STICK - Inversed Image Toggle
|
||||
[264] = "%.1f", -- PE WSO STICK - Image Focus {-1.0,1.0}
|
||||
[262] = "%.1f", -- PE WSO STICK - Gain {-1.0,1.0}
|
||||
[263] = "%.1f", -- PE WSO STICK - Image Brightness {-1.0,1.0}
|
||||
[219] = "%.1f", -- PE WSO STICK - Symbology Brightness {-1.0,1.0}
|
||||
-- GYRO
|
||||
[197] = "%1d", -- GYRO - Test Cover
|
||||
[198] = "%1d", -- GYRO - Test Switch On/Off
|
||||
[199] = "%1d", -- GYRO - Left/Center/Right
|
||||
[153] = "%.2f", -- GYRO - CM/A/GM/D/GD {0.0,0.25,0.50,0.75,1.0}
|
||||
-- CLOCK
|
||||
[45] = "%.4f", -- CLOCK - Winder (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[46] = "%1d", -- CLOCK - Start/Stop
|
||||
[47] = "%1d", -- CLOCK - Reset
|
||||
-- PE SA342L/M/Mistral BCV (BOITIER DE COMMANDE VIDEO – video command box)
|
||||
[362] = "%1d", -- PE BCV - Centering
|
||||
[364] = "%1d", -- PE BCV - VDO/VTH
|
||||
[365] = "%.1f", -- PE BCV - Zoom {-1.0,1.0}
|
||||
[366] = "%.1f", -- PE BCV - CTH A/V/M {0.0,0.5,1.0}
|
||||
[367] = "%1d", -- PE BCV - Power
|
||||
[370] = "%.2f", -- PE BCV - Mode A/C/V/PIL/ASS {0.0,0.25,0.50,0.75,1.0}
|
||||
-- NADIR
|
||||
[330] = "%.4f", -- NADIR - Off/Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[331] = "%.2f", -- NADIR - Mode Off/Stby/Ground/Sea/Air Speed Sensor/Ground Test {0.0,0.2,0.4,0.6,0.8,1.0}
|
||||
[332] = "%.2f", -- NADIR - Parameter Wind/Magnetic Heading/Ground Speed/Calculated Time/Current Position/Waypoint {0.0,0.2,0.4,0.6,0.8,1.0}
|
||||
[333] = "%1d", -- NADIR - ENT
|
||||
[334] = "%1d", -- NADIR - DES
|
||||
[335] = "%1d", -- NADIR - AUX
|
||||
[336] = "%1d", -- NADIR - IC
|
||||
[337] = "%1d", -- NADIR - DOWN
|
||||
[351] = "%1d", -- NADIR - 0
|
||||
[338] = "%1d", -- NADIR - 1
|
||||
[339] = "%1d", -- NADIR - 2
|
||||
[340] = "%1d", -- NADIR - 3
|
||||
[342] = "%1d", -- NADIR - 4
|
||||
[343] = "%1d", -- NADIR - 5
|
||||
[344] = "%1d", -- NADIR - 6
|
||||
[346] = "%1d", -- NADIR - 7
|
||||
[347] = "%1d", -- NADIR - 8
|
||||
[348] = "%1d", -- NADIR - 9
|
||||
[341] = "%1d", -- NADIR - POL
|
||||
[345] = "%1d", -- NADIR - GEO
|
||||
[349] = "%1d", -- NADIR - POS
|
||||
[350] = "%1d", -- NADIR - GEL
|
||||
[352] = "%1d", -- NADIR - EFF
|
||||
-- AM_RADIO
|
||||
[128] = "%.2f", -- AM RADIO - Selector {0.0,0.33,0.66,0.99}
|
||||
[129] = "%.4f", -- AM RADIO - Freq decimals (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[130] = "%1d", -- AM RADIO - 25/50kHz Selector
|
||||
[131] = "%.4f", -- AM RADIO - Freq dial (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FM_RADIO
|
||||
[272] = "%.2f", -- FM RADIO - Main Selector {0.0,0.25,0.50,0.75,1.0}
|
||||
[273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0}
|
||||
[274] = "%1d", -- FM RADIO - 7
|
||||
[275] = "%1d", -- FM RADIO - 8
|
||||
[276] = "%1d", -- FM RADIO - 9
|
||||
[277] = "%1d", -- FM RADIO - 0
|
||||
[278] = "%1d", -- FM RADIO - X
|
||||
[279] = "%1d", -- FM RADIO - 4
|
||||
[280] = "%1d", -- FM RADIO - 5
|
||||
[281] = "%1d", -- FM RADIO - 6
|
||||
[282] = "%1d", -- FM RADIO - RC
|
||||
[283] = "%1d", -- FM RADIO - UP
|
||||
[284] = "%1d", -- FM RADIO - 1
|
||||
[285] = "%1d", -- FM RADIO - 2
|
||||
[286] = "%1d", -- FM RADIO - 3
|
||||
[287] = "%1d", -- FM RADIO - VAL
|
||||
[288] = "%1d", -- FM RADIO - DOWN
|
||||
-- TV
|
||||
[124] = "%1d", -- TV - On/Off
|
||||
[125] = "%.4f", -- TV - Contrast (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[123] = "%.4f", -- TV - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
--[126] = "%.4f", -- TV - Cover (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RWR
|
||||
[148] = "%1d", -- RWR - Off/On/Croc {-1.0,0.0,1.0}
|
||||
[149] = "%1d", -- RWR - Marker
|
||||
[150] = "%1d", -- RWR - Page
|
||||
[121] = "%.4f", -- RWR - Audio (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[122] = "%.4f", -- RWR - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- ADI
|
||||
[115] = "%.4f", -- ADI - Unlock (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[116] = "%1d", -- ADI - Unlock
|
||||
-- Stby ADI
|
||||
[215] = "%.4f", -- STDBY ADI - Unlock (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[216] = "%1d", -- STDBY ADI - Unlock
|
||||
-- ArtVisVhfDop (Source selector for main artificial horizon vertical bar)
|
||||
[218] = "%.2f", -- ADI - Source Off/Camera target point/ADF ermitter/NADIR Waypoint {0.0,0.33,0.66,0.99}
|
||||
-- INTERCOM
|
||||
[452] = "%1d", -- INTERCOM - VHF AM Radio
|
||||
[68] = "%.4f", -- INTERCOM - VHF AM Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[453] = "%1d", -- INTERCOM - FM Radio
|
||||
[69] = "%.4f", -- INTERCOM - FM Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[454] = "%1d", -- INTERCOM - UHF Radio
|
||||
[70] = "%.4f", -- INTERCOM - UHF Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- TORQUE
|
||||
[58] = "%1d", -- TORQUE Bug/Test
|
||||
[54] = "%.4f", -- TORQUE Bug/Test (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- LIGHTS
|
||||
[22] = "%.4f", -- LIGHTS - Main Dashboard Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[21] = "%.4f", -- LIGHTS - Console Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[145] = "%.4f", -- LIGHTS - UV Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[23] = "%1d", -- LIGHTS - NORM/BNL
|
||||
[147] = "%.4f", -- LIGHTS - Roof Lamp Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[154] = "%1d", -- LIGHTS - Red Lens On/Off
|
||||
-- ELECTRIC
|
||||
[264] = "%1d", -- ELECTRIC - Battery
|
||||
[265] = "%1d", -- ELECTRIC - Alternator
|
||||
[268] = "%1d", -- ELECTRIC - Generator
|
||||
[62] = "%1d", -- ELECTRIC - Voltmeter Test
|
||||
[170] = "%1d", -- ELECTRIC - Pitot
|
||||
[271] = "%1d", -- ELECTRIC - Fuel Pump
|
||||
[267] = "%1d", -- ELECTRIC - Additionnal Fuel Tank
|
||||
[56] = "%1d", -- ELECTRIC - Starter Start/Stop/Air {-1.0,0.0,1.0}
|
||||
[57] = "%1d", -- ELECTRIC - Test
|
||||
[48] = "%1d", -- ELECTRIC - Copilot Wiper {-1.0,0.0,1.0}
|
||||
[49] = "%1d", -- ELECTRIC - Pilot Wiper {-1.0,0.0,1.0}
|
||||
[61] = "%1d", -- ELECTRIC - Left from Pitot
|
||||
[59] = "%1d", -- ELECTRIC - HYD Test
|
||||
[66] = "%1d", -- ELECTRIC - Alter Rearm
|
||||
[67] = "%1d", -- ELECTRIC - Gene Rearm
|
||||
[63] = "%1d", -- ELECTRIC - Convoy Tank On/Off
|
||||
[64] = "%1d", -- ELECTRIC - Sand Filter On/Off
|
||||
-- NAVLIGHTS
|
||||
[146] = "%1d", -- NAVLIGHTS - Navigation Lights CLI/OFF/FIX {-1.0,0.0,1.0}
|
||||
[228] = "%1d", -- NAVLIGHTS - Anticollision Light NOR/OFF/ATT {-1.0,0.0,1.0}
|
||||
[105] = "%1d", -- NAVLIGHTS - Landing Light Off/Vario/On {-1.0,0.0,1.0}
|
||||
[106] = "%1d", -- NAVLIGHTS - Landing Light Extend/Retract
|
||||
[382] = "%1d", -- NAVLIGHTS - Panels Lighting On/Off
|
||||
[30] = "%.4f", -- NAVLIGHTS - AntiCollision Light Intensity (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[229] = "%1d", -- NAVLIGHTS - Formation Lights On/Off
|
||||
[230] = "%.4f", -- NAVLIGHTS - Formation Lights Intensity (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FLARE DISPENSER
|
||||
[220] = "%1d", -- FLARE DISPENSER - G/G+D/D {-1.0,0.0,1.0}
|
||||
[221] = "%1d", -- FLARE DISPENSER - Mode
|
||||
[222] = "%1d", -- FLARE DISPENSER - Off/Speed {-1.0,0.0,1.0}
|
||||
[194] = "%1d", -- FLARE DISPENSER - Fire Button Cover
|
||||
[195] = "%1d", -- FLARE DISPENSER - Fire Button
|
||||
-- AUTOPILOT
|
||||
[31] = "%1d", -- AUTOPILOT - Autopilot On/Off
|
||||
[32] = "%1d", -- AUTOPILOT - Pitch On/Off
|
||||
[33] = "%1d", -- AUTOPILOT - Roll On/Off
|
||||
[34] = "%1d", -- AUTOPILOT - Yaw On/Off
|
||||
[35] = "%1d", -- AUTOPILOT - Mode Speed/OFF/Altitude {-1.0,0.0,1.0}
|
||||
[60] = "%1d", -- AUTOPILOT - Trim On/Off
|
||||
[65] = "%1d", -- AUTOPILOT - Magnetic Brake On/Off
|
||||
-- WEAPONS
|
||||
[269] = "%1d", -- WEAPONS - Master arm On/Off
|
||||
-- ROTORS
|
||||
[556] = "%.4f", -- ROTORS - Rotor Brake (Axis) {0.0, 1.0} in 0.055 Steps
|
||||
-- RADIOALTIMETER
|
||||
[96] = "%.4f", -- RADIOALTIMETER - Radar Alt Bug (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[100] = "%1d", -- RADIOALTIMETER - Radar Alt On/Off - Test
|
||||
[91] = "%.4f", -- RADIOALTIMETER - Radar Alt On/Off - Test (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- BAROALTIMETER
|
||||
[89] = "%.4f", -- BAROALTIMETER - Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FUEL SYSTEM
|
||||
[557] = "%.4f", -- FUEL SYSTEM - Fuel Flow Lever (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- ADF RADIO
|
||||
[166] = "%1d", -- ADF RADIO - Select
|
||||
[167] = "%1d", -- ADF RADIO - Tone
|
||||
[178] = "%.2f", -- ADF RADIO - Mode {0.0,0.33,0.66,0.99}
|
||||
[179] = "%.4f", -- ADF RADIO - Gain (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[168] = "%.4f", -- ADF RADIO - Nav1 Hundred (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[169] = "%.4f", -- ADF RADIO - Nav1 Ten (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[173] = "%.4f", -- ADF RADIO - Nav1 Unit (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[174] = "%.4f", -- ADF RADIO - Nav2 Hundred (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[175] = "%.4f", -- ADF RADIO - Nav2 Ten (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[176] = "%.4f", -- ADF RADIO - Nav2 Unit (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- UHF RADIO
|
||||
[383] = "%.3f", -- UHF RADIO - MODE 0/FF/NA/SV/DL/G/EN {0.0,0.167,0.334,0.501,0.668,0.835,1.0}
|
||||
[384] = "%1d", -- UHF RADIO - DRW
|
||||
[385] = "%1d", -- UHF RADIO - VLD
|
||||
[386] = "%.4f", -- UHF RADIO - PAGE (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[387] = "%1d", -- UHF RADIO - CONF
|
||||
[388] = "%1d", -- UHF RADIO - 1
|
||||
[389] = "%1d", -- UHF RADIO - 2
|
||||
[390] = "%1d", -- UHF RADIO - 3
|
||||
[391] = "%1d", -- UHF RADIO - 4
|
||||
[392] = "%1d", -- UHF RADIO - 5
|
||||
[393] = "%1d", -- UHF RADIO - 6
|
||||
[394] = "%1d", -- UHF RADIO - 7
|
||||
[395] = "%1d", -- UHF RADIO - 8
|
||||
[396] = "%1d", -- UHF RADIO - 9
|
||||
[397] = "%1d" -- UHF RADIO - 0
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- UHF Radio
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(31)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2000, string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('UHF_Freq: '..ExportScript.Tools.dump(list_indication(5)))
|
||||
|
||||
local lUHFRadioFreq = ExportScript.Tools.getListIndicatorValue(5)
|
||||
|
||||
if lUHFRadioFreq ~= nil and lUHFRadioFreq.UHF_Freq ~= nil then
|
||||
ExportScript.Tools.SendData(2000, string.format("%s", lUHFRadioFreq.UHF_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2000, " ")
|
||||
end
|
||||
|
||||
-- AM Radio
|
||||
---------------------------------------------------
|
||||
local lAMRadio = GetDevice(5)
|
||||
--ExportScript.Tools.SendData(2001, string.format("%.3f", lAMRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2001, ExportScript.Tools.RoundFreqeuncy(lAMRadio:get_frequency()/1000000))
|
||||
|
||||
-- FM Radio PR4G
|
||||
---------------------------------------------------
|
||||
local lFMRadio = GetDevice(28)
|
||||
if lFMRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2002, string.format("%.3f", lFMRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('FM_Freq: '..ExportScript.Tools.dump(list_indication(4)))
|
||||
|
||||
local lFMRadioFreq = ExportScript.Tools.getListIndicatorValue(4)
|
||||
|
||||
if lFMRadioFreq ~= nil and lFMRadioFreq.FM_Freq ~= nil then
|
||||
ExportScript.Tools.SendData(2002, string.format("%s", lFMRadioFreq.FM_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2002, " ")
|
||||
end
|
||||
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
-- [273] = "%.1f", -- FM RADIO - Chanel Selector {0.0,0.2,0.3,0.5,0.6,0.8,0.9,1.1} -- gerundet
|
||||
local lFM_RADIO_PRESET = {[0.0]="1",[0.2]="2",[0.3]="3",[0.5]="4",[0.6]="5",[0.8]="6",[0.9]="0",[1.1]="R"}
|
||||
ExportScript.Tools.SendData(2003, lFM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(273), 1, "ceil")])
|
||||
|
||||
-- Weapon Panel
|
||||
---------------------------------------------------
|
||||
if mainPanelDevice:get_argument_value(354) >= 0.0 then -- Weapon panel is On
|
||||
local lWeaponPanelDisplays = ExportScript.Tools.getListIndicatorValue(8)
|
||||
|
||||
if lWeaponPanelDisplays ~= nil then
|
||||
if lWeaponPanelDisplays.LEFT_screen ~= nil then
|
||||
ExportScript.Tools.SendData(2004, string.format("%s", lWeaponPanelDisplays.LEFT_screen))
|
||||
end
|
||||
if lWeaponPanelDisplays.RIGHT_screen ~= nil then
|
||||
ExportScript.Tools.SendData(2005, string.format("%s", lWeaponPanelDisplays.RIGHT_screen))
|
||||
end
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2004, " ")
|
||||
ExportScript.Tools.SendData(2005, " ")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- UHF Radio
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(31)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC("2000", string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('UHF_Freq: '..ExportScript.Tools.dump(list_indication(5)))
|
||||
|
||||
local lUHFRadioFreq = ExportScript.Tools.getListIndicatorValue(5)
|
||||
|
||||
if lUHFRadioFreq ~= nil and lUHFRadioFreq.UHF_Freq ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%s", lUHFRadioFreq.UHF_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2000", "-")
|
||||
end
|
||||
|
||||
-- AM Radio
|
||||
---------------------------------------------------
|
||||
local lAMRadio = GetDevice(5)
|
||||
--ExportScript.Tools.SendDataDAC("2001", string.format("%.3f", lAMRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2001", ExportScript.Tools.RoundFreqeuncy(lAMRadio:get_frequency()/1000000))
|
||||
|
||||
-- FM Radio PR4G
|
||||
---------------------------------------------------
|
||||
local lFMRadio = GetDevice(28)
|
||||
if lFMRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC(2002, string.format("%.3f", lFMRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('FM_Freq: '..ExportScript.Tools.dump(list_indication(4)))
|
||||
|
||||
local lFMRadioFreq = ExportScript.Tools.getListIndicatorValue(4)
|
||||
|
||||
if lFMRadioFreq ~= nil and lFMRadioFreq.FM_Freq ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2002", string.format("%s", lFMRadioFreq.FM_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2002", "-")
|
||||
end
|
||||
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
-- [273] = "%.1f", -- FM RADIO - Chanel Selector {0.0,0.2,0.3,0.5,0.6,0.8,0.9,1.1} -- gerundet
|
||||
local lFM_RADIO_PRESET = {[0.0]="1",[0.2]="2",[0.3]="3",[0.5]="4",[0.6]="5",[0.8]="6",[0.9]="0",[1.1]="R"}
|
||||
ExportScript.Tools.SendDataDAC("2003", lFM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(273), 1, "ceil")])
|
||||
|
||||
-- Weapon Panel
|
||||
---------------------------------------------------
|
||||
if mainPanelDevice:get_argument_value(354) >= 0.0 then -- Weapon panel is On
|
||||
local lWeaponPanelDisplays = ExportScript.Tools.getListIndicatorValue(8)
|
||||
|
||||
if lWeaponPanelDisplays ~= nil then
|
||||
if lWeaponPanelDisplays.LEFT_screen ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2004", string.format("%s", lWeaponPanelDisplays.LEFT_screen))
|
||||
end
|
||||
if lWeaponPanelDisplays.RIGHT_screen ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2005", string.format("%s", lWeaponPanelDisplays.RIGHT_screen))
|
||||
end
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2004", "-")
|
||||
ExportScript.Tools.SendDataDAC("2005", "-")
|
||||
end
|
||||
|
||||
-- generic Radio display and frequency rotarys
|
||||
-------------------------------------------------
|
||||
-- genericRadioConf
|
||||
ExportScript.genericRadioConf = {}
|
||||
ExportScript.genericRadioConf['maxRadios'] = 3 -- numbers of aviables/supported radios
|
||||
ExportScript.genericRadioConf[1] = {} -- first radio
|
||||
ExportScript.genericRadioConf[1]['Name'] = "UHF Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[1]['DeviceID'] = 31 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[1]['minFrequency'] = 225.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[1]['maxFrequency'] = 399.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[1]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.167 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3011 -- volume button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active
|
||||
--ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 161 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20",[1.00]="01"}
|
||||
--ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.05 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 170 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3010 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
-- Load Button = VLD Button
|
||||
ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset
|
||||
ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3003 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 167 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[2] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[2]['Name'] = "AM Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[2]['DeviceID'] = 5 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[2]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[2]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[2]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[2]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[2]['minFrequency'] = 118.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[2]['maxFrequency'] = 143.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[2]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[2]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOn'] = 0.33 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[2]['Volume']['ButtonID'] = 3005 -- volume button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset'] = {} -- preset knob active
|
||||
--ExportScript.genericRadioConf[2]['Preset']['ArgumentID'] = 137 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset']['List'] = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="01"}
|
||||
--ExportScript.genericRadioConf[2]['Preset']['Step'] = 0.01 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[2]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ArgumentID'] = 134 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[2]['Load']['ButtonID'] = 3006 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ArgumentID'] = 135 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[3] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[3]['Name'] = "FM Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[3]['DeviceID'] = 28 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[3]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[3]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[3]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[3]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[3]['minFrequency'] = 30.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[3]['maxFrequency'] = 87.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[3]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[3]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOn'] = 0.25 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[3]['Volume']['ButtonID'] = 3005 -- volume button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Preset'] = {} -- preset knob active
|
||||
ExportScript.genericRadioConf[3]['Preset']['ArgumentID'] = 273 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Preset']['ButtonID'] = 3002 -- preset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Preset']['ButtonID2'] = 3002 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
ExportScript.genericRadioConf[3]['Preset']['List'] = {[0.0]="1",[0.143]="2",[0.286]="3",[0.429]="4",[0.572]="5",[0.715]="6",[0.858]="0",[1.0]="9"}
|
||||
ExportScript.genericRadioConf[3]['Preset']['Step'] = 0.143 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[3]['Preset']['Step2'] = -0.01 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[3]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ArgumentID'] = 148 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ValueOff'] = -1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[3]['Load']['ButtonID'] = 3004 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ArgumentID'] = 149 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadio(nil, nil)
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,730 @@
|
||||
-- SA342M
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.SA342M = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Gyro Panel
|
||||
[200] = "%.4f", -- Gyro_Needle_State {-1,1} Gyro Panel SYNC
|
||||
[201] = "%.f", -- Gyro_voyant_test Lamp {0,1}
|
||||
[202] = "%.f", -- Gyro_voyant_trim Lamp {0,1}
|
||||
[203] = "%.f", -- Gyro_voyant_bpp Lamp {0,1}
|
||||
-- Autopilot Panel
|
||||
[37] = "%.4f", -- T_Needle_State {-1,1} Pitch correction Indicator
|
||||
[38] = "%.4f", -- R_Needle_State {-1,1} Roll correction Indicator
|
||||
[39] = "%.4f", -- L_Needle_State {-1,1} Yaw correction Indicator
|
||||
--[196] = "%.4f", -- RWR_light {0,1} -- RWR background light
|
||||
--[] = "%.4f", -- PE_fondbright {0,1} ???
|
||||
--[353] = "%.4f", -- NADIR_fondbright {0,1} ???
|
||||
-- Flare Dispenser Lamps
|
||||
[233] = "%.f", -- Voyant_FD_On {0,1} Power On
|
||||
[231] = "%.f", -- Voyant_FD_G {0,1} select Left
|
||||
[232] = "%.f", -- Voyant_FD_D {0,1} select Right
|
||||
[227] = "%.f", -- Voyant_FD_LEU {0,1} Status LEU
|
||||
[223] = "%.f", -- Voyant_FD_G_vide1 {0,1} Status Left G
|
||||
[224] = "%.f", -- Voyant_FD_G_vide2 {0,1} Status Left VIDE
|
||||
[225] = "%.f", -- Voyant_FD_D_vide1 {0,1} Status Right G
|
||||
[226] = "%.f", -- Voyant_FD_D_vide2 {0,1} Status Right VIDE
|
||||
-- ADF Radio
|
||||
[158] = "%0.1f", -- ADF_nav1_centaine {0,1} X00.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[159] = "%0.1f", -- ADF_nav1_dizaine {0,1} 0X0.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[160] = "%0.1f", -- ADF_nav1_unite {0,1} 00X.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[161] = "%0.1f", -- ADF_nav1_dec {0,1} 000.X khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[162] = "%0.1f", -- ADF_nav2_centaine {0,1} X00.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[163] = "%0.1f", -- ADF_nav2_dizaine {0,1} 0X0.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[164] = "%0.1f", -- ADF_nav2_unite {0,1} 00X.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[165] = "%0.1f", -- ADF_nav2_dec {0,1} 000.X khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- ADF Gauge
|
||||
[113] = "%.4f", -- ADF_Fond Compass rose {0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360}{0.0,0.028,0.055,0.084,0.111,0.138,0.166,0.194,0.222,0.249,0.2775,0.305,0.332,0.36,0.388,0.415,0.4434,0.47,0.498,0.526,0.555,0.583,0.611,0.638,0.6665,0.694,0.722,0.75,0.776,0.805,0.833,0.861,0.8885,0.917,0.944,0.972,1.0}
|
||||
[102] = "%.4f", -- ADF_Aiguille_large Heading Needle large {-360.0,0.0,360.0}{-1.0,0.0,1.0}
|
||||
[103] = "%.4f", -- ADF_Aiguille_fine Heading Needle fine {-360.0,0.0,360.0}{-1.0,0.0,1.0}
|
||||
[107] = "%.1f", -- ADF_FlagCAP {0,1}
|
||||
[109] = "%.1f", -- ADF_FlagBut {0,1}
|
||||
[108] = "%.1f", -- ADF_FlagCompteur PX Flag {0,1}
|
||||
[110] = "%0.1f", -- ADF_compteur_Cent {0,1} X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[111] = "%0.1f", -- ADF_compteur_Dix {0,1} 0X0 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[112] = "%0.1f", -- ADF_compteur_Unit {0,1} 00X {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- CLOCK
|
||||
[41] = "%.3f", -- CLOCK_HOUR {0,1,2,3,4,5,6,7,8,9,10,11,12}{0,0.081,0.162,0.245,0.33,0.415,0.501,0.587,0.672,0.756,0.838,0.919,1}
|
||||
[42] = "%.3f", -- CLOCK_MINUTE {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60}{0,0.017,0.033,0.049,0.065,0.08,0.098,0.115,0.131,0.147,0.163,0.18,0.195,0.213,0.23,0.246,0.262,0.279,0.296,0.313,0.33,0.346,0.363,0.38,0.397,0.415,0.431,0.449,0.466,0.483,0.501,0.518,0.535,0.552,0.569,0.586,0.604,0.621,0.638,0.655,0.672,0.688,0.705,0.722,0.739,0.755,0.771,0.788,0.804,0.821,0.838,0.853,0.87,0.885,0.902,0.919,0.934,0.95,0.967,0.984,1}
|
||||
[43] = "%.3f", -- CLOCK_SECOND {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60}{0,0.017,0.033,0.049,0.065,0.08,0.098,0.115,0.131,0.147,0.163,0.18,0.195,0.213,0.23,0.246,0.262,0.279,0.296,0.313,0.33,0.346,0.363,0.38,0.397,0.415,0.431,0.449,0.466,0.483,0.501,0.518,0.535,0.552,0.569,0.586,0.604,0.621,0.638,0.655,0.672,0.688,0.705,0.722,0.739,0.755,0.771,0.788,0.804,0.821,0.838,0.853,0.87,0.885,0.902,0.919,0.934,0.95,0.967,0.984,1}
|
||||
[44] = "%.3f", -- CLOCK_MINI {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}{0,0.032,0.065,0.098,0.131,0.164,0.198,0.231,0.264,0.297,0.331,0.364,0.397,0.43,0.464,0.497,0.523,0.551,0.576,0.605,0.63,0.659,0.684,0.714,0.758,0.796,0.838,0.879,0.92,0.958,1}
|
||||
-- Wipers
|
||||
--[547] = "%.4f", -- EGPilote {-1,1}
|
||||
--[546] = "%.4f", -- EGCopilote {-1,1}
|
||||
-- LIGHTS
|
||||
--[40] = "%.4f", -- Lum_Plafond {0,1} Main Panel Lights
|
||||
--[142] = "%.4f", -- PBOIntensity {0,1} Main Panel Background lights
|
||||
--[144] = "%.4f", -- PUPIntensity {0,1} Lower Panel Background lights
|
||||
-- Baro altimetre
|
||||
[87] = "%.4f", -- Baro_Altimeter_thousands Needle {0.0,1.0}
|
||||
[573] = "%.4f", -- Baro_Altimeter_hundred Needle {0.0,1.0}
|
||||
[88] = "%0.1f", -- Baro_Altimeter_press_unite 000X {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[90] = "%0.1f", -- Baro_Altimeter_press_dix 00X0 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[92] = "%0.1f", -- Baro_Altimeter_press_cent 0X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[95] = "%0.1f", -- Baro_Altimeter_press_mille X000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- radar altimetre
|
||||
[94] = "%.4f", -- Radar_Altimeter {0,5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850}{0,0.019,0.035,0.072,0.109,0.147,0.18,0.214,0.247,0.283,0.316,0.345,0.376,0.407,0.438,0.469,0.501,0.564,0.606,0.648,0.676,0.706,0.732,0.756,0.775,0.794,0.811,0.829,0.843,0.858,0.87}
|
||||
[93] = "%.4f", -- DangerRALT_index {0,5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850}{0.0,0.0175,0.0338,0.0715,0.109,0.147,0.182,0.215,0.247,0.282,0.315,0.3445,0.377,0.407,0.439,0.47,0.5005,0.5628,0.6052,0.646,0.675,0.7058,0.7315,0.755,0.7747,0.793,0.8097,0.8272,0.8425,0.8575,0.8693}
|
||||
[97] = "%.f", -- RAltlamp {0,1}
|
||||
[98] = "%.f", -- RAlt_flag_Panne OFF Flag{0,1}
|
||||
[99] = "%.1f", -- RAlt_flag_MA A (Test) Flag{0,1}
|
||||
[91] = "%.1f", -- RAlt_knob_MA Power/Test Knop{0,1}
|
||||
-- TORQUE
|
||||
[16] = "%.3f", -- Torque {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110}{0.085,0.13,0.172,0.214,0.253,0.289,0.326,0.362,0.395,0.43,0.466,0.501,0.537,0.573,0.607,0.639,0.676,0.71,0.746,0.785,0.826,0.865,0.908}
|
||||
[55] = "%.3f", -- Torque_Bug {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110}{0.084,0.128,0.171,0.2134,0.252,0.2889,0.325,0.361,0.396,0.431,0.467,0.501,0.535,0.571,0.605,0.639,0.674,0.71,0.745,0.785,0.825,0.865,0.91}
|
||||
[17] = "%.f", -- VOYANT_TORQUE Lamp {0,1}
|
||||
-- Gyro_Compas
|
||||
[26] = "%.3f", -- Gyro_Compas {0,30,60,90,120,150,180,210,240,270,300,330,360}{0,0.083,0.167,0.251,0.334,0.418,0.5,0.583,0.667,0.751,0.832,0.917,1}
|
||||
-- Stby HA ADI
|
||||
[214] = "%.4f", -- StbyHA_Roll {-180,-90,-60,-30,-20,-10,0,10,20,30,60,90,180}{-1,-0.502,-0.335,-0.166,-0.11,-0.052,0,0.055,0.113,0.171,0.334,0.502,1}
|
||||
[213] = "%.4f", -- StbyHA_Pitch {-180,-150,-120,-90,-60,-50,-40,-30,-20,-15,-10,-5,0,5,10,15,20,30,40,50,60,90,120,150,180}{-1,-0.833,-0.667,-0.5,-0.333,-0.278,-0.223,-0.167,-0.111,-0.084,-0.057,-0.003,0,0.028,0.056,0.083,0.111,0.167,0.223,0.278,0.333,0.5,0.667,0.833,1}
|
||||
[211] = "%.1f", -- StdbyHA_Flag Fault Flag {0,1}
|
||||
[212] = "%.4f", -- Stdby_HA_W W Sympol {0,1}
|
||||
[217] = "%.4f", -- Stdby_HA_Curseur Knob Needle {0,1}
|
||||
-- QComb Fuel Indicator
|
||||
[137] = "%.3f", -- QComb {0,50,100,150,200,250,300,350,400,500}{0.093,0.243,0.354,0.428,0.521,0.621,0.692,0.771,0.834,0.932}
|
||||
-- Horizon Artificiel Principal
|
||||
[27] = "%.4f", -- Pitch_HA {-180,-170,-160,-150,-140,-130,-120,-110,-100,-90,-80,-70,-60,-50,-40,-30,-20,-10,0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180}{-1,-0.946,-0.898,-0.838,-0.78,-0.723,-0.667,-0.61,-0.556,-0.501,-0.446,-0.393,-0.334,-0.277,-0.223,-0.166,-0.104,-0.054,0,0.054,0.102,0.161,0.22,0.277,0.333,0.389,0.443,0.498,0.553,0.607,0.666,0.722,0.776,0.834,0.896,0.946,1}
|
||||
[28] = "%.4f", -- Roll_HA {-180,-90,-60,-30,-20,-10,0,10,20,30,60,90,180}{-1,-0.498,-0.331,-0.162,-0.111,-0.053,0,0.058,0.112,0.168,0.331,0.498,1}
|
||||
[20] = "%.4f", -- Bille_HA Slip Ball {-1,1}
|
||||
[18] = "%.1f", -- flag_GS_HA GS Flag {0,1}
|
||||
[19] = "%.1f", -- flag_HS_HA Fault Flag {0,1}
|
||||
[29] = "%.1f", -- flag_Lock_HA Lock Flag {0,1}
|
||||
[117] = "%.4f", -- Curseur_HA Knob Needle {0,1}
|
||||
[120] = "%.4f", -- W_HA W Sympol {-1,1}
|
||||
[118] = "%.4f", -- VerBar_HA Vertical Bar {-1,1}
|
||||
[119] = "%.4f", -- HorBar_HA Horizon Bar {-1,1}
|
||||
-- variometre
|
||||
[24] = "%.4f", -- Variometre {-800,-700,-600,-500,-400,-300,-200,-100,-50,0,50,100,200,300,400,500,600,700,800}{-0.481,-0.436,-0.391,-0.338,-0.28,-0.218,-0.153,-0.075,-0.035,0.0,0.035,0.071,0.139,0.202,0.264,0.32,0.372,0.418,0.463}
|
||||
-- IAS
|
||||
[51] = "%.4f", -- IAS {0,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370}{0,0.1,0.133,0.172,0.207,0.243,0.277,0.316,0.35,0.38,0.41,0.439,0.465,0.491,0.517,0.541,0.565,0.587,0.611,0.63,0.651,0.671,0.692,0.712,0.731,0.75,0.77,0.791,0.809,0.829,0.849,0.867,0.886}
|
||||
-- RPM
|
||||
[135] = "%.4f", -- Turbine_RPM large Needle {0,5000,10000,15000,20000,25000,29000,35000,40000,43500,45000,50000}{0.095,0.181,0.263,0.346,0.424,0.505,0.572,0.665,0.748,0.802,0.828,0.909}
|
||||
[52] = "%.4f", -- Rotor_RPM small Needle {0,50,100,150,200,250,262,316.29,361.05,387,400,450}{0.096,0.191,0.283,0.374,0.461,0.549,0.57,0.665,0.748,0.802,0.811,0.904}
|
||||
-- Voltmetre
|
||||
[14] = "%.3f", -- Voltmetre {0,5,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}{0.045,0.074,0.103,0.133,0.163,0.192,0.221,0.25,0.281,0.31,0.339,0.368,0.399,0.429,0.458,0.488,0.518,0.547,0.576,0.605,0.635,0.664,0.695,0.724}
|
||||
-- TQuatre Engine temperature Indicator
|
||||
[15] = "%.3f", -- TQuatre Engine Temp {0,100,200,300,400,500,600,700,800}{0.1575,0.228,0.3,0.3845,0.473,0.577,0.676,0.772,0.8625}
|
||||
-- TempExt outside temperature
|
||||
[25] = "%.3f", -- TempExt {-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70}{-0.758,-0.691,-0.625,-0.558,-0.492,-0.425,-0.359,-0.292,-0.224,-0.158,-0.09,-0.024,0.043,0.11,0.177,0.244,0.31,0.379,0.445,0.512,0.579,0.644,0.712}
|
||||
-- TempThm Oil Temperature Indicator
|
||||
[151] = "%.3f", -- TempThm Oil Temp {-20,-10,0,10,20,30,40,50,60,70,80,85,90,100}{0.046,0.102,0.157,0.213,0.268,0.323,0.38,0.435,0.492,0.547,0.603,0.63,0.659,0.715}
|
||||
-- Fuel Tank Indicator
|
||||
[152] = "%.3f", -- Gauge_RSupp {-1,0,0.25,0.5,0.75,1}{0,0.202,0.426,0.63,0.801,1}
|
||||
-- VHF AM Radio
|
||||
[133] = "%.1f", -- AM_Radio_freq_cent {0,1} X00.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[134] = "%.1f", -- AM_Radio_freq_dix {0,1} 0X0.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[136] = "%.1f", -- AM_Radio_freq_unite {0,1} 00X.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[138] = "%.1f", -- AM_Radio_freq_dixieme {0,1} 000.X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[139] = "%.2f", -- AM_Radio_freq_centieme {0,1} 000.0XX {00,25,50,75,00}{0.0,0.25,0.50,0.75,1.0}
|
||||
-- Lamps
|
||||
-- Voyant_DEM
|
||||
[300] = "%.f", -- Voyant_DEM Start lamp{0,1}
|
||||
-- Voyant_RLT
|
||||
[301] = "%.f", -- Voyant_RLT Idle lamp {0,1}
|
||||
-- Voyant_BLOC
|
||||
[302] = "%.f", -- Voyant_BLOC Blocked Engine lamp {0,1}
|
||||
-- RSUPP Fueltank
|
||||
[320] = "%.f", -- Voyant_RSupp Fueltank lamp {0,1}
|
||||
-- RCONV Convoy Fueltank
|
||||
[321] = "%.f", -- Voyant_RConv Convoy Fueltank lamüp {0,1}
|
||||
-- Voyant_FILTAS Sandfilter lamp
|
||||
[322] = "%.f", -- Voyant_FILTAS sandfilter lamp {0,1}
|
||||
-- Voyant_Alarme Master Alarme lamp
|
||||
[303] = "%.f", -- Voyant_Alarme Master Alarme lamp {0,1}
|
||||
-- AM_RADIO
|
||||
[141] = "%.f", -- AM_Radio_lamp {0,1}
|
||||
-- Tableau Alarme Lamps
|
||||
[1] = "%.f", -- TA_Pitot {0,1}
|
||||
[2] = "%.f", -- TA_Hmot {0,1}
|
||||
[3] = "%.f", -- TA_Hbtp {0,1}
|
||||
[4] = "%.f", -- TA_Hral {0,1}
|
||||
[5] = "%.f", -- TA_Gene {0,1}
|
||||
[6] = "%.f", -- TA_Alter {0,1}
|
||||
[7] = "%.f", -- TA_Bat {0,1}
|
||||
[8] = "%.f", -- TA_PA {0,1}
|
||||
[9] = "%.f", -- TA_Nav {0,1}
|
||||
[10] = "%.f", -- TA_Comb {0,1}
|
||||
[11] = "%.f", -- TA_Bphy {0,1}
|
||||
[12] = "%.f", -- TA_Lim {0,1}
|
||||
[13] = "%.f", -- TA_Filt {0,1}
|
||||
-- Intercomp Lamps
|
||||
[455] = "%.f", -- Intercomp VHF Light
|
||||
[456] = "%.f", -- Intercomp FM1 Light
|
||||
[457] = "%.f", -- Intercomp UHF Light
|
||||
-- SA342M HOT3 Weapon Panel Lamps
|
||||
[183] = "%.f", -- HOT3 WP Lamps BON
|
||||
[184] = "%.f", -- HOT3 WP Lamps MAUVAIS
|
||||
[185] = "%.f", -- HOT3 WP Lamps ALIMENTATION
|
||||
[186] = "%.f", -- HOT3 WP Lamps MISSILE PRET
|
||||
[187] = "%.f", -- HOT3 WP Lamps TIR AUTOR.
|
||||
[188] = "%.f", -- HOT3 WP Lamps DEFAUT
|
||||
[189] = "%.f", -- HOT3 WP Lamps TEST I
|
||||
[190] = "%.f", -- HOT3 WP Lamps JOUR
|
||||
[191] = "%.f", -- HOT3 WP Lamps LUMINOSITE
|
||||
[192] = "%.f", -- HOT3 WP Lamps TEST II
|
||||
[193] = "%.f" -- HOT3 WP Lamps NUIT
|
||||
}
|
||||
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- WEAPONS PANEL 1
|
||||
[354] = "%1d", -- WP1 - Off/On/Stsnfby {-1.0,0.0,1.0}
|
||||
[357] = "%.4f", -- WP1 - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- WEAPONS PANEL 2
|
||||
[372] = "%1d", -- WP2 - Ma Left
|
||||
[373] = "%1d", -- WP2 - Ma Left Cover
|
||||
[374] = "%1d", -- WP2 - Ma Right
|
||||
[375] = "%1d", -- WP2 - Ma Right Cover
|
||||
[376] = "%1d", -- WP2 - Seq Ripple selection
|
||||
-- PILOTSIGHT
|
||||
[171] = "%1d", -- PILOTSIGHT - Pilot Sight
|
||||
-- PILOT STICK
|
||||
--[50] = "%1d", -- PILOT STICK - Magnetic Brake
|
||||
--[53] = "%1d", -- PILOT STICK - Wiper once
|
||||
--[209] = "%1d", -- PILOT STICK - Autopilot Button
|
||||
--[293] = "%1d", -- PILOT STICK - Slave
|
||||
--[294] = "%1d", -- PILOT STICK - Auto-Hover
|
||||
-- WSO LEFT SIDE STICK
|
||||
[255] = "%1d", -- PE WSO STICK - Lasing Button Cover
|
||||
[256] = "%1d", -- PE WSO STICK - Lasing Button
|
||||
[257] = "%1d", -- PE WSO STICK - Missile Launch Cover
|
||||
[258] = "%1d", -- PE WSO STICK - Missile Launch Button
|
||||
[259] = "%1d", -- PE WSO STICK - Inversed Symbology Toggle
|
||||
[260] = "%1d", -- PE WSO STICK - Inversed Image Toggle
|
||||
[264] = "%.1f", -- PE WSO STICK - Image Focus {-1.0,1.0}
|
||||
[262] = "%.1f", -- PE WSO STICK - Gain {-1.0,1.0}
|
||||
[263] = "%.1f", -- PE WSO STICK - Image Brightness {-1.0,1.0}
|
||||
[219] = "%.1f", -- PE WSO STICK - Symbology Brightness {-1.0,1.0}
|
||||
-- GYRO
|
||||
[197] = "%1d", -- GYRO - Test Cover
|
||||
[198] = "%1d", -- GYRO - Test Switch On/Off
|
||||
[199] = "%1d", -- GYRO - Left/Center/Right
|
||||
[153] = "%.2f", -- GYRO - CM/A/GM/D/GD {0.0,0.25,0.50,0.75,1.0}
|
||||
-- CLOCK
|
||||
[45] = "%.4f", -- CLOCK - Winder (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[46] = "%1d", -- CLOCK - Start/Stop
|
||||
[47] = "%1d", -- CLOCK - Reset
|
||||
-- SA342M HOT3 only
|
||||
-- PH SA342M HOT3
|
||||
[180] = "%.2f", -- PH - Test II/Test I/Off/Day/Night {0.0,0.25,0.50,0.75,1.0}
|
||||
[181] = "%.3f", -- PH - Station Select 0/1/0/2/0/3/0/4/0 {0.0,0.125,0.250,0,375,0.500,0.625,0.750,0.875,1.0}
|
||||
[182] = "%.4f", -- PH - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- PE SA342L/M/Mistral BCV (BOITIER DE COMMANDE VIDEO – video command box)
|
||||
[362] = "%1d", -- PE BCV - Centering
|
||||
[364] = "%1d", -- PE BCV - VDO/VTH
|
||||
[365] = "%.1f", -- PE BCV - Zoom {-1.0,1.0}
|
||||
[366] = "%.1f", -- PE BCV - CTH A/V/M {0.0,0.5,1.0}
|
||||
[367] = "%1d", -- PE BCV - Power
|
||||
[370] = "%.2f", -- PE BCV - Mode A/C/V/PIL/ASS {0.0,0.25,0.50,0.75,1.0}
|
||||
-- NADIR
|
||||
[330] = "%.4f", -- NADIR - Off/Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[331] = "%.2f", -- NADIR - Mode Off/Stby/Ground/Sea/Air Speed Sensor/Ground Test {0.0,0.2,0.4,0.6,0.8,1.0}
|
||||
[332] = "%.2f", -- NADIR - Parameter Wind/Magnetic Heading/Ground Speed/Calculated Time/Current Position/Waypoint {0.0,0.2,0.4,0.6,0.8,1.0}
|
||||
[333] = "%1d", -- NADIR - ENT
|
||||
[334] = "%1d", -- NADIR - DES
|
||||
[335] = "%1d", -- NADIR - AUX
|
||||
[336] = "%1d", -- NADIR - IC
|
||||
[337] = "%1d", -- NADIR - DOWN
|
||||
[351] = "%1d", -- NADIR - 0
|
||||
[338] = "%1d", -- NADIR - 1
|
||||
[339] = "%1d", -- NADIR - 2
|
||||
[340] = "%1d", -- NADIR - 3
|
||||
[342] = "%1d", -- NADIR - 4
|
||||
[343] = "%1d", -- NADIR - 5
|
||||
[344] = "%1d", -- NADIR - 6
|
||||
[346] = "%1d", -- NADIR - 7
|
||||
[347] = "%1d", -- NADIR - 8
|
||||
[348] = "%1d", -- NADIR - 9
|
||||
[341] = "%1d", -- NADIR - POL
|
||||
[345] = "%1d", -- NADIR - GEO
|
||||
[349] = "%1d", -- NADIR - POS
|
||||
[350] = "%1d", -- NADIR - GEL
|
||||
[352] = "%1d", -- NADIR - EFF
|
||||
-- AM_RADIO
|
||||
[128] = "%.2f", -- AM RADIO - Selector {0.0,0.33,0.66,0.99}
|
||||
[129] = "%.4f", -- AM RADIO - Freq decimals (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[130] = "%1d", -- AM RADIO - 25/50kHz Selector
|
||||
[131] = "%.4f", -- AM RADIO - Freq dial (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FM_RADIO
|
||||
[272] = "%.2f", -- FM RADIO - Main Selector {0.0,0.25,0.50,0.75,1.0}
|
||||
[273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0}
|
||||
[274] = "%1d", -- FM RADIO - 7
|
||||
[275] = "%1d", -- FM RADIO - 8
|
||||
[276] = "%1d", -- FM RADIO - 9
|
||||
[277] = "%1d", -- FM RADIO - 0
|
||||
[278] = "%1d", -- FM RADIO - X
|
||||
[279] = "%1d", -- FM RADIO - 4
|
||||
[280] = "%1d", -- FM RADIO - 5
|
||||
[281] = "%1d", -- FM RADIO - 6
|
||||
[282] = "%1d", -- FM RADIO - RC
|
||||
[283] = "%1d", -- FM RADIO - UP
|
||||
[284] = "%1d", -- FM RADIO - 1
|
||||
[285] = "%1d", -- FM RADIO - 2
|
||||
[286] = "%1d", -- FM RADIO - 3
|
||||
[287] = "%1d", -- FM RADIO - VAL
|
||||
[288] = "%1d", -- FM RADIO - DOWN
|
||||
-- TV
|
||||
[124] = "%1d", -- TV - On/Off
|
||||
[125] = "%.4f", -- TV - Contrast (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[123] = "%.4f", -- TV - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
--[126] = "%.4f", -- TV - Cover (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RWR
|
||||
[148] = "%1d", -- RWR - Off/On/Croc {-1.0,0.0,1.0}
|
||||
[149] = "%1d", -- RWR - Marker
|
||||
[150] = "%1d", -- RWR - Page
|
||||
[121] = "%.4f", -- RWR - Audio (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[122] = "%.4f", -- RWR - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- ADI
|
||||
[115] = "%.4f", -- ADI - Unlock (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[116] = "%1d", -- ADI - Unlock
|
||||
-- Stby ADI
|
||||
[215] = "%.4f", -- STDBY ADI - Unlock (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[216] = "%1d", -- STDBY ADI - Unlock
|
||||
-- ArtVisVhfDop (Source selector for main artificial horizon vertical bar)
|
||||
[218] = "%.2f", -- ADI - Source Off/Camera target point/ADF ermitter/NADIR Waypoint {0.0,0.33,0.66,0.99}
|
||||
-- INTERCOM
|
||||
[452] = "%1d", -- INTERCOM - VHF AM Radio
|
||||
[68] = "%.4f", -- INTERCOM - VHF AM Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[453] = "%1d", -- INTERCOM - FM Radio
|
||||
[69] = "%.4f", -- INTERCOM - FM Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[454] = "%1d", -- INTERCOM - UHF Radio
|
||||
[70] = "%.4f", -- INTERCOM - UHF Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- TORQUE
|
||||
[58] = "%1d", -- TORQUE Bug/Test
|
||||
[54] = "%.4f", -- TORQUE Bug/Test (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- LIGHTS
|
||||
[22] = "%.4f", -- LIGHTS - Main Dashboard Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[21] = "%.4f", -- LIGHTS - Console Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[145] = "%.4f", -- LIGHTS - UV Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[23] = "%1d", -- LIGHTS - NORM/BNL
|
||||
[147] = "%.4f", -- LIGHTS - Roof Lamp Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[154] = "%1d", -- LIGHTS - Red Lens On/Off
|
||||
-- ELECTRIC
|
||||
[264] = "%1d", -- ELECTRIC - Battery
|
||||
[265] = "%1d", -- ELECTRIC - Alternator
|
||||
[268] = "%1d", -- ELECTRIC - Generator
|
||||
[62] = "%1d", -- ELECTRIC - Voltmeter Test
|
||||
[170] = "%1d", -- ELECTRIC - Pitot
|
||||
[271] = "%1d", -- ELECTRIC - Fuel Pump
|
||||
[267] = "%1d", -- ELECTRIC - Additionnal Fuel Tank
|
||||
[56] = "%1d", -- ELECTRIC - Starter Start/Stop/Air {-1.0,0.0,1.0}
|
||||
[57] = "%1d", -- ELECTRIC - Test
|
||||
[48] = "%1d", -- ELECTRIC - Copilot Wiper {-1.0,0.0,1.0}
|
||||
[49] = "%1d", -- ELECTRIC - Pilot Wiper {-1.0,0.0,1.0}
|
||||
[61] = "%1d", -- ELECTRIC - Left from Pitot
|
||||
[59] = "%1d", -- ELECTRIC - HYD Test
|
||||
[66] = "%1d", -- ELECTRIC - Alter Rearm
|
||||
[67] = "%1d", -- ELECTRIC - Gene Rearm
|
||||
[63] = "%1d", -- ELECTRIC - Convoy Tank On/Off
|
||||
[64] = "%1d", -- ELECTRIC - Sand Filter On/Off
|
||||
-- NAVLIGHTS
|
||||
[146] = "%1d", -- NAVLIGHTS - Navigation Lights CLI/OFF/FIX {-1.0,0.0,1.0}
|
||||
[228] = "%1d", -- NAVLIGHTS - Anticollision Light NOR/OFF/ATT {-1.0,0.0,1.0}
|
||||
[105] = "%1d", -- NAVLIGHTS - Landing Light Off/Vario/On {-1.0,0.0,1.0}
|
||||
[106] = "%1d", -- NAVLIGHTS - Landing Light Extend/Retract
|
||||
[382] = "%1d", -- NAVLIGHTS - Panels Lighting On/Off
|
||||
[30] = "%.4f", -- NAVLIGHTS - AntiCollision Light Intensity (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[229] = "%1d", -- NAVLIGHTS - Formation Lights On/Off
|
||||
[230] = "%.4f", -- NAVLIGHTS - Formation Lights Intensity (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FLARE DISPENSER
|
||||
[220] = "%1d", -- FLARE DISPENSER - G/G+D/D {-1.0,0.0,1.0}
|
||||
[221] = "%1d", -- FLARE DISPENSER - Mode
|
||||
[222] = "%1d", -- FLARE DISPENSER - Off/Speed {-1.0,0.0,1.0}
|
||||
[194] = "%1d", -- FLARE DISPENSER - Fire Button Cover
|
||||
[195] = "%1d", -- FLARE DISPENSER - Fire Button
|
||||
-- AUTOPILOT
|
||||
[31] = "%1d", -- AUTOPILOT - Autopilot On/Off
|
||||
[32] = "%1d", -- AUTOPILOT - Pitch On/Off
|
||||
[33] = "%1d", -- AUTOPILOT - Roll On/Off
|
||||
[34] = "%1d", -- AUTOPILOT - Yaw On/Off
|
||||
[35] = "%1d", -- AUTOPILOT - Mode Speed/OFF/Altitude {-1.0,0.0,1.0}
|
||||
[60] = "%1d", -- AUTOPILOT - Trim On/Off
|
||||
[65] = "%1d", -- AUTOPILOT - Magnetic Brake On/Off
|
||||
-- WEAPONS
|
||||
[269] = "%1d", -- WEAPONS - Master arm On/Off
|
||||
-- ROTORS
|
||||
[556] = "%.4f", -- ROTORS - Rotor Brake (Axis) {0.0, 1.0} in 0.055 Steps
|
||||
-- RADIOALTIMETER
|
||||
[96] = "%.4f", -- RADIOALTIMETER - Radar Alt Bug (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[100] = "%1d", -- RADIOALTIMETER - Radar Alt On/Off - Test
|
||||
[91] = "%.4f", -- RADIOALTIMETER - Radar Alt On/Off - Test (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- BAROALTIMETER
|
||||
[89] = "%.4f", -- BAROALTIMETER - Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FUEL SYSTEM
|
||||
[557] = "%.4f", -- FUEL SYSTEM - Fuel Flow Lever (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- ADF RADIO
|
||||
[166] = "%1d", -- ADF RADIO - Select
|
||||
[167] = "%1d", -- ADF RADIO - Tone
|
||||
[178] = "%.2f", -- ADF RADIO - Mode {0.0,0.33,0.66,0.99}
|
||||
[179] = "%.4f", -- ADF RADIO - Gain (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[168] = "%.4f", -- ADF RADIO - Nav1 Hundred (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[169] = "%.4f", -- ADF RADIO - Nav1 Ten (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[173] = "%.4f", -- ADF RADIO - Nav1 Unit (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[174] = "%.4f", -- ADF RADIO - Nav2 Hundred (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[175] = "%.4f", -- ADF RADIO - Nav2 Ten (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[176] = "%.4f", -- ADF RADIO - Nav2 Unit (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- UHF RADIO
|
||||
[383] = "%.3f", -- UHF RADIO - MODE 0/FF/NA/SV/DL/G/EN {0.0,0.167,0.334,0.501,0.668,0.835,1.0}
|
||||
[384] = "%1d", -- UHF RADIO - DRW
|
||||
[385] = "%1d", -- UHF RADIO - VLD
|
||||
[386] = "%.4f", -- UHF RADIO - PAGE (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[387] = "%1d", -- UHF RADIO - CONF
|
||||
[388] = "%1d", -- UHF RADIO - 1
|
||||
[389] = "%1d", -- UHF RADIO - 2
|
||||
[390] = "%1d", -- UHF RADIO - 3
|
||||
[391] = "%1d", -- UHF RADIO - 4
|
||||
[392] = "%1d", -- UHF RADIO - 5
|
||||
[393] = "%1d", -- UHF RADIO - 6
|
||||
[394] = "%1d", -- UHF RADIO - 7
|
||||
[395] = "%1d", -- UHF RADIO - 8
|
||||
[396] = "%1d", -- UHF RADIO - 9
|
||||
[397] = "%1d" -- UHF RADIO - 0
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- UHF Radio
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(31)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2000, string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('UHF_Freq: '..ExportScript.Tools.dump(list_indication(5)))
|
||||
|
||||
local lUHFRadioFreq = ExportScript.Tools.getListIndicatorValue(5)
|
||||
|
||||
if lUHFRadioFreq ~= nil and lUHFRadioFreq.UHF_Freq ~= nil then
|
||||
ExportScript.Tools.SendData(2000, string.format("%s", lUHFRadioFreq.UHF_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2000, " ")
|
||||
end
|
||||
|
||||
-- AM Radio
|
||||
---------------------------------------------------
|
||||
local lAMRadio = GetDevice(5)
|
||||
if lAMRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2001, string.format("%.3f", lAMRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2001, ExportScript.Tools.RoundFreqeuncy(lAMRadio:get_frequency()/1000000))
|
||||
end
|
||||
|
||||
-- FM Radio PR4G
|
||||
---------------------------------------------------
|
||||
local lFMRadio = GetDevice(28)
|
||||
if lFMRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2002, string.format("%.3f", lFMRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('FM_Freq: '..ExportScript.Tools.dump(list_indication(4)))
|
||||
|
||||
local lFMRadioFreq = ExportScript.Tools.getListIndicatorValue(4)
|
||||
|
||||
if lFMRadioFreq ~= nil and lFMRadioFreq.FM_Freq ~= nil then
|
||||
ExportScript.Tools.SendData(2002, string.format("%s", lFMRadioFreq.FM_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2002, " ")
|
||||
end
|
||||
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
-- [273] = "%.1f", -- FM RADIO - Chanel Selector {0.0,0.2,0.3,0.5,0.6,0.8,0.9,1.1} -- gerundet
|
||||
local lFM_RADIO_PRESET = {[0.0]="1",[0.2]="2",[0.3]="3",[0.5]="4",[0.6]="5",[0.8]="6",[0.9]="0",[1.1]="R"}
|
||||
ExportScript.Tools.SendData(2003, lFM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(273), 1, "ceil")])
|
||||
|
||||
-- Weapon Panel
|
||||
---------------------------------------------------
|
||||
if mainPanelDevice:get_argument_value(354) >= 0.0 then -- Weapon panel is On
|
||||
local lWeaponPanelDisplays = ExportScript.Tools.getListIndicatorValue(8)
|
||||
|
||||
if lWeaponPanelDisplays ~= nil then
|
||||
if lWeaponPanelDisplays.LEFT_screen ~= nil then
|
||||
ExportScript.Tools.SendData(2004, string.format("%s", lWeaponPanelDisplays.LEFT_screen))
|
||||
end
|
||||
if lWeaponPanelDisplays.RIGHT_screen ~= nil then
|
||||
ExportScript.Tools.SendData(2005, string.format("%s", lWeaponPanelDisplays.RIGHT_screen))
|
||||
end
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2004, "-")
|
||||
ExportScript.Tools.SendData(2005, "-")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- UHF Radio
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(31)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC("2000", string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('UHF_Freq: '..ExportScript.Tools.dump(list_indication(5)))
|
||||
|
||||
local lUHFRadioFreq = ExportScript.Tools.getListIndicatorValue(5)
|
||||
|
||||
if lUHFRadioFreq ~= nil and lUHFRadioFreq.UHF_Freq ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%s", lUHFRadioFreq.UHF_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2000", "-")
|
||||
end
|
||||
|
||||
-- AM Radio
|
||||
---------------------------------------------------
|
||||
local lAMRadio = GetDevice(5)
|
||||
if lAMRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC("2001", string.format("%.3f", lAMRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2001", ExportScript.Tools.RoundFreqeuncy(lAMRadio:get_frequency()/1000000))
|
||||
end
|
||||
|
||||
-- FM Radio PR4G
|
||||
---------------------------------------------------
|
||||
local lFMRadio = GetDevice(28)
|
||||
if lFMRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC(2002, string.format("%.3f", lFMRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('FM_Freq: '..ExportScript.Tools.dump(list_indication(4)))
|
||||
|
||||
local lFMRadioFreq = ExportScript.Tools.getListIndicatorValue(4)
|
||||
|
||||
if lFMRadioFreq ~= nil and lFMRadioFreq.FM_Freq ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2002", string.format("%s", lFMRadioFreq.FM_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2002", "-")
|
||||
end
|
||||
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
-- [273] = "%.1f", -- FM RADIO - Chanel Selector {0.0,0.2,0.3,0.5,0.6,0.8,0.9,1.1} -- gerundet
|
||||
local lFM_RADIO_PRESET = {[0.0]="1",[0.2]="2",[0.3]="3",[0.5]="4",[0.6]="5",[0.8]="6",[0.9]="0",[1.1]="R"}
|
||||
ExportScript.Tools.SendDataDAC("2003", lFM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(273), 1, "ceil")])
|
||||
|
||||
-- Weapon Panel
|
||||
---------------------------------------------------
|
||||
if mainPanelDevice:get_argument_value(354) >= 0.0 then -- Weapon panel is On
|
||||
local lWeaponPanelDisplays = ExportScript.Tools.getListIndicatorValue(8)
|
||||
|
||||
if lWeaponPanelDisplays ~= nil then
|
||||
if lWeaponPanelDisplays.LEFT_screen ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2004", string.format("%s", lWeaponPanelDisplays.LEFT_screen))
|
||||
end
|
||||
if lWeaponPanelDisplays.RIGHT_screen ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2005", string.format("%s", lWeaponPanelDisplays.RIGHT_screen))
|
||||
end
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2004", "-")
|
||||
ExportScript.Tools.SendDataDAC("2005", "-")
|
||||
end
|
||||
|
||||
-- generic Radio display and frequency rotarys
|
||||
-------------------------------------------------
|
||||
-- genericRadioConf
|
||||
ExportScript.genericRadioConf = {}
|
||||
ExportScript.genericRadioConf['maxRadios'] = 3 -- numbers of aviables/supported radios
|
||||
ExportScript.genericRadioConf[1] = {} -- first radio
|
||||
ExportScript.genericRadioConf[1]['Name'] = "UHF Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[1]['DeviceID'] = 31 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[1]['minFrequency'] = 225.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[1]['maxFrequency'] = 399.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[1]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3011 -- volume button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active
|
||||
--ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 161 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20",[1.00]="01"}
|
||||
--ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.05 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 170 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3010 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
-- Load Button = VLD Button
|
||||
ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset
|
||||
ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3003 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 167 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[2] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[2]['Name'] = "AM Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[2]['DeviceID'] = 5 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[2]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[2]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[2]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[2]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[2]['minFrequency'] = 118.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[2]['maxFrequency'] = 143.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[2]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[2]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOn'] = 0.33 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[2]['Volume']['ButtonID'] = 3005 -- volume button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset'] = {} -- preset knob active
|
||||
--ExportScript.genericRadioConf[2]['Preset']['ArgumentID'] = 137 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset']['List'] = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="01"}
|
||||
--ExportScript.genericRadioConf[2]['Preset']['Step'] = 0.01 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[2]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ArgumentID'] = 134 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[2]['Load']['ButtonID'] = 3006 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ArgumentID'] = 135 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[3] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[3]['Name'] = "FM Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[3]['DeviceID'] = 28 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[3]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[3]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[3]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[3]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[3]['minFrequency'] = 30.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[3]['maxFrequency'] = 87.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[3]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[3]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOn'] = 0.25 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[3]['Volume']['ButtonID'] = 3005 -- volume button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Preset'] = {} -- preset knob active
|
||||
ExportScript.genericRadioConf[3]['Preset']['ArgumentID'] = 273 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Preset']['ButtonID'] = 3002 -- preset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Preset']['ButtonID2'] = 3002 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
ExportScript.genericRadioConf[3]['Preset']['List'] = {[0.0]="1",[0.143]="2",[0.286]="3",[0.429]="4",[0.572]="5",[0.715]="6",[0.858]="0",[1.0]="-"}
|
||||
ExportScript.genericRadioConf[3]['Preset']['Step'] = 0.143 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[3]['Preset']['Step2'] = -0.01 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[3]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ArgumentID'] = 148 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ValueOff'] = -1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[3]['Load']['ButtonID'] = 3004 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ArgumentID'] = 149 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadio(nil, nil)
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,718 @@
|
||||
-- SA342Mistral
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.SA342Mistral = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Gyro Panel
|
||||
[200] = "%.4f", -- Gyro_Needle_State {-1,1} Gyro Panel SYNC
|
||||
[201] = "%.f", -- Gyro_voyant_test Lamp {0,1}
|
||||
[202] = "%.f", -- Gyro_voyant_trim Lamp {0,1}
|
||||
[203] = "%.f", -- Gyro_voyant_bpp Lamp {0,1}
|
||||
-- Autopilot Panel
|
||||
[37] = "%.4f", -- T_Needle_State {-1,1} Pitch correction Indicator
|
||||
[38] = "%.4f", -- R_Needle_State {-1,1} Roll correction Indicator
|
||||
[39] = "%.4f", -- L_Needle_State {-1,1} Yaw correction Indicator
|
||||
--[196] = "%.4f", -- RWR_light {0,1} -- RWR background light
|
||||
--[] = "%.4f", -- PE_fondbright {0,1} ???
|
||||
--[353] = "%.4f", -- NADIR_fondbright {0,1} ???
|
||||
-- Flare Dispenser Lamps
|
||||
[233] = "%.f", -- Voyant_FD_On {0,1} Power On
|
||||
[231] = "%.f", -- Voyant_FD_G {0,1} select Left
|
||||
[232] = "%.f", -- Voyant_FD_D {0,1} select Right
|
||||
[227] = "%.f", -- Voyant_FD_LEU {0,1} Status LEU
|
||||
[223] = "%.f", -- Voyant_FD_G_vide1 {0,1} Status Left G
|
||||
[224] = "%.f", -- Voyant_FD_G_vide2 {0,1} Status Left VIDE
|
||||
[225] = "%.f", -- Voyant_FD_D_vide1 {0,1} Status Right G
|
||||
[226] = "%.f", -- Voyant_FD_D_vide2 {0,1} Status Right VIDE
|
||||
-- ADF Radio
|
||||
[158] = "%0.1f", -- ADF_nav1_centaine {0,1} X00.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[159] = "%0.1f", -- ADF_nav1_dizaine {0,1} 0X0.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[160] = "%0.1f", -- ADF_nav1_unite {0,1} 00X.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[161] = "%0.1f", -- ADF_nav1_dec {0,1} 000.X khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[162] = "%0.1f", -- ADF_nav2_centaine {0,1} X00.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[163] = "%0.1f", -- ADF_nav2_dizaine {0,1} 0X0.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[164] = "%0.1f", -- ADF_nav2_unite {0,1} 00X.0 khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[165] = "%0.1f", -- ADF_nav2_dec {0,1} 000.X khz {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- ADF Gauge
|
||||
[113] = "%.4f", -- ADF_Fond Compass rose {0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360}{0.0,0.028,0.055,0.084,0.111,0.138,0.166,0.194,0.222,0.249,0.2775,0.305,0.332,0.36,0.388,0.415,0.4434,0.47,0.498,0.526,0.555,0.583,0.611,0.638,0.6665,0.694,0.722,0.75,0.776,0.805,0.833,0.861,0.8885,0.917,0.944,0.972,1.0}
|
||||
[102] = "%.4f", -- ADF_Aiguille_large Heading Needle large {-360.0,0.0,360.0}{-1.0,0.0,1.0}
|
||||
[103] = "%.4f", -- ADF_Aiguille_fine Heading Needle fine {-360.0,0.0,360.0}{-1.0,0.0,1.0}
|
||||
[107] = "%.1f", -- ADF_FlagCAP {0,1}
|
||||
[109] = "%.1f", -- ADF_FlagBut {0,1}
|
||||
[108] = "%.1f", -- ADF_FlagCompteur PX Flag {0,1}
|
||||
[110] = "%0.1f", -- ADF_compteur_Cent {0,1} X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[111] = "%0.1f", -- ADF_compteur_Dix {0,1} 0X0 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[112] = "%0.1f", -- ADF_compteur_Unit {0,1} 00X {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- CLOCK
|
||||
[41] = "%.3f", -- CLOCK_HOUR {0,1,2,3,4,5,6,7,8,9,10,11,12}{0,0.081,0.162,0.245,0.33,0.415,0.501,0.587,0.672,0.756,0.838,0.919,1}
|
||||
[42] = "%.3f", -- CLOCK_MINUTE {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60}{0,0.017,0.033,0.049,0.065,0.08,0.098,0.115,0.131,0.147,0.163,0.18,0.195,0.213,0.23,0.246,0.262,0.279,0.296,0.313,0.33,0.346,0.363,0.38,0.397,0.415,0.431,0.449,0.466,0.483,0.501,0.518,0.535,0.552,0.569,0.586,0.604,0.621,0.638,0.655,0.672,0.688,0.705,0.722,0.739,0.755,0.771,0.788,0.804,0.821,0.838,0.853,0.87,0.885,0.902,0.919,0.934,0.95,0.967,0.984,1}
|
||||
[43] = "%.3f", -- CLOCK_SECOND {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60}{0,0.017,0.033,0.049,0.065,0.08,0.098,0.115,0.131,0.147,0.163,0.18,0.195,0.213,0.23,0.246,0.262,0.279,0.296,0.313,0.33,0.346,0.363,0.38,0.397,0.415,0.431,0.449,0.466,0.483,0.501,0.518,0.535,0.552,0.569,0.586,0.604,0.621,0.638,0.655,0.672,0.688,0.705,0.722,0.739,0.755,0.771,0.788,0.804,0.821,0.838,0.853,0.87,0.885,0.902,0.919,0.934,0.95,0.967,0.984,1}
|
||||
[44] = "%.3f", -- CLOCK_MINI {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}{0,0.032,0.065,0.098,0.131,0.164,0.198,0.231,0.264,0.297,0.331,0.364,0.397,0.43,0.464,0.497,0.523,0.551,0.576,0.605,0.63,0.659,0.684,0.714,0.758,0.796,0.838,0.879,0.92,0.958,1}
|
||||
-- Wipers
|
||||
--[547] = "%.4f", -- EGPilote {-1,1}
|
||||
--[546] = "%.4f", -- EGCopilote {-1,1}
|
||||
-- LIGHTS
|
||||
--[40] = "%.4f", -- Lum_Plafond {0,1} Main Panel Lights
|
||||
--[142] = "%.4f", -- PBOIntensity {0,1} Main Panel Background lights
|
||||
--[144] = "%.4f", -- PUPIntensity {0,1} Lower Panel Background lights
|
||||
-- Baro altimetre
|
||||
[87] = "%.4f", -- Baro_Altimeter_thousands Needle {0.0,1.0}
|
||||
[573] = "%.4f", -- Baro_Altimeter_hundred Needle {0.0,1.0}
|
||||
[88] = "%0.1f", -- Baro_Altimeter_press_unite 000X {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[90] = "%0.1f", -- Baro_Altimeter_press_dix 00X0 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[92] = "%0.1f", -- Baro_Altimeter_press_cent 0X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[95] = "%0.1f", -- Baro_Altimeter_press_mille X000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
-- radar altimetre
|
||||
[94] = "%.4f", -- Radar_Altimeter {0,5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850}{0,0.019,0.035,0.072,0.109,0.147,0.18,0.214,0.247,0.283,0.316,0.345,0.376,0.407,0.438,0.469,0.501,0.564,0.606,0.648,0.676,0.706,0.732,0.756,0.775,0.794,0.811,0.829,0.843,0.858,0.87}
|
||||
[93] = "%.4f", -- DangerRALT_index {0,5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850}{0.0,0.0175,0.0338,0.0715,0.109,0.147,0.182,0.215,0.247,0.282,0.315,0.3445,0.377,0.407,0.439,0.47,0.5005,0.5628,0.6052,0.646,0.675,0.7058,0.7315,0.755,0.7747,0.793,0.8097,0.8272,0.8425,0.8575,0.8693}
|
||||
[97] = "%.f", -- RAltlamp {0,1}
|
||||
[98] = "%.f", -- RAlt_flag_Panne OFF Flag{0,1}
|
||||
[99] = "%.1f", -- RAlt_flag_MA A (Test) Flag{0,1}
|
||||
[91] = "%.1f", -- RAlt_knob_MA Power/Test Knop{0,1}
|
||||
-- TORQUE
|
||||
[16] = "%.3f", -- Torque {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110}{0.085,0.13,0.172,0.214,0.253,0.289,0.326,0.362,0.395,0.43,0.466,0.501,0.537,0.573,0.607,0.639,0.676,0.71,0.746,0.785,0.826,0.865,0.908}
|
||||
[55] = "%.3f", -- Torque_Bug {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110}{0.084,0.128,0.171,0.2134,0.252,0.2889,0.325,0.361,0.396,0.431,0.467,0.501,0.535,0.571,0.605,0.639,0.674,0.71,0.745,0.785,0.825,0.865,0.91}
|
||||
[17] = "%.f", -- VOYANT_TORQUE Lamp {0,1}
|
||||
-- Gyro_Compas
|
||||
[26] = "%.3f", -- Gyro_Compas {0,30,60,90,120,150,180,210,240,270,300,330,360}{0,0.083,0.167,0.251,0.334,0.418,0.5,0.583,0.667,0.751,0.832,0.917,1}
|
||||
-- Stby HA ADI
|
||||
[214] = "%.4f", -- StbyHA_Roll {-180,-90,-60,-30,-20,-10,0,10,20,30,60,90,180}{-1,-0.502,-0.335,-0.166,-0.11,-0.052,0,0.055,0.113,0.171,0.334,0.502,1}
|
||||
[213] = "%.4f", -- StbyHA_Pitch {-180,-150,-120,-90,-60,-50,-40,-30,-20,-15,-10,-5,0,5,10,15,20,30,40,50,60,90,120,150,180}{-1,-0.833,-0.667,-0.5,-0.333,-0.278,-0.223,-0.167,-0.111,-0.084,-0.057,-0.003,0,0.028,0.056,0.083,0.111,0.167,0.223,0.278,0.333,0.5,0.667,0.833,1}
|
||||
[211] = "%.1f", -- StdbyHA_Flag Fault Flag {0,1}
|
||||
[212] = "%.4f", -- Stdby_HA_W W Sympol {0,1}
|
||||
[217] = "%.4f", -- Stdby_HA_Curseur Knob Needle {0,1}
|
||||
-- QComb Fuel Indicator
|
||||
[137] = "%.3f", -- QComb {0,50,100,150,200,250,300,350,400,500}{0.093,0.243,0.354,0.428,0.521,0.621,0.692,0.771,0.834,0.932}
|
||||
-- Horizon Artificiel Principal
|
||||
[27] = "%.4f", -- Pitch_HA {-180,-170,-160,-150,-140,-130,-120,-110,-100,-90,-80,-70,-60,-50,-40,-30,-20,-10,0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180}{-1,-0.946,-0.898,-0.838,-0.78,-0.723,-0.667,-0.61,-0.556,-0.501,-0.446,-0.393,-0.334,-0.277,-0.223,-0.166,-0.104,-0.054,0,0.054,0.102,0.161,0.22,0.277,0.333,0.389,0.443,0.498,0.553,0.607,0.666,0.722,0.776,0.834,0.896,0.946,1}
|
||||
[28] = "%.4f", -- Roll_HA {-180,-90,-60,-30,-20,-10,0,10,20,30,60,90,180}{-1,-0.498,-0.331,-0.162,-0.111,-0.053,0,0.058,0.112,0.168,0.331,0.498,1}
|
||||
[20] = "%.4f", -- Bille_HA Slip Ball {-1,1}
|
||||
[18] = "%.1f", -- flag_GS_HA GS Flag {0,1}
|
||||
[19] = "%.1f", -- flag_HS_HA Fault Flag {0,1}
|
||||
[29] = "%.1f", -- flag_Lock_HA Lock Flag {0,1}
|
||||
[117] = "%.4f", -- Curseur_HA Knob Needle {0,1}
|
||||
[120] = "%.4f", -- W_HA W Sympol {-1,1}
|
||||
[118] = "%.4f", -- VerBar_HA Vertical Bar {-1,1}
|
||||
[119] = "%.4f", -- HorBar_HA Horizon Bar {-1,1}
|
||||
-- variometre
|
||||
[24] = "%.4f", -- Variometre {-800,-700,-600,-500,-400,-300,-200,-100,-50,0,50,100,200,300,400,500,600,700,800}{-0.481,-0.436,-0.391,-0.338,-0.28,-0.218,-0.153,-0.075,-0.035,0.0,0.035,0.071,0.139,0.202,0.264,0.32,0.372,0.418,0.463}
|
||||
-- IAS
|
||||
[51] = "%.4f", -- IAS {0,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370}{0,0.1,0.133,0.172,0.207,0.243,0.277,0.316,0.35,0.38,0.41,0.439,0.465,0.491,0.517,0.541,0.565,0.587,0.611,0.63,0.651,0.671,0.692,0.712,0.731,0.75,0.77,0.791,0.809,0.829,0.849,0.867,0.886}
|
||||
-- RPM
|
||||
[135] = "%.4f", -- Turbine_RPM large Needle {0,5000,10000,15000,20000,25000,29000,35000,40000,43500,45000,50000}{0.095,0.181,0.263,0.346,0.424,0.505,0.572,0.665,0.748,0.802,0.828,0.909}
|
||||
[52] = "%.4f", -- Rotor_RPM small Needle {0,50,100,150,200,250,262,316.29,361.05,387,400,450}{0.096,0.191,0.283,0.374,0.461,0.549,0.57,0.665,0.748,0.802,0.811,0.904}
|
||||
-- Voltmetre
|
||||
[14] = "%.3f", -- Voltmetre {0,5,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}{0.045,0.074,0.103,0.133,0.163,0.192,0.221,0.25,0.281,0.31,0.339,0.368,0.399,0.429,0.458,0.488,0.518,0.547,0.576,0.605,0.635,0.664,0.695,0.724}
|
||||
-- TQuatre Engine temperature Indicator
|
||||
[15] = "%.3f", -- TQuatre Engine Temp {0,100,200,300,400,500,600,700,800}{0.1575,0.228,0.3,0.3845,0.473,0.577,0.676,0.772,0.8625}
|
||||
-- TempExt outside temperature
|
||||
[25] = "%.3f", -- TempExt {-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70}{-0.758,-0.691,-0.625,-0.558,-0.492,-0.425,-0.359,-0.292,-0.224,-0.158,-0.09,-0.024,0.043,0.11,0.177,0.244,0.31,0.379,0.445,0.512,0.579,0.644,0.712}
|
||||
-- TempThm Oil Temperature Indicator
|
||||
[151] = "%.3f", -- TempThm Oil Temp {-20,-10,0,10,20,30,40,50,60,70,80,85,90,100}{0.046,0.102,0.157,0.213,0.268,0.323,0.38,0.435,0.492,0.547,0.603,0.63,0.659,0.715}
|
||||
-- Fuel Tank Indicator
|
||||
[152] = "%.3f", -- Gauge_RSupp {-1,0,0.25,0.5,0.75,1}{0,0.202,0.426,0.63,0.801,1}
|
||||
-- VHF AM Radio
|
||||
[133] = "%.1f", -- AM_Radio_freq_cent {0,1} X00.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[134] = "%.1f", -- AM_Radio_freq_dix {0,1} 0X0.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[136] = "%.1f", -- AM_Radio_freq_unite {0,1} 00X.000 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[138] = "%.1f", -- AM_Radio_freq_dixieme {0,1} 000.X00 {0,1,2,3,4,5,6,7,8,9,0}{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}
|
||||
[139] = "%.2f", -- AM_Radio_freq_centieme {0,1} 000.0XX {00,25,50,75,00}{0.0,0.25,0.50,0.75,1.0}
|
||||
-- Lamps
|
||||
-- Voyant_DEM
|
||||
[300] = "%.f", -- Voyant_DEM Start lamp{0,1}
|
||||
-- Voyant_RLT
|
||||
[301] = "%.f", -- Voyant_RLT Idle lamp {0,1}
|
||||
-- Voyant_BLOC
|
||||
[302] = "%.f", -- Voyant_BLOC Blocked Engine lamp {0,1}
|
||||
-- RSUPP Fueltank
|
||||
[320] = "%.f", -- Voyant_RSupp Fueltank lamp {0,1}
|
||||
-- RCONV Convoy Fueltank
|
||||
[321] = "%.f", -- Voyant_RConv Convoy Fueltank lamüp {0,1}
|
||||
-- Voyant_FILTAS Sandfilter lamp
|
||||
[322] = "%.f", -- Voyant_FILTAS sandfilter lamp {0,1}
|
||||
-- Voyant_Alarme Master Alarme lamp
|
||||
[303] = "%.f", -- Voyant_Alarme Master Alarme lamp {0,1}
|
||||
-- AM_RADIO
|
||||
[141] = "%.f", -- AM_Radio_lamp {0,1}
|
||||
-- Tableau Alarme Lamps
|
||||
[1] = "%.f", -- TA_Pitot {0,1}
|
||||
[2] = "%.f", -- TA_Hmot {0,1}
|
||||
[3] = "%.f", -- TA_Hbtp {0,1}
|
||||
[4] = "%.f", -- TA_Hral {0,1}
|
||||
[5] = "%.f", -- TA_Gene {0,1}
|
||||
[6] = "%.f", -- TA_Alter {0,1}
|
||||
[7] = "%.f", -- TA_Bat {0,1}
|
||||
[8] = "%.f", -- TA_PA {0,1}
|
||||
[9] = "%.f", -- TA_Nav {0,1}
|
||||
[10] = "%.f", -- TA_Comb {0,1}
|
||||
[11] = "%.f", -- TA_Bphy {0,1}
|
||||
[12] = "%.f", -- TA_Lim {0,1}
|
||||
[13] = "%.f", -- TA_Filt {0,1}
|
||||
-- Intercomp Lamps
|
||||
[455] = "%.f", -- VHF Light
|
||||
[456] = "%.f", -- FM1 Light
|
||||
[457] = "%.f", -- UHF Light
|
||||
}
|
||||
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- WEAPONS PANEL 1
|
||||
[354] = "%1d", -- WP1 - Off/On/Stsnfby {-1.0,0.0,1.0}
|
||||
[357] = "%.4f", -- WP1 - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- WEAPONS PANEL 2
|
||||
[372] = "%1d", -- WP2 - Ma Left
|
||||
[373] = "%1d", -- WP2 - Ma Left Cover
|
||||
[374] = "%1d", -- WP2 - Ma Right
|
||||
[375] = "%1d", -- WP2 - Ma Right Cover
|
||||
[376] = "%1d", -- WP2 - Seq Ripple selection
|
||||
-- PILOTSIGHT
|
||||
[171] = "%1d", -- PILOTSIGHT - Pilot Sight
|
||||
-- PILOT STICK
|
||||
--[50] = "%1d", -- PILOT STICK - Magnetic Brake
|
||||
--[53] = "%1d", -- PILOT STICK - Wiper once
|
||||
--[209] = "%1d", -- PILOT STICK - Autopilot Button
|
||||
--[293] = "%1d", -- PILOT STICK - Slave
|
||||
--[294] = "%1d", -- PILOT STICK - Auto-Hover
|
||||
-- WSO LEFT SIDE STICK
|
||||
[255] = "%1d", -- PE WSO STICK - Lasing Button Cover
|
||||
[256] = "%1d", -- PE WSO STICK - Lasing Button
|
||||
[257] = "%1d", -- PE WSO STICK - Missile Launch Cover
|
||||
[258] = "%1d", -- PE WSO STICK - Missile Launch Button
|
||||
[259] = "%1d", -- PE WSO STICK - Inversed Symbology Toggle
|
||||
[260] = "%1d", -- PE WSO STICK - Inversed Image Toggle
|
||||
[264] = "%.1f", -- PE WSO STICK - Image Focus {-1.0,1.0}
|
||||
[262] = "%.1f", -- PE WSO STICK - Gain {-1.0,1.0}
|
||||
[263] = "%.1f", -- PE WSO STICK - Image Brightness {-1.0,1.0}
|
||||
[219] = "%.1f", -- PE WSO STICK - Symbology Brightness {-1.0,1.0}
|
||||
-- GYRO
|
||||
[197] = "%1d", -- GYRO - Test Cover
|
||||
[198] = "%1d", -- GYRO - Test Switch On/Off
|
||||
[199] = "%1d", -- GYRO - Left/Center/Right
|
||||
[153] = "%.2f", -- GYRO - CM/A/GM/D/GD {0.0,0.25,0.50,0.75,1.0}
|
||||
-- CLOCK
|
||||
[45] = "%.4f", -- CLOCK - Winder (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[46] = "%1d", -- CLOCK - Start/Stop
|
||||
[47] = "%1d", -- CLOCK - Reset
|
||||
-- SA342M HOT3 only
|
||||
-- PH SA342M HOT3
|
||||
[180] = "%.2f", -- PH - Test/On/Off {0.0,0.25,0.50,0.75,1.0}
|
||||
[181] = "%.3f", -- PH - Station Select {0.0,0.125,0.250,0,375,0.500,0.625,0.750,0.875,1.0}
|
||||
[182] = "%.4f", -- PH - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- PE SA342L/M/Mistral BCV (BOITIER DE COMMANDE VIDEO – video command box)
|
||||
[362] = "%1d", -- PE BCV - Centering
|
||||
[364] = "%1d", -- PE BCV - VDO/VTH
|
||||
[365] = "%.1f", -- PE BCV - Zoom {-1.0,1.0}
|
||||
[366] = "%.1f", -- PE BCV - CTH A/V/M {0.0,0.5,1.0}
|
||||
[367] = "%1d", -- PE BCV - Power
|
||||
[370] = "%.2f", -- PE BCV - Mode A/C/V/PIL/ASS {0.0,0.25,0.50,0.75,1.0}
|
||||
-- NADIR
|
||||
[330] = "%.4f", -- NADIR - Off/Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[331] = "%.2f", -- NADIR - Mode Off/Stby/Ground/Sea/Air Speed Sensor/Ground Test {0.0,0.2,0.4,0.6,0.8,1.0}
|
||||
[332] = "%.2f", -- NADIR - Parameter Wind/Magnetic Heading/Ground Speed/Calculated Time/Current Position/Waypoint {0.0,0.2,0.4,0.6,0.8,1.0}
|
||||
[333] = "%1d", -- NADIR - ENT
|
||||
[334] = "%1d", -- NADIR - DES
|
||||
[335] = "%1d", -- NADIR - AUX
|
||||
[336] = "%1d", -- NADIR - IC
|
||||
[337] = "%1d", -- NADIR - DOWN
|
||||
[351] = "%1d", -- NADIR - 0
|
||||
[338] = "%1d", -- NADIR - 1
|
||||
[339] = "%1d", -- NADIR - 2
|
||||
[340] = "%1d", -- NADIR - 3
|
||||
[342] = "%1d", -- NADIR - 4
|
||||
[343] = "%1d", -- NADIR - 5
|
||||
[344] = "%1d", -- NADIR - 6
|
||||
[346] = "%1d", -- NADIR - 7
|
||||
[347] = "%1d", -- NADIR - 8
|
||||
[348] = "%1d", -- NADIR - 9
|
||||
[341] = "%1d", -- NADIR - POL
|
||||
[345] = "%1d", -- NADIR - GEO
|
||||
[349] = "%1d", -- NADIR - POS
|
||||
[350] = "%1d", -- NADIR - GEL
|
||||
[352] = "%1d", -- NADIR - EFF
|
||||
-- AM_RADIO
|
||||
[128] = "%.2f", -- AM RADIO - Selector {0.0,0.33,0.66,0.99}
|
||||
[129] = "%.4f", -- AM RADIO - Freq decimals (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[130] = "%1d", -- AM RADIO - 25/50kHz Selector
|
||||
[131] = "%.4f", -- AM RADIO - Freq dial (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FM_RADIO
|
||||
[272] = "%.2f", -- FM RADIO - Main Selector {0.0,0.25,0.50,0.75,1.0}
|
||||
[273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0}
|
||||
[274] = "%1d", -- FM RADIO - 7
|
||||
[275] = "%1d", -- FM RADIO - 8
|
||||
[276] = "%1d", -- FM RADIO - 9
|
||||
[277] = "%1d", -- FM RADIO - 0
|
||||
[278] = "%1d", -- FM RADIO - X
|
||||
[279] = "%1d", -- FM RADIO - 4
|
||||
[280] = "%1d", -- FM RADIO - 5
|
||||
[281] = "%1d", -- FM RADIO - 6
|
||||
[282] = "%1d", -- FM RADIO - RC
|
||||
[283] = "%1d", -- FM RADIO - UP
|
||||
[284] = "%1d", -- FM RADIO - 1
|
||||
[285] = "%1d", -- FM RADIO - 2
|
||||
[286] = "%1d", -- FM RADIO - 3
|
||||
[287] = "%1d", -- FM RADIO - VAL
|
||||
[288] = "%1d", -- FM RADIO - DOWN
|
||||
-- TV
|
||||
[124] = "%1d", -- TV - On/Off
|
||||
[125] = "%.4f", -- TV - Contrast (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[123] = "%.4f", -- TV - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
--[126] = "%.4f", -- TV - Cover (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- RWR
|
||||
[148] = "%1d", -- RWR - Off/On/Croc {-1.0,0.0,1.0}
|
||||
[149] = "%1d", -- RWR - Marker
|
||||
[150] = "%1d", -- RWR - Page
|
||||
[121] = "%.4f", -- RWR - Audio (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[122] = "%.4f", -- RWR - Brightness (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- ADI
|
||||
[115] = "%.4f", -- ADI - Unlock (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[116] = "%1d", -- ADI - Unlock
|
||||
-- Stby ADI
|
||||
[215] = "%.4f", -- STDBY ADI - Unlock (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[216] = "%1d", -- STDBY ADI - Unlock
|
||||
-- ArtVisVhfDop (Source selector for main artificial horizon vertical bar)
|
||||
[218] = "%.2f", -- ADI - Source Off/Camera target point/ADF ermitter/NADIR Waypoint {0.0,0.33,0.66,0.99}
|
||||
-- INTERCOM
|
||||
[452] = "%1d", -- INTERCOM - VHF AM Radio
|
||||
[68] = "%.4f", -- INTERCOM - VHF AM Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[453] = "%1d", -- INTERCOM - FM Radio
|
||||
[69] = "%.4f", -- INTERCOM - FM Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[454] = "%1d", -- INTERCOM - UHF Radio
|
||||
[70] = "%.4f", -- INTERCOM - UHF Radio Volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- TORQUE
|
||||
[58] = "%1d", -- TORQUE Bug/Test
|
||||
[54] = "%.4f", -- TORQUE Bug/Test (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- LIGHTS
|
||||
[22] = "%.4f", -- LIGHTS - Main Dashboard Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[21] = "%.4f", -- LIGHTS - Console Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[145] = "%.4f", -- LIGHTS - UV Lighting (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[23] = "%1d", -- LIGHTS - NORM/BNL
|
||||
[147] = "%.4f", -- LIGHTS - Roof Lamp Knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[154] = "%1d", -- LIGHTS - Red Lens On/Off
|
||||
-- ELECTRIC
|
||||
[264] = "%1d", -- ELECTRIC - Battery
|
||||
[265] = "%1d", -- ELECTRIC - Alternator
|
||||
[268] = "%1d", -- ELECTRIC - Generator
|
||||
[62] = "%1d", -- ELECTRIC - Voltmeter Test
|
||||
[170] = "%1d", -- ELECTRIC - Pitot
|
||||
[271] = "%1d", -- ELECTRIC - Fuel Pump
|
||||
[267] = "%1d", -- ELECTRIC - Additionnal Fuel Tank
|
||||
[56] = "%1d", -- ELECTRIC - Starter Start/Stop/Air {-1.0,0.0,1.0}
|
||||
[57] = "%1d", -- ELECTRIC - Test
|
||||
[48] = "%1d", -- ELECTRIC - Copilot Wiper {-1.0,0.0,1.0}
|
||||
[49] = "%1d", -- ELECTRIC - Pilot Wiper {-1.0,0.0,1.0}
|
||||
[61] = "%1d", -- ELECTRIC - Left from Pitot
|
||||
[59] = "%1d", -- ELECTRIC - HYD Test
|
||||
[66] = "%1d", -- ELECTRIC - Alter Rearm
|
||||
[67] = "%1d", -- ELECTRIC - Gene Rearm
|
||||
[63] = "%1d", -- ELECTRIC - Convoy Tank On/Off
|
||||
[64] = "%1d", -- ELECTRIC - Sand Filter On/Off
|
||||
-- NAVLIGHTS
|
||||
[146] = "%1d", -- NAVLIGHTS - Navigation Lights CLI/OFF/FIX {-1.0,0.0,1.0}
|
||||
[228] = "%1d", -- NAVLIGHTS - Anticollision Light NOR/OFF/ATT {-1.0,0.0,1.0}
|
||||
[105] = "%1d", -- NAVLIGHTS - Landing Light Off/Vario/On {-1.0,0.0,1.0}
|
||||
[106] = "%1d", -- NAVLIGHTS - Landing Light Extend/Retract
|
||||
[382] = "%1d", -- NAVLIGHTS - Panels Lighting On/Off
|
||||
[30] = "%.4f", -- NAVLIGHTS - AntiCollision Light Intensity (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[229] = "%1d", -- NAVLIGHTS - Formation Lights On/Off
|
||||
[230] = "%.4f", -- NAVLIGHTS - Formation Lights Intensity (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FLARE DISPENSER
|
||||
[220] = "%1d", -- FLARE DISPENSER - G/G+D/D {-1.0,0.0,1.0}
|
||||
[221] = "%1d", -- FLARE DISPENSER - Mode
|
||||
[222] = "%1d", -- FLARE DISPENSER - Off/Speed {-1.0,0.0,1.0}
|
||||
[194] = "%1d", -- FLARE DISPENSER - Fire Button Cover
|
||||
[195] = "%1d", -- FLARE DISPENSER - Fire Button
|
||||
-- AUTOPILOT
|
||||
[31] = "%1d", -- AUTOPILOT - Autopilot On/Off
|
||||
[32] = "%1d", -- AUTOPILOT - Pitch On/Off
|
||||
[33] = "%1d", -- AUTOPILOT - Roll On/Off
|
||||
[34] = "%1d", -- AUTOPILOT - Yaw On/Off
|
||||
[35] = "%1d", -- AUTOPILOT - Mode Speed/OFF/Altitude {-1.0,0.0,1.0}
|
||||
[60] = "%1d", -- AUTOPILOT - Trim On/Off
|
||||
[65] = "%1d", -- AUTOPILOT - Magnetic Brake On/Off
|
||||
-- WEAPONS
|
||||
[269] = "%1d", -- WEAPONS - Master arm On/Off
|
||||
-- ROTORS
|
||||
[556] = "%.4f", -- ROTORS - Rotor Brake (Axis) {0.0, 1.0} in 0.055 Steps
|
||||
-- RADIOALTIMETER
|
||||
[96] = "%.4f", -- RADIOALTIMETER - Radar Alt Bug (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[100] = "%1d", -- RADIOALTIMETER - Radar Alt On/Off - Test
|
||||
[91] = "%.4f", -- RADIOALTIMETER - Radar Alt On/Off - Test (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- BAROALTIMETER
|
||||
[89] = "%.4f", -- BAROALTIMETER - Baro pressure QFE knob (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- FUEL SYSTEM
|
||||
[557] = "%.4f", -- FUEL SYSTEM - Fuel Flow Lever (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- ADF RADIO
|
||||
[166] = "%1d", -- ADF RADIO - Select
|
||||
[167] = "%1d", -- ADF RADIO - Tone
|
||||
[178] = "%.2f", -- ADF RADIO - Mode {0.0,0.33,0.66,0.99}
|
||||
[179] = "%.4f", -- ADF RADIO - Gain (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[168] = "%.4f", -- ADF RADIO - Nav1 Hundred (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[169] = "%.4f", -- ADF RADIO - Nav1 Ten (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[173] = "%.4f", -- ADF RADIO - Nav1 Unit (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[174] = "%.4f", -- ADF RADIO - Nav2 Hundred (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[175] = "%.4f", -- ADF RADIO - Nav2 Ten (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[176] = "%.4f", -- ADF RADIO - Nav2 Unit (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
-- UHF RADIO
|
||||
[383] = "%.3f", -- UHF RADIO - MODE 0/FF/NA/SV/DL/G/EN {0.0,0.167,0.334,0.501,0.668,0.835,1.0}
|
||||
[384] = "%1d", -- UHF RADIO - DRW
|
||||
[385] = "%1d", -- UHF RADIO - VLD
|
||||
[386] = "%.4f", -- UHF RADIO - PAGE (Axis) {0.0, 1.0} in 0.2 Steps
|
||||
[387] = "%1d", -- UHF RADIO - CONF
|
||||
[388] = "%1d", -- UHF RADIO - 1
|
||||
[389] = "%1d", -- UHF RADIO - 2
|
||||
[390] = "%1d", -- UHF RADIO - 3
|
||||
[391] = "%1d", -- UHF RADIO - 4
|
||||
[392] = "%1d", -- UHF RADIO - 5
|
||||
[393] = "%1d", -- UHF RADIO - 6
|
||||
[394] = "%1d", -- UHF RADIO - 7
|
||||
[395] = "%1d", -- UHF RADIO - 8
|
||||
[396] = "%1d", -- UHF RADIO - 9
|
||||
[397] = "%1d" -- UHF RADIO - 0
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- UHF Radio
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(31)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2000, string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('UHF_Freq: '..ExportScript.Tools.dump(list_indication(5)))
|
||||
|
||||
local lUHFRadioFreq = ExportScript.Tools.getListIndicatorValue(5)
|
||||
|
||||
if lUHFRadioFreq ~= nil and lUHFRadioFreq.UHF_Freq ~= nil then
|
||||
ExportScript.Tools.SendData(2000, string.format("%s", lUHFRadioFreq.UHF_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2000, " ")
|
||||
end
|
||||
|
||||
-- AM Radio
|
||||
---------------------------------------------------
|
||||
local lAMRadio = GetDevice(5)
|
||||
if lAMRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2001, string.format("%.3f", lAMRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2001, ExportScript.Tools.RoundFreqeuncy(lAMRadio:get_frequency()/1000000))
|
||||
end
|
||||
|
||||
-- FM Radio PR4G
|
||||
---------------------------------------------------
|
||||
local lFMRadio = GetDevice(28)
|
||||
if lFMRadio:is_on() then
|
||||
--ExportScript.Tools.SendData(2002, string.format("%.3f", lFMRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('FM_Freq: '..ExportScript.Tools.dump(list_indication(4)))
|
||||
|
||||
local lFMRadioFreq = ExportScript.Tools.getListIndicatorValue(4)
|
||||
|
||||
if lFMRadioFreq ~= nil and lFMRadioFreq.FM_Freq ~= nil then
|
||||
ExportScript.Tools.SendData(2002, string.format("%s", lFMRadioFreq.FM_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2002, " ")
|
||||
end
|
||||
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
-- [273] = "%.1f", -- FM RADIO - Chanel Selector {0.0,0.2,0.3,0.5,0.6,0.8,0.9,1.1} -- gerundet
|
||||
local lFM_RADIO_PRESET = {[0.0]="1",[0.2]="2",[0.3]="3",[0.5]="4",[0.6]="5",[0.8]="6",[0.9]="0",[1.1]="R"}
|
||||
ExportScript.Tools.SendData(2003, lFM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(273), 1, "ceil")])
|
||||
|
||||
-- Weapon Panel
|
||||
---------------------------------------------------
|
||||
if mainPanelDevice:get_argument_value(354) >= 0.0 then -- Weapon panel is On
|
||||
local lWeaponPanelDisplays = ExportScript.Tools.getListIndicatorValue(8)
|
||||
|
||||
if lWeaponPanelDisplays ~= nil then
|
||||
if lWeaponPanelDisplays.LEFT_screen ~= nil then
|
||||
ExportScript.Tools.SendData(2004, string.format("%s", lWeaponPanelDisplays.LEFT_screen))
|
||||
end
|
||||
if lWeaponPanelDisplays.RIGHT_screen ~= nil then
|
||||
ExportScript.Tools.SendData(2005, string.format("%s", lWeaponPanelDisplays.RIGHT_screen))
|
||||
end
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendData(2004, "-")
|
||||
ExportScript.Tools.SendData(2005, "-")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- UHF Radio
|
||||
---------------------------------------------------
|
||||
local lUHFRadio = GetDevice(31)
|
||||
if lUHFRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC("2000", string.format("%.3f", lUHFRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('UHF_Freq: '..ExportScript.Tools.dump(list_indication(5)))
|
||||
|
||||
local lUHFRadioFreq = ExportScript.Tools.getListIndicatorValue(5)
|
||||
|
||||
if lUHFRadioFreq ~= nil and lUHFRadioFreq.UHF_Freq ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%s", lUHFRadioFreq.UHF_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2000", "-")
|
||||
end
|
||||
|
||||
-- AM Radio
|
||||
---------------------------------------------------
|
||||
local lAMRadio = GetDevice(5)
|
||||
if lAMRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC("2001", string.format("%.3f", lAMRadio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2001", ExportScript.Tools.RoundFreqeuncy(lAMRadio:get_frequency()/1000000))
|
||||
end
|
||||
|
||||
-- FM Radio PR4G
|
||||
---------------------------------------------------
|
||||
local lFMRadio = GetDevice(28)
|
||||
if lFMRadio:is_on() then
|
||||
--ExportScript.Tools.SendDataDAC(2002, string.format("%.3f", lFMRadio:get_frequency()/1000000))
|
||||
--ExportScript.Tools.WriteToLog('FM_Freq: '..ExportScript.Tools.dump(list_indication(4)))
|
||||
|
||||
local lFMRadioFreq = ExportScript.Tools.getListIndicatorValue(4)
|
||||
|
||||
if lFMRadioFreq ~= nil and lFMRadioFreq.FM_Freq ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2002", string.format("%s", lFMRadioFreq.FM_Freq))
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2002", "-")
|
||||
end
|
||||
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
-- [273] = "%.1f", -- FM RADIO - Chanel Selector {0.0,0.2,0.3,0.5,0.6,0.8,0.9,1.1} -- gerundet
|
||||
local lFM_RADIO_PRESET = {[0.0]="1",[0.2]="2",[0.3]="3",[0.5]="4",[0.6]="5",[0.8]="6",[0.9]="0",[1.1]="R"}
|
||||
ExportScript.Tools.SendDataDAC("2003", lFM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(273), 1, "ceil")])
|
||||
|
||||
-- Weapon Panel
|
||||
---------------------------------------------------
|
||||
if mainPanelDevice:get_argument_value(354) >= 0.0 then -- Weapon panel is On
|
||||
local lWeaponPanelDisplays = ExportScript.Tools.getListIndicatorValue(8)
|
||||
|
||||
if lWeaponPanelDisplays ~= nil then
|
||||
if lWeaponPanelDisplays.LEFT_screen ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2004", string.format("%s", lWeaponPanelDisplays.LEFT_screen))
|
||||
end
|
||||
if lWeaponPanelDisplays.RIGHT_screen ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("2005", string.format("%s", lWeaponPanelDisplays.RIGHT_screen))
|
||||
end
|
||||
end
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2004", "-")
|
||||
ExportScript.Tools.SendDataDAC("2005", "-")
|
||||
end
|
||||
|
||||
-- generic Radio display and frequency rotarys
|
||||
-------------------------------------------------
|
||||
-- genericRadioConf
|
||||
ExportScript.genericRadioConf = {}
|
||||
ExportScript.genericRadioConf['maxRadios'] = 3 -- numbers of aviables/supported radios
|
||||
ExportScript.genericRadioConf[1] = {} -- first radio
|
||||
ExportScript.genericRadioConf[1]['Name'] = "UHF Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[1]['DeviceID'] = 31 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[1]['minFrequency'] = 225.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[1]['maxFrequency'] = 399.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[1]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3011 -- volume button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active
|
||||
--ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 161 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
--ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20",[1.00]="01"}
|
||||
--ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.05 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 170 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3010 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
-- Load Button = VLD Button
|
||||
ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset
|
||||
ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3003 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 167 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[2] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[2]['Name'] = "AM Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[2]['DeviceID'] = 5 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[2]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[2]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[2]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[2]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[2]['minFrequency'] = 118.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[2]['maxFrequency'] = 143.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[2]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[2]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOn'] = 0.33 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[2]['Volume']['ButtonID'] = 3005 -- volume button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset'] = {} -- preset knob active
|
||||
--ExportScript.genericRadioConf[2]['Preset']['ArgumentID'] = 137 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
--ExportScript.genericRadioConf[2]['Preset']['List'] = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="01"}
|
||||
--ExportScript.genericRadioConf[2]['Preset']['Step'] = 0.01 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[2]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ArgumentID'] = 134 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[2]['Load']['ButtonID'] = 3006 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ArgumentID'] = 135 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[2]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[3] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[3]['Name'] = "FM Radio" -- name of radio
|
||||
ExportScript.genericRadioConf[3]['DeviceID'] = 28 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[3]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[3]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[3]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[3]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[3]['minFrequency'] = 30.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[3]['maxFrequency'] = 87.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[3]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[3]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOn'] = 0.25 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Volume'] = {} -- volume knob active
|
||||
--ExportScript.genericRadioConf[3]['Volume']['ButtonID'] = 3005 -- volume button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Preset'] = {} -- preset knob active
|
||||
ExportScript.genericRadioConf[3]['Preset']['ArgumentID'] = 273 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Preset']['ButtonID'] = 3002 -- preset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Preset']['ButtonID2'] = 3002 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
-- [273] = "%.3f", -- FM RADIO - Chanel Selector {0.0,0.143,0.286,0.429,0.572,0.715,0.858,1.0} -- laut clickabledata.lua
|
||||
ExportScript.genericRadioConf[3]['Preset']['List'] = {[0.0]="1",[0.143]="2",[0.286]="3",[0.429]="4",[0.572]="5",[0.715]="6",[0.858]="0",[1.0]="-"}
|
||||
ExportScript.genericRadioConf[3]['Preset']['Step'] = 0.143 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[3]['Preset']['Step2'] = -0.01 -- minimal step for preset change
|
||||
--ExportScript.genericRadioConf[3]['Squelch'] = {} -- squelch switch active
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ArgumentID'] = 148 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Squelch']['ValueOff'] = -1.0 -- squelch off value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['Load'] = {} -- load button preset
|
||||
--ExportScript.genericRadioConf[3]['Load']['ButtonID'] = 3004 -- load button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset'] = {} -- switch manual or preset active
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ArgumentID'] = 149 -- ManualPreset argument id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
--ExportScript.genericRadioConf[3]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadio(nil, nil)
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,268 @@
|
||||
-- Spitfire LFMk IX
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.SpitfireLFMkIX = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Flight Instruments
|
||||
[11] = "%.4f", -- OxygenDeliveryGauge {0.0, 0.4}{0.0, 4000.0}
|
||||
[12] = "%.4f", -- OxygenSupplyGauge
|
||||
[17] = "%.4f", -- TrimGauge {-1.0, 1.0}
|
||||
[18] = "%.4f", -- PneumaticPressureGauge {0.0, 1.0}{0.0, 600.0}
|
||||
[19] = "%.4f", -- Left wheel brake pressure gauge {0.0, 1.0}{0.0, 130.0}
|
||||
[20] = "%.4f", -- Right wheel brake pressure gauge {0.0, 1.0}{0.0, 130.0}
|
||||
[21] = "%.4f", -- Airspeed gauge {0.0, 0.5}{0.0, 500.0}
|
||||
[23] = "%.4f", -- Attitude Horizon Bank {-1.0, 1.0}
|
||||
[24] = "%.4f", -- Attitude Horizon Pitch {-1.0, 1.0}
|
||||
[25] = "%.4f", -- Variometer gauge {-1.0, 1.0}{-4000.0, 4000.0}
|
||||
[26] = "%.4f", -- Altimeter gauge Hundreds {0.0, 1.0}{0.0, 10.0}
|
||||
[27] = "%.4f", -- Altimeter gauge Thousands {0.0, 1.0}{0.0, 10.0}
|
||||
[28] = "%.4f", -- Altimeter gauge Tens Thousabds {0.0, 1.0}{0.0, 10.0}
|
||||
[29] = "%.4f", -- Altimeter gauge Pressure {0.0, 1.0}{800.0, 1050.0}
|
||||
[31] = "%.4f", -- DI gauge {0.0, 1.0}{0.0, 2.0 * 3.1415926}
|
||||
[33] = "%.4f", -- Sideslip gauge {-1.0, 1.0}
|
||||
[34] = "%.4f", -- Turn gauge {-1.0, 1.0}
|
||||
[35] = "%.4f", -- Voltmeter {0.0, 1.0}{0.0, 20.0}
|
||||
[37] = "%.4f", -- Tachometer {0.0, 0.5}{0.0, 5000.0}
|
||||
[39] = "%.4f", -- Boost gauge {0.0, 1.0}{-7.0, 24.0}
|
||||
[40] = "%.4f", -- Oil pressure gauge {0.0, 1.0}{0.0, 150.0}
|
||||
[41] = "%.4f", -- Oil temperature gauge {0.0, 1.0}{0.0, 100.0}
|
||||
[42] = "%.4f", -- Radiator temperature gauge {0.0, 0.7}{0.0, 140.0}
|
||||
[43] = "%.4f", -- Fuel contents gauge {0.0, 0.1, 1.0}{-1.0, 0.0, 37.0}
|
||||
[51] = "%.4f", -- Clock Hour
|
||||
[52] = "%.4f", -- Clock Minute
|
||||
[53] = "%.4f", -- Clock Second
|
||||
[71] = "%.4f", -- Magnetic compass CompassRoseRoll {-1.0, 1.0}{-20.0, 20.0}
|
||||
[72] = "%.4f", -- Magnetic compass CompassRosePitch {-1.0, 1.0}{-20.0, 20.0}
|
||||
[73] = "%.4f", -- Magnetic compass CompassHeading{0.0, 1.0}
|
||||
[120] = "%1d", -- Radio Lamp A
|
||||
[121] = "%1d", -- Radio Lamp B
|
||||
[122] = "%1d", -- Radio Lamp C
|
||||
[123] = "%1d", -- Radio Lamp D
|
||||
[124] = "%1d", -- Radio Lamp R
|
||||
--[131] = "%1d", -- UC_DOWN_C ???
|
||||
[49] = "%1d", -- Gear Lamp Down
|
||||
[48] = "%1d", -- Gear Lamp Up
|
||||
--[62] = "%.4f", -- ???
|
||||
--[63] = "%.4f", -- ???
|
||||
--[59] = "%.4f", -- ???
|
||||
--[45] = "%.4f" -- GUNSIGHT_RANGE ???
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
[13] = "%1d", -- Oxygen Apparatus Controls Valve
|
||||
-- Main Panel
|
||||
[30] = "%.1f", -- Altimeter (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[32] = "%.1f", -- DI (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[44] = "%1d", -- Fuel Gauge Button
|
||||
[46] = "%1d", -- Nav. Lights Toggle
|
||||
[47] = "%1d", -- Flaps Lever
|
||||
[50] = "%1d", -- U/C Indicator Blind
|
||||
[54] = "%1d", -- Clock Setter Pinion
|
||||
[55] = "%.1f", -- Clock Setter Pinion (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[56] = "%1d", -- Magnetos Toggles 1
|
||||
[57] = "%1d", -- Magnetos Toggles 2
|
||||
[58] = "%1d", -- Supercharger Mode Toggle
|
||||
[60] = "%.1f", -- Illumination Controls Left (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[61] = "%.1f", -- Illumination Controls Right (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[65] = "%1d", -- Starter Button
|
||||
[67] = "%1d", -- Booster Coil Button
|
||||
[69] = "%1d", -- Primer Pump
|
||||
[68] = "%.2f", -- Primer Pump (Axis) {0.0, 1.0} in 0.04 Steps
|
||||
[70] = "%1d", -- Tank Pressurizer Lever
|
||||
[74] = "%.4f", -- Magnetic Compass Ring (Axis) {0.0, 1.0} in 0.0333 Steps
|
||||
-- Gun Sight and Tertiary Weapons Controls
|
||||
[77] = "%.2f", -- Gun Sight Setter Rings Range (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[78] = "%.2f", -- Gun Sight Setter Rings Base (Axis) {0.0, 1.0} in 0.15 Steps
|
||||
[79] = "%1d", -- Gun Sight Tint Screen
|
||||
[80] = "%1d", -- Gun Sight Master Switch
|
||||
[81] = "%.1f", -- Gun Sight Dimmer (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Port Wall
|
||||
[145] = "%.2f", -- Elevator Trim Wheel (Axis) {-1.0, 1.0} in 0.01 Steps
|
||||
[146] = "%.1f", -- Rudder Trim Wheel (Axis) {-1.0, 1.0} in 0.1 Steps
|
||||
-- Radio Remote Channel Switcher
|
||||
[115] = "%1d", -- Off Button
|
||||
[116] = "%1d", -- A Button
|
||||
[117] = "%1d", -- B Button
|
||||
[118] = "%1d", -- C Button
|
||||
[119] = "%1d", -- D Button
|
||||
[125] = "%1d", -- Dimmer Toggle
|
||||
[155] = "%1d", -- Transmit Lock Toggle
|
||||
[156] = "%1d", -- Mode Selector
|
||||
-- Throttle Quadrant
|
||||
[126] = "%.1f", -- Throttle Lever (Axis) {-1.0, 1.0} in 0.1 Steps
|
||||
[128] = "%1d", -- Bomb Drop Button
|
||||
[129] = "%.1f", -- Airscrew Lever (Axis) {-1.0, 1.0} in 0.1 Steps
|
||||
[130] = "%1d", -- Mix Cut-Off Lever
|
||||
[131] = "%1d", -- U/C Indicator Cut-Off Toggle
|
||||
--
|
||||
[133] = "%1d", -- Radiator Control Toggle
|
||||
[134] = "%1d", -- Pitot Heater Toggle
|
||||
[135] = "%1d", -- Fuel Pump Toggle
|
||||
[137] = "%1d", -- Carb. Air Control Lever
|
||||
[158] = "%1d", -- Oil Diluter Button
|
||||
[160] = "%1d", -- Supercharger Mode Test Button
|
||||
[162] = "%1d", -- Radiator Flap Test Button
|
||||
-- Stbd. Wall
|
||||
[87] = "%1d", -- De-Icer Lever
|
||||
[88] = "%1d", -- U/C Emergency Release Lever
|
||||
[90] = "%1d", -- Wobble Type Fuel Pump
|
||||
-- Wobble Type Fuel Pump
|
||||
[92] = "%.1f", -- Upward Lamp Mode Selector {0.0,0.5,1.0}
|
||||
[93] = "%.1f", -- Downward Lamp Mode Selector {0.0,0.5,1.0}
|
||||
[94] = "%1d", -- Morse Key
|
||||
--
|
||||
[148] = "%1d", -- U/C Lever
|
||||
-- I.F.F. Control Box
|
||||
[106] = "%1d", -- I.F.F. Upper Toggle (Type B)
|
||||
[107] = "%1d", -- I.F.F. Lower Toggle (Type D)
|
||||
[109] = "%1d", -- I.F.F. Fore Button (0)
|
||||
[110] = "%1d", -- I.F.F. Aft Button (1)
|
||||
-- Fuel Cocks & Tertiary
|
||||
[100] = "%1d", -- Fuel Cock
|
||||
[98] = "%1d", -- Droptank Cock
|
||||
[99] = "%1d", -- Droptank Release Handle
|
||||
-- Canopy Controls
|
||||
[149] = "%1d", -- Cockpit Open/Close Control
|
||||
[140] = "%1d", -- Cockpit Jettison Pull Ball
|
||||
[147] = "%1d" -- Cockpit Side Door Open/Close Control
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
-- Cockpit Light
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {163, 62, 63})
|
||||
-- Gauges light, left panel light, right panel light
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to DAC
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local UHF_RADIO = GetDevice(54)
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format")
|
||||
ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
|
||||
-- VHF_Radio
|
||||
local lVHF_Radio = GetDevice(15)
|
||||
if lVHF_Radio:is_on() then
|
||||
ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lVHF_Radio:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy(lVHF_Radio:get_frequency()/1000000))
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("2000", " ")
|
||||
end
|
||||
|
||||
--[[
|
||||
[115] = "%1d", -- Off Button
|
||||
[116] = "%1d", -- A Button
|
||||
[117] = "%1d", -- B Button
|
||||
[118] = "%1d", -- C Button
|
||||
[119] = "%1d", -- D Button]]
|
||||
local lVHF_Radio_PRESET = ""
|
||||
if mainPanelDevice:get_argument_value(116) > 0.8 then
|
||||
lVHF_Radio_PRESET = 1
|
||||
elseif mainPanelDevice:get_argument_value(117) > 0.8 then
|
||||
lVHF_Radio_PRESET = 2
|
||||
elseif mainPanelDevice:get_argument_value(118) > 0.8 then
|
||||
lVHF_Radio_PRESET = 3
|
||||
elseif mainPanelDevice:get_argument_value(119) > 0.8 then
|
||||
lVHF_Radio_PRESET = 4
|
||||
else
|
||||
lVHF_Radio_PRESET = ""
|
||||
end
|
||||
ExportScript.Tools.SendDataDAC("2001", lVHF_Radio_PRESET)
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,488 @@
|
||||
-- Su-25A Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.Su25 = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-25A --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-TAS Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1100hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
ExportScript.AF.FC_Russian_AOA_Su25()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI_old()
|
||||
|
||||
-- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_late()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
|
||||
-- HSI Distance
|
||||
ExportScript.AF.FC_Russian_HSI_Distance_old(lDistanceToWay)
|
||||
|
||||
-- Mach {max, Mach}
|
||||
local lMachTmp = 0
|
||||
if lMachNumber > 0.475 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0.475 -- minimaler Eingangswert
|
||||
x_max = 1.0 -- maximaler Eingangswert
|
||||
x = 0.65 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 0.525 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 1.9047619047619047619047619047619 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0.9047619047619047619047619047619 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0,333333333333333333333333333334 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lMachTmp = 1.9047619047619047619047619047619 * lMachNumber + -0.9047619047619047619047619047619
|
||||
else
|
||||
lMachTmp = 0
|
||||
end
|
||||
|
||||
ExportScript.Tools.SendData(72, string.format("%0.4f", 0.665))
|
||||
ExportScript.Tools.SendData(73, string.format("%0.4f", lMachTmp))
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Mechanical Configuration Indicator (GearWarningLight, NoseGear, LeftGear, RightGear, Airbreaks, Flaps1, Flaps2)
|
||||
ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
end
|
||||
|
||||
--(x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.SightingSystem()
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 )
|
||||
end
|
||||
|
||||
function ExportScript.AF.FlareChaff()
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
--[chaff] = number: "128"
|
||||
--[flare] = number: "128"
|
||||
end
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--WriteToLog('lEngineInfo: '..dump(lEngineInfo))
|
||||
ExportScript.Tools.SendDataDAC("728", lEngineInfo.EngineStart.left ) -- lamp start left engine 1 (0|1)
|
||||
ExportScript.Tools.SendDataDAC("729", lEngineInfo.EngineStart.right ) -- lamp start right engine 1 (0|1)
|
||||
end
|
||||
|
||||
local lAoA = LoGetAngleOfAttack()
|
||||
if lAoA ~= nil then
|
||||
lAoA = lAoA * 57.3
|
||||
ExportScript.Tools.SendDataDAC("730", (lAoA > 20.0 and 1 or 0) ) -- lamp start AOA warning (0|1)
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FuelQuantityIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
local lFuel_leftbar = 1.0
|
||||
local lFuel_rightbar = 1.0
|
||||
local lExtTank1 = 1.0 -- external tanks
|
||||
local lExtTank2 = 1.0 -- inner tanks
|
||||
|
||||
if lTotalFuel < 5000 then
|
||||
if lTotalFuel > 1500 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 1500 -- minimaler Eingangswert
|
||||
x_max = 5000 -- maximaler Eingangswert
|
||||
x = 3500 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 3500 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 2.8571428571428571428571428571429e-4 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0.42857142857142857142857142857143 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0,57142857142857142857142857142857 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lFuel_leftbar = 2.8571428571428571428571428571429e-4 * lTotalFuel + -0.42857142857142857142857142857143
|
||||
else
|
||||
lFuel_leftbar = 0.0
|
||||
end
|
||||
else
|
||||
lFuel_leftbar = 1.0
|
||||
end
|
||||
if lTotalFuel < 1200 then
|
||||
lFuel_rightbar = lTotalFuel / 1200
|
||||
else
|
||||
lFuel_rightbar = 1.0
|
||||
end
|
||||
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--WriteToLog('lPayloadInfo: '..dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
|
||||
lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8)
|
||||
lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
end
|
||||
-- Fuel_leftbar
|
||||
-- Fuel_rightbar
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- Light5
|
||||
-- BingoLight
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
ExportScript.Tools.SendData(300, string.format("%0.4f", lFuel_leftbar))
|
||||
ExportScript.Tools.SendData(301, string.format("%0.4f", lFuel_rightbar))
|
||||
ExportScript.Tools.SendData(302, lExtTank1) -- external tanks
|
||||
ExportScript.Tools.SendData(303, lExtTank2) -- inner tanks
|
||||
ExportScript.Tools.SendData(304, (lEngineInfo.fuel_internal < 2790.0 and 1 or 0)) -- inner wing tank
|
||||
ExportScript.Tools.SendData(305, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank
|
||||
ExportScript.Tools.SendData(306, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel
|
||||
end
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC(300, string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)) -- total fuel in kg
|
||||
ExportScript.Tools.SendDataDAC(303, lExtTank1) -- external tanks
|
||||
ExportScript.Tools.SendDataDAC(304, lExtTank2) -- inner tanks
|
||||
ExportScript.Tools.SendDataDAC(305, (lEngineInfo.fuel_internal < 2790.0 and 1 or 0)) -- inner wing tank
|
||||
ExportScript.Tools.SendDataDAC(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank
|
||||
ExportScript.Tools.SendDataDAC(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank
|
||||
ExportScript.Tools.SendDataDAC(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,443 @@
|
||||
-- Su-25T Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.Su25T = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ?C
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ?C
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-TAS Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1100hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer
|
||||
ExportScript.AF.FC_Russian_AOA_Su25()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_late()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID)
|
||||
ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
-- Weapon Panel
|
||||
ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp)
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FC_FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
end
|
||||
|
||||
-- (x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
-- local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
-- ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
-- Weapon Panel
|
||||
ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp)
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp)
|
||||
-- Fuel
|
||||
ExportScript.AF.FC_FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.FC_StatusLamp()
|
||||
ExportScript.AF.FC_SightingSystem()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.FC_SightingSystem()
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 )
|
||||
end
|
||||
|
||||
function ExportScript.AF.FC_FlareChaff()
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
--[chaff] = number: "128"
|
||||
--[flare] = number: "128"
|
||||
end
|
||||
|
||||
function ExportScript.AF.FC_StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
ExportScript.Tools.SendDataDAC("728", lEngineInfo.EngineStart.left ) -- lamp start left engine 1 (0|1)
|
||||
ExportScript.Tools.SendDataDAC("729", lEngineInfo.EngineStart.right ) -- lamp start right engine 1 (0|1)
|
||||
end
|
||||
|
||||
local lAoA = LoGetAngleOfAttack()
|
||||
if lAoA ~= nil then
|
||||
lAoA = lAoA * 57.3
|
||||
ExportScript.Tools.SendDataDAC("730", (lAoA > 20.0 and 1 or 0) ) -- lamp start AOA warning (0|1)
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FC_FuelQuantityIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
--local lTotalFuel = string.format("%3d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lFuelCounter = {[0] = 0.0, [1] = 0.11, [2] = 0.22, [3] = 0.33, [4] = 0.44, [5] = 0.55, [6] = 0.66, [7] = 0.77, [8] = 0.88, [9] = 0.99}
|
||||
lTotalFuel = string.format("%03d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil")) -- auf drei stellen bringen
|
||||
|
||||
local lExtTank1 = 1.0 -- external tanks
|
||||
local lExtTank2 = 1.0 -- inner tanks
|
||||
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
if lPayloadInfo ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5)
|
||||
lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or
|
||||
lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8)
|
||||
lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0)
|
||||
end
|
||||
end
|
||||
-- TotalFuel_100
|
||||
-- TotalFuel_10
|
||||
-- TotalFuel_1
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- Light5
|
||||
-- BingoLight
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
ExportScript.Tools.SendData(300, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 1, 1))]))
|
||||
ExportScript.Tools.SendData(301, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 2, 2))]))
|
||||
ExportScript.Tools.SendData(302, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 3, 3))]))
|
||||
ExportScript.Tools.SendData(303, lExtTank1) -- external tanks
|
||||
ExportScript.Tools.SendData(304, lExtTank2) -- inner tanks
|
||||
ExportScript.Tools.SendData(305, (lEngineInfo.fuel_internal < 2800.0 and 1 or 0)) -- inner wing tank
|
||||
ExportScript.Tools.SendData(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank
|
||||
ExportScript.Tools.SendData(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank
|
||||
ExportScript.Tools.SendData(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel
|
||||
end
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("300", string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
ExportScript.Tools.SendDataDAC(303, lExtTank1) -- external tanks
|
||||
ExportScript.Tools.SendDataDAC(304, lExtTank2) -- inner tanks
|
||||
ExportScript.Tools.SendDataDAC(305, (lEngineInfo.fuel_internal < 2800.0 and 1 or 0)) -- inner wing tank
|
||||
ExportScript.Tools.SendDataDAC(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank
|
||||
ExportScript.Tools.SendDataDAC(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank
|
||||
ExportScript.Tools.SendDataDAC(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,727 @@
|
||||
-- Su-27 Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.Su27 = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-27 --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-MACH Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1600hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer (AOA, GLoad)
|
||||
ExportScript.AF.FC_Russian_AOA_Su2733()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_Old()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI)
|
||||
ExportScript.AF.FC_Russian_VVI_Old()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_20000()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, main scala, second scala, ExportID)
|
||||
ExportScript.AF.FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 70, 71)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, main scala, second scala, ExportID)
|
||||
ExportScript.AF.FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 72, 73)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU27(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86)
|
||||
end
|
||||
|
||||
-- Engine Lamps, Start and Afterburner
|
||||
ExportScript.AF.FC_EngineLamps_SU2733(lFunctionTyp)
|
||||
|
||||
-- Mechanical Configuration Indicator
|
||||
ExportScript.AF.MechanicalDevicesIndicator(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88)
|
||||
|
||||
--ExportScript.Tools.WriteToLog('lMechInfo.noseflap.value: '..ExportScript.Tools.dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
ExportScript.AF.FC_Russian_AirIntake()
|
||||
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
--local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
--ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU27(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.MechanicalDevicesIndicator(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
ExportScript.AF.FC_EngineLamps_SU2733(lFunctionTyp)
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem()
|
||||
ExportScript.AF.PPDSPPanel()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.SightingSystem()
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 )
|
||||
end
|
||||
|
||||
function ExportScript.AF.PPDSPPanel()
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
--[chaff] = number: "96"
|
||||
--[flare] = number: "96"
|
||||
|
||||
local lChaffLED = ExportScript.Tools.round(lSnares.chaff / 12, 0, "ceil") + 1
|
||||
local lFlareLED = ExportScript.Tools.round(lSnares.flare / 12, 0, "ceil") + 1
|
||||
|
||||
ExportScript.Tools.SendDataDAC("800", (lChaffLED <= 1 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("801", (lChaffLED <= 2 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("802", (lChaffLED <= 3 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("803", (lChaffLED <= 4 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("804", (lChaffLED <= 5 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("805", (lChaffLED <= 6 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("806", (lChaffLED <= 7 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("807", (lChaffLED <= 8 and 0 or 1) )
|
||||
|
||||
ExportScript.Tools.SendDataDAC("810", (lFlareLED <= 1 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("811", (lFlareLED <= 2 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("812", (lFlareLED <= 3 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("813", (lFlareLED <= 4 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("814", (lFlareLED <= 5 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("815", (lFlareLED <= 6 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("816", (lFlareLED <= 7 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("817", (lFlareLED <= 8 and 0 or 1) )
|
||||
end
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lAccelerationUnits: '..ExportScript.Tools.dump(lAccelerationUnits))
|
||||
ExportScript.Tools.SendDataDAC("732", (lAccelerationUnits.y > 8.0 and 1 or 0) ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FuelQuantityIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("300", string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10) ) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg
|
||||
|
||||
ExportScript.Tools.SendDataDAC("304", (lEngineInfo.fuel_internal < 5600.0 and 1 or 0) ) -- Tank warning 1
|
||||
ExportScript.Tools.SendDataDAC("305", (lEngineInfo.fuel_internal < 4500.0 and 1 or 0) ) -- Tank warning 2
|
||||
ExportScript.Tools.SendDataDAC("306", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0) ) -- Tank warning 3
|
||||
ExportScript.Tools.SendDataDAC("307", (lEngineInfo.fuel_internal < 800.0 and 1 or 0) ) -- Tank warning 4
|
||||
ExportScript.Tools.SendDataDAC("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0) ) -- Bingo Fuel
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
local lTotalFuel_9_3 = 0
|
||||
local lTotalFuel_5_0 = 0
|
||||
local lTotalFuel = lEngineInfo.fuel_internal
|
||||
|
||||
if lTotalFuel < 9000 then
|
||||
if lTotalFuel > 3000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 3000 -- minimaler Eingangswert
|
||||
x_max = 9000 -- maximaler Eingangswert
|
||||
x = 8000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 6000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 1.66666666666666666666666666667e-4 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = -0,5 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.83333 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_9_3 = 1.6666666666666666666666666666667e-4 * lTotalFuel + -0.5
|
||||
else
|
||||
lTotalFuel_9_3 = 0.0
|
||||
end
|
||||
else
|
||||
lTotalFuel_9_3 = 1.0
|
||||
end
|
||||
if lTotalFuel < 5000 then
|
||||
lTotalFuel_5_0 = lTotalFuel / 5000
|
||||
else
|
||||
lTotalFuel_5_0 = 1.0
|
||||
end
|
||||
|
||||
-- TotalFuel_5_0
|
||||
-- TotalFuel_9_3
|
||||
-- Light1
|
||||
-- Light2
|
||||
-- Light3
|
||||
-- Light4
|
||||
-- BingoLight
|
||||
ExportScript.Tools.SendData(300, lTotalFuel_5_0)
|
||||
ExportScript.Tools.SendData(301, lTotalFuel_9_3)
|
||||
ExportScript.Tools.SendData(302, (lEngineInfo.fuel_internal < 5600.0 and 1 or 0)) -- Tank warning 1
|
||||
ExportScript.Tools.SendData(303, (lEngineInfo.fuel_internal < 4500.0 and 1 or 0)) -- Tank warning 2
|
||||
ExportScript.Tools.SendData(304, (lEngineInfo.fuel_internal < 1500.0 and 1 or 0)) -- Tank warning 3
|
||||
ExportScript.Tools.SendData(305, (lEngineInfo.fuel_internal < 800.0 and 1 or 0)) -- Tank warning 4
|
||||
ExportScript.Tools.SendData(306, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.MechanicalDevicesIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
--ExportScript.Tools.WriteToLog('lTrueAirSpeed: '..ExportScript.Tools.dump(lTrueAirSpeed))
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ) ) -- gear warning light
|
||||
ExportScript.Tools.SendDataDAC("501", (lMechInfo.gear.value > 0.85 and 1 or 0) ) -- nose gear
|
||||
ExportScript.Tools.SendDataDAC("502", (lMechInfo.gear.value > 0.95 and 1 or 0) ) -- left gear
|
||||
ExportScript.Tools.SendDataDAC("503", (lMechInfo.gear.value > 0.97 and 1 or 0) ) -- right gear
|
||||
|
||||
ExportScript.Tools.SendDataDAC("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0) ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
ExportScript.Tools.SendDataDAC("531", (lMechInfo.flaps.value > 0.93 and 1 or 0) ) -- flap
|
||||
ExportScript.Tools.SendDataDAC("532", ((lMechInfo.gear.value > 0.5 and lMechInfo.gear.nose.rod > 0.02) and 1 or 0) ) -- Intake FOD shields
|
||||
ExportScript.Tools.SendDataDAC("533", ((lMechInfo.gear.status == 0 and lMechInfo.flaps.value > 0.93) and 1 or 0) ) -- Flaps Warning, same light as gear warning light, but blinking light
|
||||
|
||||
ExportScript.Tools.SendDataDAC("541", (lMechInfo.parachute.value < 0.5 and 1 or 0) ) -- Parachute
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
local lWarningLight = 0.0
|
||||
|
||||
--lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 0.5 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = ((lMechInfo.gear.status == 0 and lMechInfo.flaps.value > 0.93) and 1.0 or lWarningLight ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
|
||||
ExportScript.Tools.SendData(500, string.format("%.1f", lWarningLight))
|
||||
ExportScript.Tools.SendData(501, (lMechInfo.gear.value > 0.85 and 1 or 0)) -- nose gear
|
||||
ExportScript.Tools.SendData(502, (lMechInfo.gear.value > 0.95 and 1 or 0)) -- left gear
|
||||
ExportScript.Tools.SendData(503, (lMechInfo.gear.value == 1 and 1 or 0)) -- right gear
|
||||
ExportScript.Tools.SendData(510, (lMechInfo.speedbrakes.value > 0.1 and 1 or 0)) -- speedbreakes on > 0.1 (0 - 1)
|
||||
ExportScript.Tools.SendData(531, (lMechInfo.flaps.value > 0.93 and 1 or 0)) -- flap
|
||||
ExportScript.Tools.SendData(532, ((lMechInfo.gear.value > 0.5 and lMechInfo.gear.nose.rod > 0.02) and 1 or 0)) -- Intake FOD shields
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FC_WeaponPanel_SU27(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanelPresend == nil then
|
||||
ExportScript.AF.TmpWeaponPanelPresend = {[101] = 0, [102] = 0, [103] = 0, [104] = 0, [105] = 0, [106] = 0, [107] = 0, [108] = 0, [109] = 0, [110] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanelActive == nil then
|
||||
ExportScript.AF.TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanel == nil then
|
||||
ExportScript.AF.TmpWeaponPanel = {[231] = 0, [232] = 0, [233] = 0, [234] = 0, [235] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.EventNumberFC_WeaponPanel == nil then
|
||||
ExportScript.AF.EventNumberFC_WeaponPanel = 0
|
||||
end
|
||||
|
||||
if(ExportScript.AF.EventNumberFC_WeaponPanel < ExportScript.AF.EventNumber) then
|
||||
ExportScript.AF.EventNumberFC_WeaponPanel = ExportScript.AF.EventNumber
|
||||
|
||||
-- defination
|
||||
ExportScript.AF.PayloadInfo = LoGetPayloadInfo()
|
||||
if ExportScript.AF.PayloadInfo ~= nil then
|
||||
if ExportScript.AF.CurrentStationTmp == nil then
|
||||
ExportScript.AF.CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if ExportScript.AF.PayloadInfo.CurrentStation > 0 and
|
||||
ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then
|
||||
ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation
|
||||
|
||||
ExportScript.AF.TmpStationToPanel = {}
|
||||
ExportScript.AF.TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- left
|
||||
ExportScript.AF.TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- right
|
||||
ExportScript.AF.TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202 }
|
||||
ExportScript.AF.TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209 }
|
||||
ExportScript.AF.TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203 }
|
||||
ExportScript.AF.TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208 }
|
||||
ExportScript.AF.TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204 }
|
||||
ExportScript.AF.TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207 }
|
||||
ExportScript.AF.TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205 }
|
||||
ExportScript.AF.TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206 }
|
||||
|
||||
-- ExportScript.AF.TmpWeaponPanelActive reset
|
||||
for i = 201, 210, 1 do
|
||||
ExportScript.AF.TmpWeaponPanelActive[i] = 0
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation] ~= nil then
|
||||
ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value
|
||||
|
||||
table.foreach(ExportScript.AF.PayloadInfo.Stations, ExportScript.AF.WeaponStatusPanel_selectCurrentPayloadStation) -- corresponding station
|
||||
end
|
||||
end
|
||||
|
||||
local lWeaponType = 0.0 -- transversely striped
|
||||
if ExportScript.AF.PayloadInfo.CurrentStation > 0 then
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level1 == 4 then
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle
|
||||
lWeaponType = 0.1 -- MSL
|
||||
elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket
|
||||
lWeaponType = 0.2 -- RCT
|
||||
end
|
||||
elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb
|
||||
lWeaponType = 0.3 -- BB
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Weapon Panel
|
||||
|
|
||||
---------------------------------------------------
|
||||
| | | | | | | | | | |
|
||||
1 2 3 4 5 C 6 7 8 9 10 -- display
|
||||
1 3 5 7 9 10 8 6 4 2 -- Paylod ID
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station
|
||||
|
||||
-- WeaponPresend1 {0, 1}
|
||||
-- WeaponPresend2 {0, 1}
|
||||
-- WeaponPresend3 {0, 1}
|
||||
-- WeaponPresend4 {0, 1}
|
||||
-- WeaponPresend5 {0, 1}
|
||||
-- WeaponPresend6 {0, 1}
|
||||
-- WeaponPresend7 {0, 1}
|
||||
-- WeaponPresend8 {0, 1}
|
||||
-- WeaponPresend9 {0, 1}
|
||||
-- WeaponPresend10 {0, 1}
|
||||
-- WeaponActive1 {0, 1}
|
||||
-- WeaponActive2 {0, 1}
|
||||
-- WeaponActive3 {0, 1}
|
||||
-- WeaponActive4 {0, 1}
|
||||
-- WeaponActive5 {0, 1}
|
||||
-- WeaponActive6 {0, 1}
|
||||
-- WeaponActive7 {0, 1}
|
||||
-- WeaponActive8 {0, 1}
|
||||
-- WeaponActive9 {0, 1}
|
||||
-- WeaponActive10 {0, 1}
|
||||
|
||||
ExportScript.AF.TmpWeaponPanelPresend[101] = (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0) -- weapon presend panel 1
|
||||
ExportScript.AF.TmpWeaponPanelPresend[102] = (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0) -- weapon presend panel 2
|
||||
ExportScript.AF.TmpWeaponPanelPresend[103] = (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0) -- weapon presend panel 3
|
||||
ExportScript.AF.TmpWeaponPanelPresend[104] = (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0) -- weapon presend panel 4
|
||||
ExportScript.AF.TmpWeaponPanelPresend[105] = (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0) -- weapon presend panel 5
|
||||
ExportScript.AF.TmpWeaponPanelPresend[106] = (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0) -- weapon presend panel 6
|
||||
ExportScript.AF.TmpWeaponPanelPresend[107] = (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0) -- weapon presend panel 7
|
||||
ExportScript.AF.TmpWeaponPanelPresend[108] = (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0) -- weapon presend panel 8
|
||||
ExportScript.AF.TmpWeaponPanelPresend[109] = (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0) -- weapon presend panel 9
|
||||
ExportScript.AF.TmpWeaponPanelPresend[110] = (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0) -- weapon presend panel 10
|
||||
--ExportScript.AF.TmpWeaponPanelActive[201] -- weapon active panel 1
|
||||
--ExportScript.AF.TmpWeaponPanelActive[202] -- weapon active panel 2
|
||||
--ExportScript.AF.TmpWeaponPanelActive[203] -- weapon active panel 3
|
||||
--ExportScript.AF.TmpWeaponPanelActive[204] -- weapon active panel 4
|
||||
--ExportScript.AF.TmpWeaponPanelActive[205] -- weapon active panel 5
|
||||
--ExportScript.AF.TmpWeaponPanelActive[206] -- weapon active panel 6
|
||||
--ExportScript.AF.TmpWeaponPanelActive[207] -- weapon active panel 7
|
||||
--ExportScript.AF.TmpWeaponPanelActive[208] -- weapon active panel 8
|
||||
--ExportScript.AF.TmpWeaponPanelActive[209] -- weapon active panel 9
|
||||
--ExportScript.AF.TmpWeaponPanelActive[210] -- weapon active panel 10
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do
|
||||
ExportScript.Tools.SendData(key, value)
|
||||
end
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do
|
||||
ExportScript.Tools.SendData(key, value)
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do
|
||||
ExportScript.Tools.SendDataDAC(key, value)
|
||||
end
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do
|
||||
ExportScript.Tools.SendDataDAC(key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,720 @@
|
||||
-- Su-33 Export
|
||||
|
||||
ExportScript.FoundFCModule = true
|
||||
ExportScript.Version.Su33 = "1.2.0"
|
||||
|
||||
-- auxiliary function
|
||||
dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua")
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-33 --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
|
||||
function ExportScript.ProcessIkarusFCHighImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
local myData = LoGetSelfData()
|
||||
|
||||
if (myData) then
|
||||
local lLatitude = myData.LatLongAlt.Lat -- LATITUDE
|
||||
local lLongitude = myData.LatLongAlt.Long -- LONGITUDE
|
||||
|
||||
local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ºC
|
||||
local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ºC
|
||||
--[[
|
||||
local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE
|
||||
local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter)
|
||||
local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter)
|
||||
local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second)
|
||||
local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian)
|
||||
|
||||
local lHeading = myData.Heading -- HEADING (Radian)
|
||||
local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second)
|
||||
local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second)
|
||||
local lMachNumber = LoGetMachNumber() -- MACH
|
||||
local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian)
|
||||
|
||||
local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1)
|
||||
local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1)
|
||||
local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1)
|
||||
local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD
|
||||
|
||||
local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian)
|
||||
local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian)
|
||||
local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second)
|
||||
local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter)
|
||||
local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second)
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data
|
||||
local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian)
|
||||
local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian)
|
||||
local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian)
|
||||
|
||||
local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM %
|
||||
local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM %
|
||||
|
||||
local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG)
|
||||
local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,...
|
||||
]]
|
||||
|
||||
local lDistanceToWay = 999
|
||||
local lRoute = LoGetRoute()
|
||||
|
||||
if (myData and lRoute) then -- if neither are nil
|
||||
local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude)
|
||||
--lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2)
|
||||
lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2)
|
||||
end
|
||||
|
||||
-- IAS-MACH Indicator
|
||||
ExportScript.AF.FC_Russian_AirSpeed_1600hkm()
|
||||
|
||||
-- AOA Indicator and Accelerometer
|
||||
ExportScript.AF.FC_Russian_AOA_Su2733()
|
||||
|
||||
-- ADI
|
||||
ExportScript.AF.FC_Russian_ADI_New()
|
||||
|
||||
-- HSI
|
||||
ExportScript.AF.FC_Russian_HSI(lDistanceToWay)
|
||||
|
||||
-- Vertical Velocity Indicator (VVI)
|
||||
ExportScript.AF.FC_Russian_VVI_New()
|
||||
|
||||
-- Radar Altimeter (below 100m is warning light on)
|
||||
ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100)
|
||||
|
||||
-- Barometric Altimeter
|
||||
ExportScript.AF.FC_Russian_BarometricAltimeter_late()
|
||||
|
||||
-- Tachometer (RPM)
|
||||
ExportScript.AF.FC_Russian_EngineRPM()
|
||||
|
||||
-- Left Jet Engine Turbine Temperature Indicator (EngineTemp, main scala, second scala, ExportID)
|
||||
ExportScript.AF.FC_TwoNeedlesGauge(lEngineTempLeft, 1200, 100, 70, 71)
|
||||
|
||||
-- Right Jet Engine Turbine Temperature Indicator (EngineTemp, main scala, second scala, ExportID)
|
||||
ExportScript.AF.FC_TwoNeedlesGauge(lEngineTempRight, 1200, 100, 72, 73)
|
||||
|
||||
-- Clock from Ka-50
|
||||
ExportScript.AF.FC_Russian_Clock_late()
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
-- your script
|
||||
|
||||
end
|
||||
|
||||
function ExportScript.ProcessIkarusFCLowImportanceConfig()
|
||||
local lFunctionTyp = "Ikarus" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU33(lFunctionTyp)
|
||||
|
||||
-- SPO15 Radar Warning Reciver
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
|
||||
-- EKRAN Message
|
||||
ExportScript.AF.FC_EKRAN()
|
||||
|
||||
-- Fuel Quantity Indicator
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
|
||||
ExportScript.AF.MechanicalDevicesIndicator(lFunctionTyp)
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
-- Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 300, 85)
|
||||
|
||||
-- Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 300, 86)
|
||||
end
|
||||
|
||||
-- Engine Lamps, Start and Afterburner
|
||||
ExportScript.AF.FC_EngineLamps_SU2733(lFunctionTyp)
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
if lMechInfo ~= nil then
|
||||
-- Wheelbrakes Hydraulic Pressure Left
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 300, 87)
|
||||
|
||||
-- Wheelbrakes Hydraulic Pressure Right
|
||||
ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 300, 88)
|
||||
|
||||
--ExportScript.Tools.WriteToLog('lMechInfo.noseflap.value: '..ExportScript.Tools.dump(lMechInfo.noseflap.value)) -- Vorfluegel, Balkenanzeige neben dem Radarhoehenmesser (0=oben bis 30=unten)
|
||||
end
|
||||
|
||||
-- Airintake
|
||||
ExportScript.AF.FC_Russian_AirIntake(20)
|
||||
|
||||
-- (x < 0 and 'negative' or 'non-negative')
|
||||
--[[
|
||||
local lPayloadInfo = LoGetPayloadInfo()
|
||||
ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo))
|
||||
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo))
|
||||
|
||||
local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C
|
||||
ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo))
|
||||
|
||||
local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C
|
||||
ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation))
|
||||
|
||||
local lLockedTargetInformation = LoGetLockedTargetInformation()
|
||||
ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation))
|
||||
|
||||
local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode
|
||||
ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs))
|
||||
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
|
||||
local lMCPState = LoGetMCPState() -- Warnlichter
|
||||
ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
|
||||
local lControlPanel_HSI = LoGetControlPanel_HSI()
|
||||
ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI))
|
||||
|
||||
local lRadioBeaconsStatus = LoGetRadioBeaconsStatus()
|
||||
ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus))
|
||||
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
]]
|
||||
-- Weapon Control System
|
||||
-- local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string
|
||||
-- values from LoGetTargetInformation().type
|
||||
-- ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType))
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigLowImportance()
|
||||
local lFunctionTyp = "DAC" -- function type for shared function
|
||||
|
||||
ExportScript.AF.FC_WeaponPanel_SU33(lFunctionTyp)
|
||||
ExportScript.AF.FC_SPO15RWR(lFunctionTyp)
|
||||
ExportScript.AF.MechanicalDevicesIndicator(lFunctionTyp)
|
||||
ExportScript.AF.FuelQuantityIndicator(lFunctionTyp)
|
||||
ExportScript.AF.FC_EngineLamps_SU2733(lFunctionTyp)
|
||||
ExportScript.AF.StatusLamp()
|
||||
ExportScript.AF.SightingSystem()
|
||||
ExportScript.AF.PPDSPPanel()
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
|
||||
function ExportScript.AF.SightingSystem()
|
||||
local lSightingSystemInfo = LoGetSightingSystemInfo()
|
||||
if lSightingSystemInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9
|
||||
--[[
|
||||
[PRF] = {
|
||||
[selection] = string: "ILV"
|
||||
[current] = string: "MED"
|
||||
}
|
||||
[laser_on] = boolean: "false"
|
||||
[scale] = {
|
||||
[azimuth] = number: "0.52359873056412"
|
||||
[distance] = number: "10000"
|
||||
}
|
||||
[radar_on] = boolean: "false"
|
||||
[optical_system_on] = boolean: "false"
|
||||
[LaunchAuthorized] = boolean: "false"
|
||||
[ECM_on] = boolean: "false"
|
||||
[Manufacturer] = string: "RUS"
|
||||
[TDC] = {
|
||||
[y] = number: "0"
|
||||
[x] = number: "0"
|
||||
}
|
||||
[ScanZone] = {
|
||||
[coverage_H] = {
|
||||
[min] = number: "0"
|
||||
[max] = number: "20000"
|
||||
}
|
||||
[size] = {
|
||||
[azimuth] = number: "1.0471974611282"
|
||||
[elevation] = number: "0.17453290522099"
|
||||
}
|
||||
[position] = {
|
||||
[exceeding_manual] = number: "0"
|
||||
[distance_manual] = number: "0"
|
||||
[azimuth] = number: "0"
|
||||
[elevation] = number: "0"
|
||||
}
|
||||
}
|
||||
]]
|
||||
ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 )
|
||||
--ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 )
|
||||
end
|
||||
|
||||
function ExportScript.AF.PPDSPPanel()
|
||||
local lSnares = LoGetSnares() -- Flare and Chaff
|
||||
if lSnares == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares))
|
||||
|
||||
--[chaff] = number: "48"
|
||||
--[flare] = number: "48"
|
||||
|
||||
local lChaffLED = ExportScript.Tools.round(lSnares.chaff / 6, 0, "ceil") + 1
|
||||
local lFlareLED = ExportScript.Tools.round(lSnares.flare / 6, 0, "ceil") + 1
|
||||
|
||||
ExportScript.Tools.SendDataDAC("800", (lChaffLED <= 1 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("801", (lChaffLED <= 2 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("802", (lChaffLED <= 3 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("803", (lChaffLED <= 4 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("804", (lChaffLED <= 5 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("805", (lChaffLED <= 6 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("806", (lChaffLED <= 7 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("807", (lChaffLED <= 8 and 0 or 1) )
|
||||
|
||||
ExportScript.Tools.SendDataDAC("810", (lFlareLED <= 1 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("811", (lFlareLED <= 2 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("812", (lFlareLED <= 3 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("813", (lFlareLED <= 4 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("814", (lFlareLED <= 5 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("815", (lFlareLED <= 6 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("816", (lFlareLED <= 7 and 0 or 1) )
|
||||
ExportScript.Tools.SendDataDAC("817", (lFlareLED <= 8 and 0 or 1) )
|
||||
end
|
||||
|
||||
function ExportScript.AF.StatusLamp()
|
||||
local lMCPState = LoGetMCPState() -- Warning Lights
|
||||
if lMCPState == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState))
|
||||
--[[
|
||||
[RightTailPlaneFailure] = boolean: "false"
|
||||
[EOSFailure] = boolean: "false"
|
||||
[ECMFailure] = boolean: "false"
|
||||
[RightAileronFailure] = boolean: "false"
|
||||
[MasterWarning] = boolean: "false"
|
||||
[RightEngineFailure] = boolean: "false"
|
||||
[CannonFailure] = boolean: "false"
|
||||
[MLWSFailure] = boolean: "false"
|
||||
[ACSFailure] = boolean: "false"
|
||||
[RadarFailure] = boolean: "false"
|
||||
[HelmetFailure] = boolean: "false"
|
||||
[HUDFailure] = boolean: "false"
|
||||
[LeftMainPumpFailure] = boolean: "false"
|
||||
[RightWingPumpFailure] = boolean: "false"
|
||||
[LeftWingPumpFailure] = boolean: "false"
|
||||
[MFDFailure] = boolean: "false"
|
||||
[RWSFailure] = boolean: "false"
|
||||
[GearFailure] = boolean: "false"
|
||||
[HydraulicsFailure] = boolean: "false"
|
||||
[AutopilotFailure] = boolean: "true"
|
||||
[FuelTankDamage] = boolean: "false"
|
||||
[LeftAileronFailure] = boolean: "false"
|
||||
[CanopyOpen] = boolean: "false"
|
||||
[RightMainPumpFailure] = boolean: "false"
|
||||
[StallSignalization] = boolean: "false"
|
||||
[LeftEngineFailure] = boolean: "false"
|
||||
[AutopilotOn] = boolean: "false"
|
||||
[LeftTailPlaneFailure] = boolean: "false"
|
||||
]]
|
||||
|
||||
ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 )
|
||||
ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 )
|
||||
|
||||
local lAccelerationUnits = LoGetAccelerationUnits()
|
||||
if lAccelerationUnits ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lAccelerationUnits: '..ExportScript.Tools.dump(lAccelerationUnits))
|
||||
ExportScript.Tools.SendDataDAC("732", (lAccelerationUnits.y > 8.0 and 1 or 0) ) -- lamp Over-G warning
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FuelQuantityIndicator(FunctionTyp)
|
||||
-- Fuel quantity shows the fuel remaining in all tanks
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
local lEngineInfo = LoGetEngineInfo()
|
||||
if lEngineInfo == nil then
|
||||
return
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo))
|
||||
--[[
|
||||
[fuel_external] = number: "0"
|
||||
[Temperature] = {
|
||||
[left] = number: "626.99444580078"
|
||||
[right] = number: "626.99444580078"
|
||||
}
|
||||
[RPM] = {
|
||||
[left] = number: "87.453765869141"
|
||||
[right] = number: "87.453758239746"
|
||||
}
|
||||
[FuelConsumption] = {
|
||||
[left] = number: "0.1500396137767"
|
||||
[right] = number: "0.1500396137767"
|
||||
}
|
||||
[fuel_internal] = number: "3773.2749023438"
|
||||
[EngineStart] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
[HydraulicPressure] = {
|
||||
[left] = number: "210"
|
||||
[right] = number: "210"
|
||||
}
|
||||
lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank
|
||||
]]
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
lTotalFuel = lEngineInfo.fuel_internal
|
||||
--ExportScript.Tools.WriteToLog('lTotalFuel: '..ExportScript.Tools.dump(lTotalFuel))
|
||||
--lTotalFuel = string.format("%3d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)
|
||||
--lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg
|
||||
--lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg
|
||||
local lTotalFuel_12_0 = 1.0
|
||||
|
||||
if lTotalFuel < 12000 then
|
||||
--[[
|
||||
y_min = 0.0 -- minimaler Ausgabewert
|
||||
y_max = 1.0 -- maximaler Ausgabewert
|
||||
x_min = 0 -- minimaler Eingangswert
|
||||
x_max = 12000 -- maximaler Eingangswert
|
||||
x = 8000 -- aktueller Eingangswert
|
||||
|
||||
d_y = 1 -- Delta Ausgabewerte (y_max - y_min)
|
||||
d_x = 12000 -- Delta Eingangswerte (x_max - x_min)
|
||||
m = 8.3333333333333333333333333333333e-5 -- Steigung der linearen Funktion (d_y / d_x)
|
||||
n = 4.e-33 -- Schnittpunkt der Funktion mit y-Achse (y_max - m * x_max)
|
||||
|
||||
y = 0.66666666666666666666666666666667 -- Ergebnis (m * x + n)
|
||||
]]
|
||||
lTotalFuel_12_0 = 8.3333333333333333333333333333333e-5 * lTotalFuel + 4.e-33
|
||||
end
|
||||
|
||||
ExportScript.Tools.SendData("301", string.format("%.4f", lTotalFuel_12_0) )
|
||||
ExportScript.Tools.SendData("304", (lEngineInfo.fuel_internal < 6900.0 and 1 or 0) ) -- Tank warning 1
|
||||
ExportScript.Tools.SendData("305", (lEngineInfo.fuel_internal < 5400.0 and 1 or 0) ) -- Tank warning 2
|
||||
ExportScript.Tools.SendData("306", (lEngineInfo.fuel_internal < 4700.0 and 1 or 0) ) -- Tank warning 3
|
||||
ExportScript.Tools.SendData("307", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0) ) -- Tank warning 4
|
||||
ExportScript.Tools.SendData("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0) ) -- Bingo Fuel
|
||||
|
||||
ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.fuel_internal, 10000, 302) -- Standby Fuel Indicator
|
||||
end
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("300", string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10) ) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("301", string.format("%d", lEngineInfo.fuel_internal) ) -- total fuel in kg
|
||||
--ExportScript.Tools.SendDataDAC("302", string.format("%d", lEngineInfo.fuel_external) ) -- external fuel in kg
|
||||
|
||||
ExportScript.Tools.SendDataDAC("304", (lEngineInfo.fuel_internal < 6900.0 and 1 or 0) ) -- Tank warning 1
|
||||
ExportScript.Tools.SendDataDAC("305", (lEngineInfo.fuel_internal < 5400.0 and 1 or 0) ) -- Tank warning 2
|
||||
ExportScript.Tools.SendDataDAC("306", (lEngineInfo.fuel_internal < 4700.0 and 1 or 0) ) -- Tank warning 3
|
||||
ExportScript.Tools.SendDataDAC("307", (lEngineInfo.fuel_internal < 1500.0 and 1 or 0) ) -- Tank warning 4
|
||||
ExportScript.Tools.SendDataDAC("308", (lEngineInfo.fuel_internal < 600.0 and 1 or 0) ) -- Bingo Fuel
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.MechanicalDevicesIndicator(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
-- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake
|
||||
local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,...
|
||||
--ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo))
|
||||
if lMechInfo == nil then
|
||||
return
|
||||
end
|
||||
--[[
|
||||
[hook] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[parachute] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[controlsurfaces] = {
|
||||
[eleron] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "-0.21084336936474"
|
||||
}
|
||||
[elevator] = {
|
||||
[left] = number: "-0"
|
||||
[right] = number: "-0"
|
||||
}
|
||||
[rudder] = {
|
||||
[left] = number: "0"
|
||||
[right] = number: "0"
|
||||
}
|
||||
}
|
||||
[airintake] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[canopy] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[refuelingboom] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wing] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[noseflap] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[gear] = {
|
||||
[value] = number: "0"
|
||||
[nose] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[main] = {
|
||||
[left] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
[right] = {
|
||||
[rod] = number: "0"
|
||||
}
|
||||
}
|
||||
[status] = number: "0"
|
||||
}
|
||||
[speedbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[wheelbrakes] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}
|
||||
[flaps] = {
|
||||
[status] = number: "0"
|
||||
[value] = number: "0"
|
||||
}]]
|
||||
--local lTrueAirSpeed = LoGetTrueAirSpeed()
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
ExportScript.Tools.SendDataDAC("500", (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1 or 0 ) ) -- gear warning light
|
||||
ExportScript.Tools.SendDataDAC("501", (lMechInfo.gear.value > 0.85 and 1 or 0) ) -- nose gear
|
||||
ExportScript.Tools.SendDataDAC("502", (lMechInfo.gear.value > 0.95 and 1 or 0) ) -- left gear
|
||||
ExportScript.Tools.SendDataDAC("503", (lMechInfo.gear.value > 0.97 and 1 or 0) ) -- right gear
|
||||
|
||||
ExportScript.Tools.SendDataDAC("510", (lMechInfo.speedbrakes.value > 0.1 and 1 or 0) ) -- speedbreakes on > 0.1 (0 - 1)
|
||||
|
||||
ExportScript.Tools.SendDataDAC("531", (lMechInfo.flaps.value > 0.93 and 1 or 0) ) -- flap
|
||||
ExportScript.Tools.SendDataDAC("532", ((lMechInfo.gear.value > 0.5 and lMechInfo.gear.nose.rod > 0.02) and 1 or 0) ) -- Intake FOD shields
|
||||
ExportScript.Tools.SendDataDAC("533", ((lMechInfo.gear.status == 0 and lMechInfo.flaps.status > 0) and 1 or 0) ) -- Flaps Warning, same light as gear warning light, but blinking light
|
||||
|
||||
ExportScript.Tools.SendDataDAC("541", (lMechInfo.hook.value > 0.8 and 1 or 0) ) -- Hook
|
||||
ExportScript.Tools.SendDataDAC("551", (lMechInfo.noseflap.value > 20.0 and 1 or 0) )
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
local lWarningLight = 0.0
|
||||
|
||||
--lWarningLight = ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1.0 or 0.0) -- Speed Warning for Flaps, same light as gear warning light, but blinking light
|
||||
lWarningLight = ((lMechInfo.gear.status == 0 and lMechInfo.flaps.status > 0) and 1.0 or lWarningLight ) -- Flaps Warning, same light as gear warning light, but blinking light
|
||||
lWarningLight = (((lMechInfo.gear.status == 1 and lMechInfo.gear.value < 1) or (lMechInfo.gear.status == 0 and lMechInfo.gear.value > 0)) and 1.0 or lWarningLight ) -- gear warning light
|
||||
|
||||
ExportScript.Tools.SendData(500, string.format("%.1f", lWarningLight))
|
||||
ExportScript.Tools.SendData(501, (lMechInfo.gear.value > 0.85 and 1 or 0)) -- nose gear
|
||||
ExportScript.Tools.SendData(502, (lMechInfo.gear.value > 0.95 and 1 or 0)) -- left gear
|
||||
ExportScript.Tools.SendData(503, (lMechInfo.gear.value == 1 and 1 or 0)) -- right gear
|
||||
ExportScript.Tools.SendData(510, (lMechInfo.speedbrakes.value > 0.1 and 1 or 0)) -- speedbreakes on > 0.1 (0 - 1)
|
||||
ExportScript.Tools.SendData(531, (lMechInfo.flaps.value > 0.93 and 1 or 0)) -- flap
|
||||
ExportScript.Tools.SendData(532, ((lMechInfo.gear.value > 0.5 and lMechInfo.gear.nose.rod > 0.02) and 1 or 0)) -- Intake FOD shields
|
||||
ExportScript.Tools.SendData(541, (lMechInfo.hook.value > 0.8 and 1 or 0)) -- Hook
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.AF.FC_WeaponPanel_SU33(FunctionTyp)
|
||||
local lFunctionTyp = FunctionTyp or "Ikarus"
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanelPresend == nil then
|
||||
ExportScript.AF.TmpWeaponPanelPresend = {[101] = 0, [102] = 0, [103] = 0, [104] = 0, [105] = 0, [106] = 0, [107] = 0, [108] = 0, [109] = 0, [110] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanelActive == nil then
|
||||
ExportScript.AF.TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpWeaponPanel == nil then
|
||||
ExportScript.AF.TmpWeaponPanel = {[231] = 0, [232] = 0, [233] = 0, [234] = 0, [235] = 0}
|
||||
end
|
||||
|
||||
if ExportScript.AF.EventNumberFC_WeaponPanel == nil then
|
||||
ExportScript.AF.EventNumberFC_WeaponPanel = 0
|
||||
end
|
||||
|
||||
if(ExportScript.AF.EventNumberFC_WeaponPanel < ExportScript.AF.EventNumber) then
|
||||
ExportScript.AF.EventNumberFC_WeaponPanel = ExportScript.AF.EventNumber
|
||||
|
||||
-- defination
|
||||
ExportScript.AF.PayloadInfo = LoGetPayloadInfo()
|
||||
if ExportScript.AF.PayloadInfo ~= nil then
|
||||
if ExportScript.AF.CurrentStationTmp == nil then
|
||||
ExportScript.AF.CurrentStationTmp = -1
|
||||
end
|
||||
|
||||
if ExportScript.AF.PayloadInfo.CurrentStation > 0 and
|
||||
ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then
|
||||
ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation
|
||||
|
||||
ExportScript.AF.TmpStationToPanel = {}
|
||||
--ExportScript.AF.TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- L
|
||||
--ExportScript.AF.TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- L
|
||||
ExportScript.AF.TmpStationToPanel[3] = {Panel = 10, StationID = 110, CurrentID = 210 }
|
||||
ExportScript.AF.TmpStationToPanel[4] = {Panel = 1, StationID = 101, CurrentID = 201 }
|
||||
ExportScript.AF.TmpStationToPanel[5] = {Panel = 2, StationID = 102, CurrentID = 202 }
|
||||
ExportScript.AF.TmpStationToPanel[6] = {Panel = 9, StationID = 109, CurrentID = 209 }
|
||||
ExportScript.AF.TmpStationToPanel[7] = {Panel = 3, StationID = 103, CurrentID = 203 }
|
||||
ExportScript.AF.TmpStationToPanel[8] = {Panel = 8, StationID = 108, CurrentID = 208 }
|
||||
ExportScript.AF.TmpStationToPanel[9] = {Panel = 4, StationID = 104, CurrentID = 204 }
|
||||
ExportScript.AF.TmpStationToPanel[10] = {Panel = 7, StationID = 107, CurrentID = 207 }
|
||||
ExportScript.AF.TmpStationToPanel[11] = {Panel = 6, StationID = 106, CurrentID = 206 }
|
||||
ExportScript.AF.TmpStationToPanel[12] = {Panel = 5, StationID = 105, CurrentID = 205 }
|
||||
|
||||
-- ExportScript.AF.TmpWeaponPanelActive reset
|
||||
for i = 201, 210, 1 do
|
||||
ExportScript.AF.TmpWeaponPanelActive[i] = 0
|
||||
end
|
||||
|
||||
if ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation] ~= nil then
|
||||
ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value
|
||||
|
||||
table.foreach(ExportScript.AF.PayloadInfo.Stations, ExportScript.AF.WeaponStatusPanel_selectCurrentPayloadStation) -- corresponding station
|
||||
end
|
||||
end
|
||||
|
||||
local lWeaponType = 0.0 -- transversely striped
|
||||
if ExportScript.AF.PayloadInfo.CurrentStation > 0 then
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level1 == 4 then
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle
|
||||
lWeaponType = 0.1 -- MSL
|
||||
elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container
|
||||
if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket
|
||||
lWeaponType = 0.2 -- RCT
|
||||
end
|
||||
elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb
|
||||
lWeaponType = 0.3 -- BB
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Weapon Panel (Numper = Station number)
|
||||
|
|
||||
-------------------------------------------------------
|
||||
| | | | | | | | | | | |
|
||||
L 1 2 3 4 5 6 7 8 9 10 R -- Panel ID
|
||||
1 4 5 7 9 12 11 10 8 6 3 2 -- gES_PayloadInfo.Station.ID
|
||||
]]
|
||||
-- Payload Info
|
||||
-- weapon stations L and R not on Panel
|
||||
-- weapon station 1 (left) to 10 (right), 5 and 6 center station
|
||||
|
||||
-- WeaponPresend1 {0, 1}
|
||||
-- WeaponPresend2 {0, 1}
|
||||
-- WeaponPresend3 {0, 1}
|
||||
-- WeaponPresend4 {0, 1}
|
||||
-- WeaponPresend5 {0, 1}
|
||||
-- WeaponPresend6 {0, 1}
|
||||
-- WeaponPresend7 {0, 1}
|
||||
-- WeaponPresend8 {0, 1}
|
||||
-- WeaponPresend9 {0, 1}
|
||||
-- WeaponPresend10 {0, 1}
|
||||
-- WeaponActive1 {0, 1}
|
||||
-- WeaponActive2 {0, 1}
|
||||
-- WeaponActive3 {0, 1}
|
||||
-- WeaponActive4 {0, 1}
|
||||
-- WeaponActive5 {0, 1}
|
||||
-- WeaponActive6 {0, 1}
|
||||
-- WeaponActive7 {0, 1}
|
||||
-- WeaponActive8 {0, 1}
|
||||
-- WeaponActive9 {0, 1}
|
||||
-- WeaponActive10 {0, 1}
|
||||
|
||||
--ExportScript.AF.TmpWeaponPanelPresend[] = (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0) -- L
|
||||
--ExportScript.AF.TmpWeaponPanelPresend[] = (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0) -- R
|
||||
ExportScript.AF.TmpWeaponPanelPresend[110] = (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0) -- weapon presend panel 1
|
||||
ExportScript.AF.TmpWeaponPanelPresend[101] = (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0) -- weapon presend panel 10
|
||||
ExportScript.AF.TmpWeaponPanelPresend[102] = (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0) -- weapon presend panel 2
|
||||
ExportScript.AF.TmpWeaponPanelPresend[109] = (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0) -- weapon presend panel 9
|
||||
ExportScript.AF.TmpWeaponPanelPresend[103] = (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0) -- weapon presend panel 3
|
||||
ExportScript.AF.TmpWeaponPanelPresend[108] = (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0) -- weapon presend panel 8
|
||||
ExportScript.AF.TmpWeaponPanelPresend[104] = (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0) -- weapon presend panel 4
|
||||
ExportScript.AF.TmpWeaponPanelPresend[107] = (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0) -- weapon presend panel 7
|
||||
ExportScript.AF.TmpWeaponPanelPresend[106] = (ExportScript.AF.PayloadInfo.Stations[11].count > 0 and 1 or 0) -- weapon presend panel 5
|
||||
ExportScript.AF.TmpWeaponPanelPresend[105] = (ExportScript.AF.PayloadInfo.Stations[12].count > 0 and 1 or 0) -- weapon presend panel 6
|
||||
--ExportScript.AF.TmpWeaponPanelActive[201] -- weapon active panel 1
|
||||
--ExportScript.AF.TmpWeaponPanelActive[202] -- weapon active panel 2
|
||||
--ExportScript.AF.TmpWeaponPanelActive[203] -- weapon active panel 3
|
||||
--ExportScript.AF.TmpWeaponPanelActive[204] -- weapon active panel 4
|
||||
--ExportScript.AF.TmpWeaponPanelActive[205] -- weapon active panel 5
|
||||
--ExportScript.AF.TmpWeaponPanelActive[206] -- weapon active panel 6
|
||||
--ExportScript.AF.TmpWeaponPanelActive[207] -- weapon active panel 7
|
||||
--ExportScript.AF.TmpWeaponPanelActive[208] -- weapon active panel 8
|
||||
--ExportScript.AF.TmpWeaponPanelActive[209] -- weapon active panel 9
|
||||
--ExportScript.AF.TmpWeaponPanelActive[210] -- weapon active panel 10
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do
|
||||
ExportScript.Tools.SendData(key, value)
|
||||
end
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do
|
||||
ExportScript.Tools.SendData(key, value)
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do
|
||||
ExportScript.Tools.SendDataDAC(key, value)
|
||||
end
|
||||
for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do
|
||||
ExportScript.Tools.SendDataDAC(key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,310 @@
|
||||
-- TF-51D Export
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.TF51D = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- 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
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
|
||||
function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
end
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
--=====================================================================================
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
-- Custom functions --
|
||||
-----------------------------
|
||||
@@ -0,0 +1,907 @@
|
||||
-- Uh-1H
|
||||
|
||||
ExportScript.FoundDCSModule = true
|
||||
ExportScript.Version.UH1H = "1.2.0"
|
||||
|
||||
ExportScript.ConfigEveryFrameArguments =
|
||||
{
|
||||
--[[
|
||||
every frames arguments
|
||||
based of "mainpanel_init.lua"
|
||||
Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
|
||||
[DeviceID] = "Format"
|
||||
[4] = "%.4f", <- floating-point number with 4 digits after point
|
||||
[19] = "%0.1f", <- floating-point number with 1 digit after point
|
||||
[129] = "%1d", <- decimal number
|
||||
[5] = "%.f", <- floating point number rounded to a decimal number
|
||||
]]
|
||||
-- Controlls Pilot
|
||||
--[184] = "%.4f", -- rudder
|
||||
--[187] = "%.4f", -- stick_roll
|
||||
--[186] = "%.4f", -- stick_pitch
|
||||
--[200] = "%.4f", -- collective_position
|
||||
-- Controlls CoPilot
|
||||
--[185] = "%.4f", -- rudder_add
|
||||
--[191] = "%.4f", -- stick_roll_sec
|
||||
--[190] = "%.4f", -- stick_pitch_sec
|
||||
--[207] = "%.4f", -- collective_position_operator
|
||||
-- Gauges Pilot
|
||||
[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}
|
||||
[118] = "%0.4f", -- AIRSPEED_Roof {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}
|
||||
-- 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
|
||||
-- ADF_ARN83
|
||||
[45] = "%0.2f", -- ADF_ARN83_Frequency {0.0, 1.0} {0.0, 0.55}
|
||||
[40] = "%.4f", -- ARN83_SignalLevel
|
||||
-- GMC
|
||||
[159] = "%.4f", -- GMC_CoursePointer1
|
||||
[160] = "%.4f", -- GMC_CoursePointer2
|
||||
[162] = "%.4f", -- GMC_HeadingMarker
|
||||
[165] = "%.4f", -- GMC_Heading
|
||||
[166] = "%.4f", -- GMC_Annunciator {-1.0, 1.0} {0.0, 1.0}
|
||||
[167] = "%.2f", -- GMC_PowerFail
|
||||
-- Copilot RMI
|
||||
[266] = "%.4f", -- RMI_CoursePointer1
|
||||
[267] = "%.4f", -- RMI_CoursePointer2
|
||||
[269] = "%.4f", -- RMI_Heading
|
||||
-- Altimeter Indicator AAU-32/A (operator)
|
||||
[168] = "%.4f", -- Pointer {0.0, 1000.0} {0.0, 1.0}
|
||||
[169] = "%.4f", -- Alt1AAU_10000_footCount {0.0, 10.0} {0.0, 1.0}
|
||||
[170] = "%.4f", -- Alt1AAU_1000_footCount {0.0, 10.0} {0.0, 1.0}
|
||||
[171] = "%.4f", -- Alt1AAU_100_footCount {0.0, 10.0} {0.0, 1.0}
|
||||
[174] = "%.2f", -- AAU_32_Drum_Counter {-2.0, 1.0} {0.0, 0.3}
|
||||
[175] = "%.2f", -- AAU_32_Drum_Counter {0.0, 10.0} {0.0, 1.0}
|
||||
[176] = "%.2f", -- AAU_32_Drum_Counter {0.0, 10.0} {0.0, 1.0}
|
||||
[177] = "%.1f", -- CodeOff_flag
|
||||
-- Altimeter Indicator AAU-7/A (pilot) (AAU-31/A)
|
||||
[178] = "%.4f", -- Alt_10000_AAU_7A {0.0, 100000.0} {0.0, 1.0}
|
||||
[179] = "%.4f", -- Alt_1000_AAU_7A {0.0, 10000.0} {0.0, 1.0}
|
||||
[180] = "%.4f", -- Alt_100_AAU_7A {0.0, 1000.0} {0.0, 1.0}
|
||||
[182] = "%.4f", -- Press_AAU_7A {28.1, 31.0} {0.0, 1.0}
|
||||
-- Gauges
|
||||
[113] = "%.4f", -- EngOilPress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0}
|
||||
[114] = "%.4f", -- EngOilTemp {-70.0, -50.0, 0.0, 100.0, 150.0} {0.0, 0.13, 0.38, 0.71, 1.0}
|
||||
[115] = "%.4f", -- TransmOilPress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0}
|
||||
[116] = "%.4f", -- TransmOilTemp {-70.0, -50.0, 0.0, 100.0, 150.0} {0.0, 0.13, 0.38, 0.71, 1.0}
|
||||
--[117] = "%.4f", -- AIRSPEED_Nose
|
||||
--[118] = "%.4f", -- AIRSPEED_Roof
|
||||
[121] = "%.4f", -- ExhaustTemp {0.0, 500.0, 600.0, 900.0, 1000.0} {0.0, 0.508, 0.604, 0.904, 1.0}
|
||||
[122] = "%.4f", -- EngineTach {0.0, 7200.0} {0.0, 1.0}
|
||||
[123] = "%.4f", -- RotorTach {0.0, 360.0} {0.0, 1.0}
|
||||
[119] = "%.4f", -- GasProducerTach {0.0, 101.5} {0.0, 1.0}
|
||||
[120] = "%.4f", -- GasProducerTach_U {0.0, 10.0} {0.0, 1.0}
|
||||
[124] = "%.4f", -- TorquePress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0}
|
||||
[149] = "%.4f", -- VoltageDC {0.0, 30.0} {0.0, 1.0}
|
||||
[150] = "%.4f", -- VoltageAC {0.0, 150.0} {0.0, 1.0}
|
||||
[436] = "%.4f", -- LoadmeterMainGen {-1.5, 0.0, 12.5} {0.0, 0.156, 1.0}
|
||||
[125] = "%.4f", -- LoadmeterSTBYGen {-1.5, 0.0, 12.5} {0.0, 0.09, 1.0}
|
||||
[126] = "%.4f", -- FuelPress {-2.0, 0.0, 50.0} {0.0, 0.015, 1.0}
|
||||
[239] = "%.4f", -- FuelQuantity {0.0, 1580.0} {0.0, 1.0}
|
||||
-- Mechanic clock
|
||||
[127] = "%.4f", -- CLOCK_hours {0.0, 12.0} {0.0, 1.0}
|
||||
[128] = "%.4f", -- CLOCK_minutes {0.0, 60.0} {0.0, 1.0}
|
||||
[129] = "%.4f", -- CLOCK_seconds {0.0, 60.0} {0.0, 1.0}
|
||||
--
|
||||
[132] = "%.4f", -- TurnPtr {-1.0, 1.0}
|
||||
[133] = "%.4f", -- SideSlip {-1.0, 1.0}
|
||||
[134] = "%.4f", -- 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}
|
||||
[251] = "%.4f", -- 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}
|
||||
-- ADI - pilot
|
||||
[142] = "%.4f", -- Attitude_Roll {1.0, -1.0}
|
||||
[143] = "%.4f", -- Attitude_Pitch {1.0, -1.0}
|
||||
[148] = "%.1f", -- Attitude_Off_flag
|
||||
-- ADI - operator
|
||||
[135] = "%.4f", -- Attitude_Roll_left {1.0, -1.0}
|
||||
[136] = "%.4f", -- Attitude_Pitch_left {1.0, -1.0}
|
||||
--[141] = "%.1f", -- Attitude_Off_flag_left {0.0, 1.0} {1.0, 0.0}
|
||||
[138] = "%.4f", -- Attitude_PitchShift {0.0, 1.0} {-1.0, 1.0}
|
||||
-- operator
|
||||
--[149] = "%.4f", -- DCVoltmeter
|
||||
--[150] = "%.4f", -- ACVoltmeter
|
||||
-- UHF_ARC51
|
||||
[10] = "%.4f", -- UHF_ARC51_Freq1 {2.0, 3.0} {0.0, 1.0}
|
||||
[11] = "%.4f", -- UHF_ARC51_Freq2 {0.0, 10.0} {0.0, 1.0}
|
||||
[12] = "%.4f", -- UHF_ARC51_Freq3 {0.0, 10.0} {0.0, 1.0}
|
||||
[13] = "%.4f", -- UHF_ARC51_Freq4 {0.0, 10.0} {0.0, 1.0}
|
||||
[14] = "%.4f", -- UHF_ARC51_Freq5 {0.0, 10.0} {0.0, 1.0}
|
||||
-- NAV_ARN82
|
||||
[46] = "%.4f", -- NAV_ARN82_Freq1 {0.0, 10.0} {0.0, 1.0}
|
||||
[47] = "%.4f", -- NAV_ARN82_Freq2 {0.0, 10.0} {0.0, 1.0}
|
||||
[48] = "%.4f", -- NAV_ARN82_Freq3 {0.0, 10.0} {0.0, 1.0}
|
||||
[49] = "%.4f", -- NAV_ARN82_Freq4 {0.0, 10.0} {0.0, 1.0}
|
||||
[50] = "%.4f", -- NAV_ARN82_Freq5 {0.0, 10.0} {0.0, 1.0}
|
||||
-- VHF_ARC134
|
||||
[1] = "%.4f", -- VHF_ARC134_Freq1 {0.0, 10.0} {0.0, 1.0}
|
||||
[2] = "%.4f", -- VHF_ARC134_Freq2 {0.0, 10.0} {0.0, 1.0}
|
||||
[3] = "%.4f", -- VHF_ARC134_Freq3 {0.0, 10.0} {0.0, 1.0}
|
||||
[4] = "%.4f", -- VHF_ARC134_Freq4 {0.0, 10.0} {0.0, 1.0}
|
||||
--
|
||||
[56] = "%.1f", -- Marker_Beacon_Lamp {0.0, 1.0} {0.0, 0.9}
|
||||
-- Panel_Shake
|
||||
--[264] = "%.1f", -- Panel_Shake_Z
|
||||
--[265] = "%.1f", -- Panel_Shake_Y
|
||||
--[282] = "%.1f", -- Panel_Rot_X
|
||||
-- Wiper
|
||||
--[284] = "%.4f", -- Wiper_Pilot
|
||||
--[283] = "%.4f", -- Wiper_Operator
|
||||
-- Pilot Model
|
||||
--[242] = "%.1f", -- Pilot_Model
|
||||
--[245] = "%.1f", -- Operator_Model
|
||||
-- Flexible sight station
|
||||
--[263] = "%.2f", -- FlexSightHeight
|
||||
--[261] = "%.4f", -- FlexSightAzimuth
|
||||
--[262] = "%.4f", -- FlexSightElevation
|
||||
-- Pilot sight station
|
||||
--[438] = "%.4f", -- PilotSightHeight
|
||||
--[442] = "%.2f", -- PilotSightGlass
|
||||
-- Light
|
||||
[279] = "%.4f", -- light_ConsoleLight
|
||||
[410] = "%.4f", -- light_DomeLight
|
||||
[411] = "%.4f", -- light_DomeLightGreen
|
||||
-- Damage
|
||||
--[248] = "%.1f", -- DeadPilot
|
||||
--[249] = "%.1f", -- DeadCoPilot
|
||||
--[414] = "%.4f", -- LeftWindShield
|
||||
--[413] = "%.4f", -- RightWindShield
|
||||
--[412] = "%.4f", -- DownBlisters
|
||||
--[417] = "%.4f", -- UpRightBlister
|
||||
--[418] = "%.4f", -- UpLeftBlister
|
||||
--[415] = "%.4f", -- RightWindow
|
||||
--[416] = "%.4f", -- LeftWindow
|
||||
--[422] = "%.4f", -- RightDoor
|
||||
--[420] = "%.4f", -- LeftDoor
|
||||
--
|
||||
[437] = "%.3f", -- RamTemp
|
||||
-- Radar Altimeter
|
||||
[443] = "%.4f", -- RALT_Needle {0.0, 0.98} {0.0, 0.98}
|
||||
[467] = "%.1f", -- RALT_Off_Flag
|
||||
[447] = "%.f", -- RALT_LO_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}
|
||||
[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}
|
||||
[469] = "%0.1f", -- RALT_Digit_2 {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}
|
||||
-- FLARE CHAFF
|
||||
[460] = "%.1f", -- FLARE_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
||||
[461] = "%.1f", -- FLARE_Digit_2 {0.0, 10.0} {0.0, 1.0}
|
||||
[462] = "%.1f", -- CHAFF_Digit_1 {0.0, 10.0} {0.0, 1.0}
|
||||
[463] = "%.1f", -- CHAFF_Digit_2 {0.0, 10.0} {0.0, 1.0}
|
||||
-- XM130 Chaff Flare
|
||||
[458] = "%.f", -- lamp_XM130_ARMED
|
||||
-- SIGHTS_FOR_CIVIL
|
||||
[473] = "%.1f", -- SIGHTS_FOR_CIVIL
|
||||
-- Main Panel Lights
|
||||
[277] = "%.f", -- lamp_MASTER
|
||||
[276] = "%.f", -- lamp_LOW_RPM
|
||||
[275] = "%.f", -- lamp_FIRE
|
||||
-- Caution Panel Lights
|
||||
[91] = "%.f", -- lamp_ENGINE_OIL_PRESS
|
||||
[92] = "%.f", -- lamp_ENGINE_ICING
|
||||
[93] = "%.f", -- lamp_ENGINE_ICE_JET
|
||||
[94] = "%.f", -- lamp_ENGINE_CHIP_DET
|
||||
[95] = "%.f", -- lamp_LEFT_FUEL_BOOST
|
||||
[96] = "%.f", -- lamp_RIGHT_FUEL_BOOST
|
||||
[97] = "%.f", -- lamp_ENG_FUEL_PUMP
|
||||
[98] = "%.f", -- lamp_20_MINUTE
|
||||
[99] = "%.f", -- lamp_FUEL_FILTER
|
||||
[100] = "%.f", -- lamp_GOV_EMERG
|
||||
[101] = "%.f", -- lamp_AUX_FUEL_LOW
|
||||
[102] = "%.f", -- lamp_XMSN_OIL_PRESS
|
||||
[103] = "%.f", -- lamp_XMSN_OIL_HOT
|
||||
[104] = "%.f", -- lamp_HYD_PRESSURE
|
||||
[105] = "%.f", -- lamp_ENGINE_INLET_AIR
|
||||
[106] = "%.f", -- lamp_INST_INVERTER
|
||||
[107] = "%.f", -- lamp_DC_GENERATOR
|
||||
[108] = "%.f", -- lamp_EXTERNAL_POWER
|
||||
[109] = "%.f", -- lamp_CHIP_DETECTOR
|
||||
[110] = "%.f", -- lamp_IFF
|
||||
-- M21
|
||||
[254] = "%.f", -- lamp_M21_ARMED
|
||||
[255] = "%.f", -- lamp_M21_SAFE
|
||||
--
|
||||
[76] = "%.f", -- lamp_IFF_REPLY
|
||||
[77] = "%.f", -- lamp_IFF_TEST
|
||||
-- Electic Gauges
|
||||
[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}
|
||||
[527] = "%.4f", -- DC_battery_I_current {0.0, 400.0} {0.0, 1.0}
|
||||
[528] = "%.4f", -- DC_battery_II_current {0.0, 400.0} {0.0, 1.0}
|
||||
[529] = "%.4f", -- DC_VU_I_current {0.0, 400.0} {0.0, 1.0}
|
||||
[530] = "%.4f", -- DC_VU_II_current {0.0, 400.0} {0.0, 1.0}
|
||||
[531] = "%.4f", -- DC_VU_III_current {0.0, 400.0} {0.0, 1.0}
|
||||
[533] = "%.2f", -- AC_generator_I_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}
|
||||
-- Magnetic Compass
|
||||
--[272] = "%.4f", -- Heading
|
||||
[273] = "%.4f", -- Roll
|
||||
[274] = "%.4f" -- Pitch
|
||||
}
|
||||
ExportScript.ConfigArguments =
|
||||
{
|
||||
--[[
|
||||
arguments for export in low tick interval
|
||||
based on "clickabledata.lua"
|
||||
]]
|
||||
-- Electrosystem
|
||||
[219] = "%1d", -- Battery
|
||||
[220] = "%1d", -- Starter/Stdby GEN
|
||||
[218] = "%.1f", -- DC Voltmeter Selector BAT, MAIN GEN, STBY GEN, ESS BUS, NON-ESS BUS {0.0,0.1,0.2,0.3,0.4}
|
||||
[221] = "%1d", -- Non Essential bus
|
||||
[214] = "%.1f", -- AC Voltmeter Selector AB, AC PHASE, BC {0.0,0.1,0.2}
|
||||
[215] = "%1d", -- Inverter MAIN/OFF/SPARE {-1.0,0.0,1.0}
|
||||
-- Electrosystem circuit breakers
|
||||
-- Essential BUS. line 1
|
||||
[285] = "%1d", -- CB IFF APX 1 (N/F)
|
||||
[287] = "%1d", -- CB IFF APX 2 (N/F)
|
||||
[289] = "%1d", -- CB Prox. warn.(N/F)
|
||||
[291] = "%1d", -- CB Marker beacon
|
||||
[293] = "%1d", -- CB VHF Nav. (ARN-82)
|
||||
[295] = "%1d", -- CB LF Nav. (ARN-83)
|
||||
[297] = "%1d", -- CB Intercom CPLT(N/F)
|
||||
[299] = "%1d", -- CB Intercom PLT
|
||||
[349] = "%1d", -- CB ARC-102 HF Static INVTR(N/F)
|
||||
[351] = "%1d", -- CB HF ANT COUPLR(N/F)
|
||||
[353] = "%1d", -- CB HF ARC-102(N/F)
|
||||
[355] = "%1d", -- CB FM Radio
|
||||
[357] = "%1d", -- CB UHF Radio
|
||||
[359] = "%1d", -- CB FM 2 Radio(N/F)
|
||||
[361] = "%1d", -- CB VHF AM Radio
|
||||
[321] = "%1d", -- CB Pitot tube(N/F)
|
||||
[345] = "%1d", -- CB Rescue hoist CTL(N/F)
|
||||
[347] = "%1d", -- CB Rescue hoist cable cutter (N/F)
|
||||
-- Essential BUS. line 2
|
||||
[303] = "%1d", -- CB Wind wiper PLT
|
||||
[301] = "%1d", -- CB Wind wiper CPLT
|
||||
[305] = "%1d", -- CB KY-28 voice security(N/F)
|
||||
[403] = "%1d", -- CB Starter Relay(N/F)
|
||||
[307] = "%1d", -- CB Search light power(N/F)
|
||||
[309] = "%1d", -- CB Landing light power(N/F)
|
||||
[311] = "%1d", -- CB Landing & Search light control(N/F)
|
||||
[313] = "%1d", -- CB Anticollision light(N/F)
|
||||
[363] = "%1d", -- CB Fuselage lights(N/F)
|
||||
[365] = "%1d", -- CB Navigation lights(N/F)
|
||||
[367] = "%1d", -- CB Dome lights(N/F)
|
||||
[369] = "%1d", -- CB Cockpit lights(N/F)
|
||||
[371] = "%1d", -- CB Caution lights(N/F)
|
||||
[373] = "%1d", -- CB Console lights(N/F)
|
||||
[375] = "%1d", -- CB INST Panel lights(N/F)
|
||||
[377] = "%1d", -- CB INST SEC lights(N/F)
|
||||
[323] = "%1d", -- CB Cabin heater (Outlet valve)(N/F)
|
||||
[325] = "%1d", -- CB Cabin heater (Air valve)(N/F)
|
||||
[343] = "%1d", -- CB Rescue hoist PWR(N/F)
|
||||
-- Essential BUS. line 3
|
||||
[327] = "%1d", -- CB RPM Warning system(N/F)
|
||||
[329] = "%1d", -- CB Engine anti-ice(N/F)
|
||||
[331] = "%1d", -- CB Fire detector(N/F)
|
||||
[333] = "%1d", -- CB LH fuel boost pump(N/F)
|
||||
[335] = "%1d", -- CB Turn & Slip indicator
|
||||
[337] = "%1d", -- CB TEMP indicator(N/F)
|
||||
[339] = "%1d", -- CB HYD Control(N/F)
|
||||
[341] = "%1d", -- CB FORCE Trim(N/F)
|
||||
[379] = "%1d", -- CB Cargo hook release(N/F)
|
||||
[381] = "%1d", -- CB EXT Stores jettison(N/F)
|
||||
[383] = "%1d", -- CB Spare inverter PWR(N/F)
|
||||
[385] = "%1d", -- CB Inverter CTRL (N/F)
|
||||
[387] = "%1d", -- CB Main inverter PWR(N/F)
|
||||
[389] = "%1d", -- CB Generator & Bus Reset(N/F)
|
||||
[391] = "%1d", -- CB STBY Generator Field(N/F)
|
||||
[393] = "%1d", -- CB Governor Control(N/F)
|
||||
[395] = "%1d", -- CB IDLE Stop release(N/F)
|
||||
[397] = "%1d", -- CB RH fuel boost pump(N/F)
|
||||
[399] = "%1d", -- CB Fuel TRANS(N/F)
|
||||
[401] = "%1d", -- CB Fuel valves(N/F)
|
||||
-- Non Essential BUS
|
||||
[315] = "%1d", -- CB Heated blanket 1(N/F)
|
||||
[317] = "%1d", -- CB Heated blanket 2(N/F)
|
||||
[319] = "%1d", -- CB Voltmeter Non Ess Bus(N/F)
|
||||
-- other circuit breakers
|
||||
[405] = "%1d", -- CB Ignition system(N/F)
|
||||
-- AC BUS circuit breakers
|
||||
[423] = "%1d", -- CB Pilot ATTD1(N/F)
|
||||
[424] = "%1d", -- CB Pilot ATTD2(N/F)
|
||||
[425] = "%1d", -- CB Copilot ATTD1(N/F)
|
||||
[426] = "%1d", -- CB Copilot ATTD2(N/F)
|
||||
[427] = "%1d", -- CB Gyro Cmps(N/F)
|
||||
[428] = "%1d", -- CB Fuel Quantity(N/F)
|
||||
[429] = "%1d", -- CB 28V Trans(N/F)
|
||||
[430] = "%1d", -- CB Fail Relay(N/F)
|
||||
[431] = "%1d", -- CB Pressure Fuel(N/F)
|
||||
[432] = "%1d", -- CB Pressure Torque(N/F)
|
||||
[433] = "%1d", -- CB Pressure XMSN(N/F)
|
||||
[434] = "%1d", -- CB Pressure Eng(N/F)
|
||||
[435] = "%1d", -- CB Course Ind(N/F)
|
||||
--
|
||||
[238] = "%1d", -- Pitot Heater
|
||||
[216] = "%1d", -- Main generator (ON/OFF/RESET) {-1, 0, 1}
|
||||
[217] = "%1d", -- Main generator switch cover
|
||||
--
|
||||
[111] = "%1d", -- Reset/Test switch {-1, 0, 1}
|
||||
[112] = "%1d", -- Bright/Dim switch {-1, 0, 1}
|
||||
-- Fuel system
|
||||
[81] = "%1d", -- Main Fuel
|
||||
[240] = "%1d", -- Test Fuel Gauge
|
||||
--Transponder APX-72
|
||||
[58] = "%.1f", -- Code ZERO/B/A/HOLD input{-1.0,0.0,1.0} output{0.0,0.1,0.2,0.3}
|
||||
[59] = "%.1f", -- Master OFF/STBY/LOW/NOMR/EMER {0.0,0.1,0.2,0.3,0.4}
|
||||
[60] = "%1d", -- Audio/light
|
||||
|
||||
[61] = "%1d", -- Test M-1 {-1, 0, 1}
|
||||
[62] = "%1d", -- Test M-2 {-1, 0, 1}
|
||||
[63] = "%1d", -- Test M-3A {-1, 0, 1}
|
||||
[64] = "%1d", -- Test M-C {-1, 0, 1}
|
||||
--
|
||||
[65] = "%1d", -- RAD Test/Mon {-1, 0, 1}
|
||||
[66] = "%1d", -- Ident/Mic {-1, 0, 1}
|
||||
-- IFF
|
||||
[67] = "%1d", -- IFF On/Out
|
||||
|
||||
[68] = "%.2f", -- MODE1-WHEEL1 0/1/2/3 {0.0,0.33,0.66,0.99}
|
||||
[69] = "%.2f", -- MODE1-WHEEL2 0/1/2/3/4/5/6/7 {0.0,0.11,0.22,0.33,0.44,0.55,0.66,0.77}
|
||||
|
||||
[70] = "%.2f", -- MODE3A-WHEEL1 0/1/2/3/4/5/6/7 {0.0,0.11,0.22,0.33,0.44,0.55,0.66,0.77}
|
||||
[71] = "%.2f", -- MODE3A-WHEEL2 0/1/2/3/4/5/6/7 {0.0,0.11,0.22,0.33,0.44,0.55,0.66,0.77}
|
||||
[72] = "%.2f", -- MODE3A-WHEEL3 0/1/2/3/4/5/6/7 {0.0,0.11,0.22,0.33,0.44,0.55,0.66,0.77}
|
||||
[73] = "%.2f", -- MODE3A-WHEEL4 0/1/2/3/4/5/6/7 {0.0,0.11,0.22,0.33,0.44,0.55,0.66,0.77}
|
||||
|
||||
[74] = "%1d", -- Reply test, Button
|
||||
[78] = "%.4f", -- Reply test, (Axis) {0.0,1.0} in 0.1 steps
|
||||
|
||||
[75] = "%1d", -- Test test, Button
|
||||
[79] = "%4f", -- Test test, (Axis) {0.0,1.0} in 0.1 steps
|
||||
|
||||
[130] = "%1d", -- Winding/Adjustment Clock (Axis) {0.0,1.0} in 0.04 steps
|
||||
[131] = "%1d", -- Winding/Adjustment Clock, Button
|
||||
-- ENGINE INTERFACE
|
||||
[250] = "%.4f", -- Throttle (Axis) {-1.0, 0.4} in -0.1 steps
|
||||
[206] = "%1d", -- Throttle Stop
|
||||
|
||||
[84] = "%1d", -- De-Ice On/Off
|
||||
[80] = "%1d", -- Low RPM Warning
|
||||
[86] = "%1d", -- Chip Detector {-1, 0, 1}
|
||||
[85] = "%1d", -- Governor Emer/Auto
|
||||
[90] = "%1d", -- Hydraulic Control
|
||||
[89] = "%1d", -- Force Trim
|
||||
[203] = "%1d", -- Governor {-1, 0, 1}
|
||||
[278] = "%1d", -- Fire Test
|
||||
-- ADI OPERATOR
|
||||
-- Copilot's attutude indicator
|
||||
[140] = "%1d", -- Cage Copilot's Attitude Indicator, Button
|
||||
[146] = "%.4f", -- Attitude Indicator Pitch Trim Knob (Axis) {0.0,1.0} in 0.1 steps
|
||||
-- ADI PILOT
|
||||
[145] = "%.4f", -- Attitude Indicator Pitch Trim Knob (Axis) {0.0,1.0} in 0.1 steps
|
||||
[144] = "%.4f", -- Attitude Indicator Roll Trim Knob (Axis) {0.0,1.0} in 0.1 steps
|
||||
-- AAU32
|
||||
-- Copilot's altimeter
|
||||
[172] = "%.4f", -- Pressure Adjustment (Axis) {0.0,1.0} in 0.2 steps
|
||||
-- AAU7
|
||||
-- Pilot's altimeter
|
||||
[181] = "%.4f", -- Pressure Adjustment (Axis) {0.0,1.0} in 0.2 steps
|
||||
-- VHF ARC-134
|
||||
[6] = "%1d", -- Comm Test Button
|
||||
[7] = "%.2f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Button {0.85, 1.0}
|
||||
[5] = "%.1f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
[8] = "%.2f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume (Axis) {0.0, 0.65} in 0.05 Steps
|
||||
[9] = "%.1f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume (Axis) {0.0, 1.0} in 0.1 Steps
|
||||
-- Intercom Control Panel
|
||||
[29] = "%.4f", -- Intercom volume (Axis) {0.3,1.0} in 0.1 Steps
|
||||
[23] = "%1d", -- VHF AM Radio Receiver
|
||||
[24] = "%1d", -- UHF Radio Receiver
|
||||
[25] = "%1d", -- VHF FM Radio Receiver
|
||||
[26] = "%1d", -- Receiver 4 N/F
|
||||
[27] = "%1d", -- INT Receiver
|
||||
[28] = "%1d", -- Receiver NAV
|
||||
[30] = "%.1f", -- Intercom Mode (PVT - hot line; INT - interphone; 1 - VHF FM transmitter; 2 - UHF transmitter; 3 - VHF AM transmitter; 4 - Not used) {0.0,0.1,0.2,0.3,0.4,0.5}
|
||||
[194] = "%.1f", -- Radio/ICS
|
||||
-- ARC 51BX UHF Raido
|
||||
[16] = "%.2f", -- Preset Channel Selector 1/2/.../19/20 {0.0,0.05,...,0.90,0.95}
|
||||
[18] = "%.4f", -- 10 MHz Selector (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[19] = "%.4f", -- 1 MHz Selector (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[20] = "%.4f", -- 50 kHz Selector (Axis) {0.0,1.0} in 0.1 Steps
|
||||
|
||||
[15] = "%.1f", -- Frequency Mode Dial {0.0,0.1,0.2}
|
||||
[17] = "%.1f", -- Function Dial {0.0,0.1,0.2,0.3}
|
||||
[22] = "%1d", -- Squelch
|
||||
[21] = "%.4f", -- Volume (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- VHF ARC 131
|
||||
[31] = "%.1f", -- Frequency Tens MHz {0.3,0.4,0.5,0.6,0.7}
|
||||
[32] = "%.1f", -- Frequency Ones MHz {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}
|
||||
[33] = "%.1f", -- Frequency Decimals MHz {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}
|
||||
[34] = "%.1f", -- Frequency Hundredths MHz {0.0,0.1}
|
||||
[35] = "%.1f", -- Mode OFF/TR/RETRAN(N/F)/HOME(N/F) {0.0,0.1,0.2,0.3}
|
||||
[36] = "%.1f", -- quelch Mode {0.0,0.1,0.2}
|
||||
[37] = "%.4f", -- Volume (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- ARN-82
|
||||
[52] = "%.2f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Button {0.8, 1.0}
|
||||
[51] = "%.4f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[53] = "%.4f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume (Axis) {0.0, 0.65} in 0.15 Steps
|
||||
[54] = "%.4f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- Marker beakon
|
||||
[57] = "%.4f", -- Marker beacon On/Off/Volume (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[55] = "%1d", -- Marker beacon sensing
|
||||
-- AN/ARN-83
|
||||
[42] = "%.1f", -- ADF Loop Antenna speed Left/Nom/Right {0.1,0.2,0.3}
|
||||
[41] = "%1d", -- BFO (N/F)
|
||||
[43] = "%.1f", -- Gain control / Mode. Right mouse click to cycle mode. Rotate mouse wheel to adjust gain (Axis) OFF/ADF/ANT/LOOP {0.0,0.3} in 0.1 Steps
|
||||
[44] = "%.4f", -- Gain control / Mode. Right mouse click to cycle mode. Rotate mouse wheel to adjust gain (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[38] = "%1d", -- Tune control / Band selection. Right mouse click to select a band. Rotate mouse wheel to adjust tune 190/400/800 {-1.0,0.0,1.0}
|
||||
[39] = "%.4f", -- Tune control / Band selection. Right mouse click to select a band. Rotate mouse wheel to adjust tune (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- Nav lights
|
||||
[222] = "%.1f", -- Navigation lights, OFF/1/2/3/4/BRT {0.0,0.1,0.2,0.3,0.4,0.5}
|
||||
[223] = "%1d", -- Position Lights, STEADY/OFF/FLASH {-1.0,0.0,1.0}
|
||||
[224] = "%1d", -- Position Lights, DIM/BRIGHT
|
||||
[225] = "%1d", -- Anti-Collision Lights, ON/OFF
|
||||
[202] = "%1d", -- Landing Light
|
||||
[201] = "%1d", -- Search Light
|
||||
[205] = "%1d", -- Landing Light Ctrl
|
||||
-- Light System
|
||||
[230] = "%.4f", -- Overhead Console Panel Lights Brightness Rheostat (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[231] = "%.4f", -- Pedestal Lights Brightness Rheostat (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[232] = "%.4f", -- Secondary Instrument Lights Brightness Rheostat (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[233] = "%.4f", -- Engine Instrument Lights Brightness Rheostat (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[234] = "%.4f", -- Copilot Instrument Lights Brightness Rheostat (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[235] = "%.4f", -- Pilot Instrument Lights Brightness Rheostat (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[226] = "%1d", -- Dome Light Ctrl
|
||||
-- HEATING SYSTEM
|
||||
[236] = "%.1f", -- Bleed Air, OFF/1/2/3/4 {0.0,0.1,0.2,0.3,0.4}
|
||||
-- GCI(ID-998/ASN)
|
||||
[163] = "%.4f", -- Heading Set Knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[161] = "%.4f", -- Compass Synchronizing (Axis) {0.0,1.0} in 0.05 Steps
|
||||
[164] = "%1d", -- ADF/VOR control
|
||||
[241] = "%1d", -- DG/Slave gyro mode
|
||||
-- COURSE IND
|
||||
[155] = "%.4f", -- Course select knob (Axis) {0.0,1.0} in 0.1 Steps
|
||||
-- weapon system
|
||||
[252] = "%1d", -- Armed/Safe/Off {-1.0,0.0,1.0}
|
||||
[253] = "%1d", -- Left/Right/All {-1.0,0.0,1.0}
|
||||
[256] = "%1d", -- 7.62/2.75/40 {-1.0,0.0,1.0}
|
||||
[257] = "%.1f", -- Rocket Pair {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7}
|
||||
[258] = "%1d", -- Rocket Reset
|
||||
[259] = "%1d", -- Jettison Cover
|
||||
[260] = "%1d", -- Jettison
|
||||
-- sighting station
|
||||
[281] = "%.4f", -- Sighting Station Intensity (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[408] = "%1d", -- Sighting Station Lamp Switch BACKUP/OFF/MAIN {-1.0,0.0,1.0}
|
||||
|
||||
--[0] = "%1d", -- Pilot Sight Armed/Safe ??
|
||||
[439] = "%1d", -- Pilot Sight On/Off
|
||||
[440] = "%.4f", -- Pilot Sighting Station Intensity (Axis) {0.0,1.0} in 0.1 Steps
|
||||
[441] = "%.4f", -- Sight Elevation (Axis) {-1.0,1.0} in 0.1 Steps
|
||||
-- Windshield Wipers
|
||||
[227] = "%1d", -- Pilot/Both/Operator {-1.0,0.0,1.0}
|
||||
[229] = "%.1f", -- Wipers Speed PARK/OFF/LOW/MED/HIGH input{-1.0,0.0,1.0} output{0.0,0.1,0.2,0.3,0.4}
|
||||
-- Stick
|
||||
[189] = "%1d", -- Force Trim ON/OFF (Pilot)
|
||||
[193] = "%1d", -- Force Trim ON/OFF (CoPilot)
|
||||
-- Cargo Equipment
|
||||
[195] = "%1d", -- Cargo Release Pilot
|
||||
[198] = "%1d", -- Cargo Release CoPilot
|
||||
[228] = "%1d", -- Cargo Safety
|
||||
-- XM 130 Chaff Flare
|
||||
[450] = "%1d", -- Ripple Fire Cover
|
||||
[451] = "%1d", -- Ripple Fire
|
||||
[456] = "%1d", -- SAFE/ARMED Switcher
|
||||
[459] = "%1d", -- MAN/PGRM Mode
|
||||
[464] = "%1d", -- Flare Dispense
|
||||
[457] = "%1d", -- Armed lamp Test
|
||||
[453] = "%1d", -- Flare counter Reset. Rotate mouse wheel to set Number, Button
|
||||
[452] = "%.4f", -- Flare counter Reset. Rotate mouse wheel to set Number (Axis) {0.0,1.0} in 0.2 Steps
|
||||
[455] = "%1d", -- Chaff counter Reset. Rotate mouse wheel to set Number, Button
|
||||
[454] = "%.4f", -- Chaff counter Reset. Rotate mouse wheel to set Number (Axis) {0.0,1.0} in 0.2 Steps
|
||||
-- Radar Altimeter
|
||||
[449] = "%1d", -- Radar Altimeter Power
|
||||
[445] = "%.4f", -- Turn On. Low Set.
|
||||
[446] = "%1d", -- Test / Hight Set. Left mouse click to Test. Rotate mouse wheel to set Hight, Button
|
||||
[464] = "%.4f", -- Test / Hight Set. Left mouse click to Test. Rotate mouse wheel to set Hight (Axis) {0.0,1.0} in 0.2 Steps
|
||||
-- Doors
|
||||
[419] = "%1d", -- Open Left Doors
|
||||
[421] = "%1d" -- Open Right Doors
|
||||
}
|
||||
|
||||
-----------------------------
|
||||
-- HIGH IMPORTANCE EXPORTS --
|
||||
-- done every export event --
|
||||
-----------------------------
|
||||
|
||||
-- Pointed to by ProcessIkarusDCSHighImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to Ikarus
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
-- Magnetic Compass
|
||||
--[272] = "%.4f", -- Heading
|
||||
ExportScript.Tools.SendData(272, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(272)))) -- negate
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
-- ADI Pilot
|
||||
--[142] = "%.4f", -- Attitude_Roll {1.0, -1.0}
|
||||
--ExportScript.Tools.SendData(142, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(142)))) -- negate
|
||||
-- ADI - operator
|
||||
--[135] = "%.4f", -- Attitude_Roll_left {1.0, -1.0}
|
||||
--ExportScript.Tools.SendData(135, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(135)))) -- negate
|
||||
end
|
||||
|
||||
-----------------------------------------------------
|
||||
-- LOW IMPORTANCE EXPORTS --
|
||||
-- done every gExportLowTickInterval export events --
|
||||
-----------------------------------------------------
|
||||
|
||||
-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
|
||||
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
|
||||
--[[
|
||||
export in low tick interval to GlassCockpit
|
||||
Example from A-10C
|
||||
Get Radio Frequencies
|
||||
get data from device
|
||||
local lUHFRadio = GetDevice(54)
|
||||
ExportScript.Tools.SendData("ExportID", "Format")
|
||||
ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- Cockpit Light
|
||||
ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, {230, 231, 232, 233, 234, 235})
|
||||
-- Overhead Console Panel Lights Brightness Rheostat, Pedestal Lights Brightness Rheostat, Secondary Instrument Lights Brightness Rheostat, Engine Instrument Lights Brightness Rheostat, Copilot Instrument Lights Brightness Rheostat, Pilot Instrument Lights Brightness Rheostat, Axis
|
||||
|
||||
-- ADI, disable needles and flags
|
||||
ExportScript.Tools.SendData(2100, -1.0) -- Horizontal yellow needle
|
||||
ExportScript.Tools.SendData(2101, -1.0) -- Vertical yellow needle
|
||||
ExportScript.Tools.SendData(2102, -1.0) -- Left white needle
|
||||
|
||||
-- ADI - operator
|
||||
--[141] = "%.1f", -- Attitude_Off_flag_left {0.0, 1.0} {1.0, 0.0}
|
||||
ExportScript.Tools.SendData(141, string.format("%.4f", ExportScript.Tools.negate(mainPanelDevice:get_argument_value(141)))) -- negate
|
||||
|
||||
-- Radio
|
||||
local lVHF_ARC_134 = GetDevice(20)
|
||||
--ExportScript.Tools.SendData(2003, string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2003, ExportScript.Tools.RoundFreqeuncy(lVHF_ARC_134:get_frequency()/1000000))
|
||||
|
||||
local lUHF_ARC_51 = GetDevice(22)
|
||||
--ExportScript.Tools.SendData(2000, string.format("%6.2f", lUHF_ARC_51:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy(lUHF_ARC_51:get_frequency()/1000000, "6.2", false, 0.050))
|
||||
|
||||
local lVHF_ARC_131 = GetDevice(23)
|
||||
--ExportScript.Tools.SendData(2002, string.format("%5.2f", lVHF_ARC_131:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendData(2002, ExportScript.Tools.RoundFreqeuncy(lVHF_ARC_131:get_frequency()/1000000, "5.2"))
|
||||
|
||||
ExportScript.Tools.SendData(2005, string.format("%02d", 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
|
||||
ExportScript.Tools.SendData(2006, string.format("%02d", 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
|
||||
|
||||
--[[
|
||||
-- ARN_82 VHF Navigation Set NOT FUNCTIONAL
|
||||
--local lARN_82 = GetDevice(26)
|
||||
--ExportScript.Tools.WriteToLog('lARN_82: '..ExportScript.Tools.dump(lARN_82))
|
||||
--ExportScript.Tools.WriteToLog('lARN_82 (metatable): '..ExportScript.Tools.dump(getmetatable(lARN_82)))
|
||||
--ExportScript.Tools.SendData(2004, string.format("%6.2f", lVHF_ARC_134:get_frequency()/1000000))
|
||||
]]
|
||||
--[[
|
||||
-- ADF_ARN83
|
||||
local lpos1, pos2, lpos3, pos4
|
||||
local lADF_ARN83 = ""
|
||||
local lCockpitParams = list_cockpit_params()
|
||||
if lCockpitParams ~= nil then
|
||||
--ExportScript.Tools.WriteToLog('lCockpitParams: '..ExportScript.Tools.dump(lCockpitParams))
|
||||
lpos1, pos2 = lCockpitParams:find("ADF_FREQ:", 1)
|
||||
if pos2 ~= nil then
|
||||
lpos3, pos4 = lCockpitParams:find("%c", pos2)
|
||||
if lpos3 ~= nil then
|
||||
lADF_ARN83 = lCockpitParams:sub(pos2 + 1, lpos3 - 2)
|
||||
else
|
||||
lADF_ARN83 = lCockpitParams:sub(pos2 + 1)
|
||||
end
|
||||
--ExportScript.Tools.WriteToLog('lADF_ARN83: '..ExportScript.Tools.dump(lADF_ARN83))
|
||||
lADF_ARN83 = ExportScript.Tools.round(tonumber(lADF_ARN83) / 1000, 2)
|
||||
end
|
||||
end
|
||||
ExportScript.Tools.SendData(2007, string.format("%s", lADF_ARN83))
|
||||
]]
|
||||
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", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
|
||||
]]
|
||||
|
||||
-- Radio comunication
|
||||
-- UHF_ARC_51
|
||||
local lUHF_ARC_51 = GetDevice(22)
|
||||
--ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lUHF_ARC_51:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy(lUHF_ARC_51:get_frequency()/1000000, "7.3", false, 0.050))
|
||||
|
||||
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"}
|
||||
ExportScript.Tools.SendDataDAC("2001", lUHF_ARC_51_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(16), 2)])
|
||||
|
||||
-- VHF_ARC_131
|
||||
local lVHF_ARC_131 = GetDevice(23)
|
||||
--ExportScript.Tools.SendDataDAC("2002", string.format("%7.3f", lVHF_ARC_131:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2002", ExportScript.Tools.RoundFreqeuncy(lVHF_ARC_131:get_frequency()/1000000))
|
||||
|
||||
-- VHF_ARC_134
|
||||
local lVHF_ARC_134 = GetDevice(20)
|
||||
--ExportScript.Tools.SendDataDAC("2003", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
||||
ExportScript.Tools.SendDataDAC("2003", ExportScript.Tools.RoundFreqeuncy(lVHF_ARC_134:get_frequency()/1000000))
|
||||
|
||||
-- ARN_82 VHF Navigation Set NOT FUNCTIONAL
|
||||
--local lARN_82 = GetDevice(26)
|
||||
--ExportScript.Tools.WriteToLog('lARN_82: '..ExportScript.Tools.dump(lARN_82))
|
||||
--ExportScript.Tools.WriteToLog('lARN_82 (metatable): '..ExportScript.Tools.dump(getmetatable(lARN_82)))
|
||||
--ExportScript.Tools.SendDataDAC("2004", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000))
|
||||
|
||||
-- XM130 FLARE CHAFF
|
||||
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
|
||||
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
|
||||
local lpos1, pos2, lpos3, pos4
|
||||
local lADF_ARN83 = ""
|
||||
local lCockpitParams = list_cockpit_params()
|
||||
if lCockpitParams ~= nil then
|
||||
lpos1, pos2 = lCockpitParams:find("ADF_FREQ:", 1)
|
||||
if pos2 ~= nil then
|
||||
lpos3, pos4 = lCockpitParams:find("%c", pos2)
|
||||
if lpos3 ~= nil then
|
||||
lADF_ARN83 = lCockpitParams:sub(pos2 + 1, lpos3 - 2)
|
||||
else
|
||||
lADF_ARN83 = lCockpitParams:sub(pos2 + 1)
|
||||
end
|
||||
lADF_ARN83 = ExportScript.Tools.round(tonumber(lADF_ARN83) / 1000, 2)
|
||||
end
|
||||
end
|
||||
|
||||
ExportScript.Tools.SendDataDAC("2007", string.format("%s", lADF_ARN83))
|
||||
|
||||
-- Radar Altimeter - AN/APN-209
|
||||
-- [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=' '
|
||||
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 = ""
|
||||
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[ExportScript.Tools.round(mainPanelDevice:get_argument_value(469), 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[ExportScript.Tools.round(mainPanelDevice:get_argument_value(471), 2)]
|
||||
ExportScript.Tools.SendDataDAC("2008", string.format("%s", lAN_APN_209))
|
||||
|
||||
--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))
|
||||
|
||||
-- generic Radio display and frequency rotarys
|
||||
-------------------------------------------------
|
||||
-- genericRadioConf
|
||||
ExportScript.genericRadioConf = {}
|
||||
ExportScript.genericRadioConf['maxRadios'] = 3 -- numbers of aviables/supported radios
|
||||
ExportScript.genericRadioConf[1] = {} -- first radio
|
||||
ExportScript.genericRadioConf[1]['Name'] = "AN/ARC-131 VHF FM" -- name of radio
|
||||
ExportScript.genericRadioConf[1]['DeviceID'] = 23 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[1]['minFrequency'] = 100.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[1]['maxFrequency'] = 399.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[1]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3008 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active
|
||||
ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3006 -- volume button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active
|
||||
-- ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 161 -- ManualPreset argument id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
-- ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20",[1.00]="01"}
|
||||
-- ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.05 -- minimal step for preset change
|
||||
ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 36 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3005 -- squelch button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.1 -- squelch on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 0.0 -- squelch off value from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset
|
||||
-- ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3015 -- load button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active
|
||||
-- ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 167 -- ManualPreset argument id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[2] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[2]['Name'] = "AN/ARC-51BX UHF AM" -- name of radio
|
||||
ExportScript.genericRadioConf[2]['DeviceID'] = 22 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[2]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[2]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[2]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[2]['FrequencyStep'] = 50 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[2]['minFrequency'] = 225.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[2]['maxFrequency'] = 399.950 -- highest frequency
|
||||
ExportScript.genericRadioConf[2]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[2]['Power']['ButtonID'] = 3006 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Volume'] = {} -- volume knob active
|
||||
ExportScript.genericRadioConf[2]['Volume']['ButtonID'] = 3008 -- volume button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Preset'] = {} -- preset knob active
|
||||
ExportScript.genericRadioConf[2]['Preset']['ArgumentID'] = 16 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
ExportScript.genericRadioConf[2]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"}
|
||||
ExportScript.genericRadioConf[2]['Preset']['Step'] = 0.05 -- minimal step for preset change
|
||||
ExportScript.genericRadioConf[2]['Squelch'] = {} -- squelch switch active
|
||||
ExportScript.genericRadioConf[2]['Squelch']['ArgumentID'] = 134 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Squelch']['ButtonID'] = 3007 -- squelch button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Squelch']['ValueOn'] = 1.0 -- squelch on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Squelch']['ValueOff'] = 0.0 -- squelch off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['Load'] = {} -- load button preset
|
||||
ExportScript.genericRadioConf[2]['Load']['ButtonID'] = 3006 -- load button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['ManualPreset'] = {} -- switch manual or preset active
|
||||
ExportScript.genericRadioConf[2]['ManualPreset']['ArgumentID'] = 135 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['ManualPreset']['ButtonID'] = 3005 -- ManualPreset button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['ManualPreset']['ValueManual'] = 0.1-- ManualPreset Manual value from cklickable.lua
|
||||
ExportScript.genericRadioConf[2]['ManualPreset']['ValuePreset'] = 0.0-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadioConf[3] = {} -- secound radio
|
||||
ExportScript.genericRadioConf[3]['Name'] = "AN/ARC-134 VHF AM" -- name of radio
|
||||
ExportScript.genericRadioConf[3]['DeviceID'] = 20 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[3]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[3]['FrequencyMultiplicator'] = 1000000 -- Multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[3]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[3]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[3]['minFrequency'] = 100.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[3]['maxFrequency'] = 399.975 -- highest frequency
|
||||
ExportScript.genericRadioConf[3]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[3]['Power']['ButtonID'] = 3001 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOn'] = 1.0 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Power']['ValueOff'] = 0.85 -- power off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[3]['Volume'] = {} -- volume knob active
|
||||
ExportScript.genericRadioConf[3]['Volume']['ButtonID'] = 3003 -- volume button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Preset'] = {} -- preset knob active
|
||||
-- ExportScript.genericRadioConf[3]['Preset']['ArgumentID'] = 151 -- ManualPreset argument id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Preset']['ButtonID2'] = 3002 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
-- ExportScript.genericRadioConf[3]['Preset']['List'] = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="01"}
|
||||
-- ExportScript.genericRadioConf[3]['Preset']['Step'] = 0.01 -- minimal step for preset change
|
||||
-- ExportScript.genericRadioConf[3]['Preset']['Step2'] = -0.01 -- minimal step for preset change
|
||||
-- ExportScript.genericRadioConf[3]['Squelch'] = {} -- squelch switch active
|
||||
-- ExportScript.genericRadioConf[3]['Squelch']['ArgumentID'] = 148 -- ManualPreset argument id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Squelch']['ButtonID'] = 3008 -- squelch button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Squelch']['ValueOff'] = -1.0 -- squelch off value from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['Load'] = {} -- load button preset
|
||||
-- ExportScript.genericRadioConf[3]['Load']['ButtonID'] = 3004 -- load button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['ManualPreset'] = {} -- switch manual or preset active
|
||||
-- ExportScript.genericRadioConf[3]['ManualPreset']['ArgumentID'] = 149 -- ManualPreset argument id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['ManualPreset']['ButtonID'] = 3004 -- ManualPreset button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['ManualPreset']['ValueManual'] = 0.2-- ManualPreset Manual value from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[3]['ManualPreset']['ValuePreset'] = 0.3-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
ExportScript.genericRadio(nil, nil)
|
||||
|
||||
--[[
|
||||
-- ENGINE_INTERFACE
|
||||
local lENGINE_INTERFACE = GetDevice(3)
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_rpm '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_rpm()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_fire_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_fire_lamp()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_gas_prod_tach '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_gas_prod_tach()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_fire_test_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_fire_test_lamp()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_trans_oil_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_trans_oil_temp()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_torq '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_torq()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_trans_oil_press '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_trans_oil_press()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_exhaust_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_exhaust_temp()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_low_rpm_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_low_rpm_lamp()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_oil_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_oil_temp()))
|
||||
ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_oil_press '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_oil_press()))
|
||||
|
||||
-- ADI_PILOT
|
||||
local lADI_PILOT = GetDevice(6)
|
||||
ExportScript.Tools.WriteToLog('lADI_PILOT:get_sideslip '..ExportScript.Tools.dump(lADI_PILOT:get_sideslip()))
|
||||
ExportScript.Tools.WriteToLog('lADI_PILOT:get_bank '..ExportScript.Tools.dump(lADI_PILOT:get_bank()))
|
||||
ExportScript.Tools.WriteToLog('lADI_PILOT:get_pitch '..ExportScript.Tools.dump(lADI_PILOT:get_pitch()))
|
||||
|
||||
-- RADAR_ALTIMETER
|
||||
local lRADAR_ALTIMETER = GetDevice(13)
|
||||
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_distance_limit()))
|
||||
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_aperture_size()))
|
||||
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_mode '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_mode()))
|
||||
ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_altitude '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_altitude()))
|
||||
]]
|
||||
--[[
|
||||
-- VHF_ARC_134
|
||||
local lVHF_ARC_134 = GetDevice(20)
|
||||
ExportScript.Tools.WriteToLog('lVHF_ARC_134:is_on '..ExportScript.Tools.dump(lVHF_ARC_134:is_on()))
|
||||
ExportScript.Tools.WriteToLog('lVHF_ARC_134:get_frequency '..ExportScript.Tools.dump(lVHF_ARC_134:get_frequency()))
|
||||
--ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_frequency '..ExportScript.Tools.dump(lVHF_ARC_134:set_frequency())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_modulation '..ExportScript.Tools.dump(lVHF_ARC_134:set_modulation())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_channel '..ExportScript.Tools.dump(lVHF_ARC_134:set_channel())) -- test parameters
|
||||
|
||||
-- INTERCOM
|
||||
local lINTERCOM = GetDevice(21)
|
||||
ExportScript.Tools.WriteToLog('lINTERCOM:is_communicator_available '..ExportScript.Tools.dump(lINTERCOM:is_communicator_available()))
|
||||
ExportScript.Tools.WriteToLog('lINTERCOM:get_noise_level '..ExportScript.Tools.dump(lINTERCOM:get_noise_level()))
|
||||
ExportScript.Tools.WriteToLog('lINTERCOM:get_signal_level '..ExportScript.Tools.dump(lINTERCOM:get_signal_level()))
|
||||
--ExportScript.Tools.WriteToLog('lINTERCOM:set_communicator '..ExportScript.Tools.dump(lINTERCOM:set_communicator())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lINTERCOM:set_voip_mode '..ExportScript.Tools.dump(lINTERCOM:set_voip_mode())) -- test parameters
|
||||
|
||||
-- UHF_ARC_51
|
||||
local lUHF_ARC_51 = GetDevice(22)
|
||||
ExportScript.Tools.WriteToLog('lUHF_ARC_51:is_on '..ExportScript.Tools.dump(lUHF_ARC_51:is_on()))
|
||||
ExportScript.Tools.WriteToLog('lUHF_ARC_51:get_frequency '..ExportScript.Tools.dump(lUHF_ARC_51:get_frequency()))
|
||||
--ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_frequency '..ExportScript.Tools.dump(lUHF_ARC_51:set_frequency())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_modulation '..ExportScript.Tools.dump(lUHF_ARC_51:set_modulation())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_channel '..ExportScript.Tools.dump(lUHF_ARC_51:set_channel())) -- test parameters
|
||||
|
||||
-- VHF_ARC_131
|
||||
local lVHF_ARC_131 = GetDevice(23)
|
||||
ExportScript.Tools.WriteToLog('lVHF_ARC_131:is_on '..ExportScript.Tools.dump(lVHF_ARC_131:is_on()))
|
||||
ExportScript.Tools.WriteToLog('lVHF_ARC_131:get_frequency '..ExportScript.Tools.dump(lVHF_ARC_131:get_frequency()))
|
||||
--ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_frequency '..ExportScript.Tools.dump(lVHF_ARC_131:set_frequency())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_modulation '..ExportScript.Tools.dump(lVHF_ARC_131:set_modulation())) -- test parameters
|
||||
--ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_channel '..ExportScript.Tools.dump(lVHF_ARC_131:set_channel())) -- test parameters
|
||||
|
||||
ExportScript.Tools.WriteToLog('Frequency Mode Dial '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(15)))
|
||||
ExportScript.Tools.WriteToLog('Function Dial '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(17)))
|
||||
]]
|
||||
--[[
|
||||
ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
|
||||
ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
|
||||
|
||||
-- list_indication get tehe value of cockpit displays
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 0, 20, 1 do
|
||||
ltmp1 = list_indication(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
end
|
||||
]]
|
||||
--[[
|
||||
-- getmetatable get function name from devices
|
||||
local ltmp1 = 0
|
||||
for ltmp2 = 1, 70, 1 do
|
||||
ltmp1 = GetDevice(ltmp2)
|
||||
ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
|
||||
ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
|
||||
end
|
||||
]]
|
||||
end
|
||||
@@ -0,0 +1,43 @@
|
||||
-- Ikarus and D.A.C. Export Script
|
||||
--
|
||||
-- Map Config File
|
||||
--
|
||||
-- Copyright by Michael aka McMicha 2014
|
||||
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||
--
|
||||
-- This file contains the data to identify the loaded map.
|
||||
--
|
||||
-- The data can be read in the editor.
|
||||
-- Load the corresponding map and read the latitude and longitude values and write specify the decimal degree format (convert from degrees, decimal to decimal degrees).
|
||||
-- Lat1 and Long1 contain the coordinates of the upper left corner.
|
||||
-- Lat2 and Long2 contain the coordinates of the lower right corner.
|
||||
--
|
||||
|
||||
ExportScript.Version.Maps = "1.2.0"
|
||||
|
||||
-- Maps
|
||||
ExportScript.Maps = {}
|
||||
-- Caucasus Map
|
||||
ExportScript.Maps.CaucasusBase = {}
|
||||
ExportScript.Maps.CaucasusBase.Lat1 = 48.384867 -- high left Latitude 48° 23. 92 N
|
||||
ExportScript.Maps.CaucasusBase.Long1 = 26.779467 -- high left Longitude 26° 46.768 E
|
||||
ExportScript.Maps.CaucasusBase.Lat2 = 38.865183 -- low right Latitude 38° 51.911 N
|
||||
ExportScript.Maps.CaucasusBase.Long2 = 47.14225 -- low right Longitude 47° 8.535 E
|
||||
-- Nevada (NTTR) Map
|
||||
ExportScript.Maps.Nevada = {} -- Nevada Map
|
||||
ExportScript.Maps.Nevada.Lat1 = 37.578333 -- high left Latitude 37° 34' 42" N
|
||||
ExportScript.Maps.Nevada.Long1 = -119.964722 -- high left Longitude 119° 57' 53" W
|
||||
ExportScript.Maps.Nevada.Lat2 = 34.651667 -- low right Latitude 34° 39' 06" N
|
||||
ExportScript.Maps.Nevada.Long2 = -114.536111 -- low right Longitude 114° 32' 10" W
|
||||
-- Normandy Map
|
||||
ExportScript.Maps.Normandy = {} -- Normandy Map
|
||||
ExportScript.Maps.Normandy.Lat1 = 53.85556 -- high left Latitude 53° 51' 20" N
|
||||
ExportScript.Maps.Normandy.Long1 = -15.02667 -- high left Longitude 15° 01' 36" W
|
||||
ExportScript.Maps.Normandy.Lat2 = 45.07167 -- low right Latitude 45° 04' 18" N
|
||||
ExportScript.Maps.Normandy.Long2 = 8.437222 -- low right Longitude 08° 26' 14" E
|
||||
-- Persian Gulf Map
|
||||
ExportScript.Maps.PersianGulf = {}
|
||||
ExportScript.Maps.PersianGulf.Lat1 = 30.50833 -- high left Latitude 30° 20.630 N
|
||||
ExportScript.Maps.PersianGulf.Long1 = 45.15167 -- high left Longitude 44° 54.906 E
|
||||
ExportScript.Maps.PersianGulf.Lat2 = 22.43528 -- low right Latitude 22° 24.127 N
|
||||
ExportScript.Maps.PersianGulf.Long2 = 61.67306 -- low right Longitude 61° 36.263 E
|
||||
@@ -0,0 +1,992 @@
|
||||
-- Ikarus and D.A.C. Export Script
|
||||
--
|
||||
-- Tools
|
||||
--
|
||||
-- Copyright by Michael aka McMicha 2014 - 2018
|
||||
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||
|
||||
ExportScript.Tools = {}
|
||||
ExportScript.Version.Tools = "1.2.0"
|
||||
|
||||
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.createUDPSender()
|
||||
ExportScript.socket = require("socket")
|
||||
|
||||
local lcreateUDPSender = ExportScript.socket.protect(function()
|
||||
ExportScript.UDPsender = ExportScript.socket.udp()
|
||||
ExportScript.socket.try(ExportScript.UDPsender:setsockname("*", 0))
|
||||
--ExportScript.socket.try(ExportScript.UDPsender:settimeout(.004)) -- set the timeout for reading the socket; 250 fps
|
||||
end)
|
||||
|
||||
local ln, lerror = lcreateUDPSender()
|
||||
if lerror ~= nil then
|
||||
ExportScript.Tools.WriteToLog("createUDPSender protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror))
|
||||
return
|
||||
end
|
||||
|
||||
ExportScript.Tools.WriteToLog("Create UDPSender")
|
||||
end
|
||||
|
||||
function ExportScript.Tools.createUDPListner()
|
||||
if ExportScript.Config.Listener then
|
||||
ExportScript.socket = require("socket")
|
||||
|
||||
local lcreateUDPListner = ExportScript.socket.protect(function()
|
||||
ExportScript.UDPListener = ExportScript.socket.udp()
|
||||
ExportScript.socket.try(ExportScript.UDPListener:setsockname("*", ExportScript.Config.ListenerPort))
|
||||
ExportScript.socket.try(ExportScript.UDPListener:settimeout(.001)) -- set the timeout for reading the socket; 250 fps
|
||||
end)
|
||||
|
||||
local ln, lerror = lcreateUDPListner()
|
||||
if lerror ~= nil then
|
||||
ExportScript.Tools.WriteToLog("createUDPListner protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror))
|
||||
return
|
||||
end
|
||||
|
||||
ExportScript.Tools.WriteToLog("Create UDPListner")
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.Tools.ProcessInput()
|
||||
local lCommand, lCommandArgs, lDevice
|
||||
-- C1,3001,4
|
||||
-- lComand = C
|
||||
-- lCommandArgs[1] = 1 => lDevice
|
||||
-- lCommandArgs[2] = 3001 => ButtonID
|
||||
-- lCommandArgs[3] = 4 => Value
|
||||
if ExportScript.Config.Listener then
|
||||
--local lInput,from,port = ExportScript.UDPListener:receivefrom()
|
||||
ExportScript.UDPListenerValues = {}
|
||||
|
||||
local lUDPListenerReceivefrom = ExportScript.socket.protect(function()
|
||||
--[[
|
||||
local try = ExportScript.socket.newtry(function()
|
||||
ExportScript.UDPListener:close()
|
||||
ExportScript.Tools.createUDPListner()
|
||||
end)
|
||||
ExportScript.UDPListenerValues.Input, ExportScript.UDPListenerValues.from, ExportScript.UDPListenerValues.port = try(ExportScript.UDPListener:receivefrom())
|
||||
]] -- Bei einer newtry Funktion wird im fehlerfall deren inhalt ausgeführt.
|
||||
ExportScript.UDPListenerValues.Input, ExportScript.UDPListenerValues.from, ExportScript.UDPListenerValues.port = ExportScript.socket.try(ExportScript.UDPListener:receivefrom())
|
||||
end)
|
||||
|
||||
local ln, lerror = lUDPListenerReceivefrom()
|
||||
if lerror ~= nil and lerror ~= "timeout" then
|
||||
ExportScript.Tools.WriteToLog("UDPListenerReceivefrom protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror))
|
||||
ExportScript.UDPListener:close()
|
||||
ExportScript.Tools.createUDPListner()
|
||||
end
|
||||
|
||||
local lInput, from, port = ExportScript.UDPListenerValues.Input, ExportScript.UDPListenerValues.from, ExportScript.UDPListenerValues.port
|
||||
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("lInput: "..ExportScript.Tools.dump(lInput)..", from: "..ExportScript.Tools.dump(from)..", port: "..ExportScript.Tools.dump(port))
|
||||
end
|
||||
if lInput then
|
||||
lCommand = string.sub(lInput,1,1)
|
||||
|
||||
if lCommand == "R" then -- R == Reset
|
||||
if ExportScript.Config.IkarusExport then
|
||||
ExportScript.Tools.ResetChangeValues()
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("Reset fuer Ikarus Daten")
|
||||
end
|
||||
end
|
||||
if ExportScript.Config.DACExport then
|
||||
ExportScript.Tools.ResetChangeValuesDAC()
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("Reset fuer DAC Daten")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (lCommand == "C") then
|
||||
lCommandArgs = ExportScript.Tools.StrSplit(string.sub(lInput,2),",")
|
||||
lDeviceID = tonumber(lCommandArgs[1])
|
||||
if lDeviceID < 1000 then
|
||||
-- DCS Modules
|
||||
lDevice = GetDevice(lCommandArgs[1])
|
||||
if ExportScript.FoundDCSModule and type(lDevice) == "table" then
|
||||
lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3])
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("performClickableAction for Device: "..lCommandArgs[1]..", ButtonID: "..lCommandArgs[2]..", Value: "..lCommandArgs[3])
|
||||
end
|
||||
end
|
||||
elseif lDeviceID == 1000 then
|
||||
-- ExportScript.genericRadio(key, value)
|
||||
if ExportScript.FoundDCSModule then
|
||||
ExportScript.genericRadio(lCommandArgs[2],lCommandArgs[3])
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("genericRadio, ButtonID: "..lCommandArgs[2]..", Value: "..lCommandArgs[3])
|
||||
end
|
||||
end
|
||||
elseif lDeviceID == 2000 then
|
||||
-- Flaming Cliffs Module (Buttons)
|
||||
if ExportScript.FoundFCModule then
|
||||
-- ComamndID > 3000, because DAC or Ikarus add 300 to CommandID
|
||||
local lComandID = (tonumber(lCommandArgs[2]) - 3000)
|
||||
if tonumber(lCommandArgs[3]) == 1.0 then
|
||||
LoSetCommand(lComandID)
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("LoSetCommand, CommandID: "..lComandID)
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif lDeviceID == 2001 then
|
||||
-- Flaming Cliffs Module (analog axies)
|
||||
if ExportScript.FoundFCModule then
|
||||
-- ComamndID > 3000, because DAC or Ikarus add 3000 to CommandID
|
||||
local lComandID = (tonumber(lCommandArgs[2]) - 3000)
|
||||
LoSetCommand(lComandID, lCommandArgs[3])
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("LoSetCommand, CommandID: "..lComandID..", Value: "..lCommandArgs[3])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.Tools.ProcessOutput()
|
||||
local coStatus
|
||||
--local currentTime = LoGetModelTime()
|
||||
|
||||
local lMyInfo = LoGetSelfData()
|
||||
if lMyInfo ~= nil then
|
||||
if ExportScript.ModuleName ~= lMyInfo.Name then
|
||||
ExportScript.NoLuaExportBeforeNextFrame = false
|
||||
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||
return
|
||||
end
|
||||
lMyInfo = nil
|
||||
end
|
||||
|
||||
local lDevice = GetDevice(0)
|
||||
if type(lDevice) == "table" and ExportScript.FoundDCSModule then
|
||||
|
||||
lDevice:update_arguments()
|
||||
|
||||
--if currentTime - ExportScript.lastExportTimeHI > ExportScript.Config.ExportInterval then
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("run hight importance export universally")
|
||||
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.Tools.WriteToLog("run hight importance export Ikarus")
|
||||
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.Tools.WriteToLog("run hight importance export DAC")
|
||||
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.WriteToLog("reset dcs ikarus")
|
||||
ExportScript.Tools.ResetChangeValues()
|
||||
end
|
||||
ExportScript.FirstNewDataSend = false
|
||||
else
|
||||
ExportScript.FirstNewDataSendCount = ExportScript.FirstNewDataSendCount - 1
|
||||
end
|
||||
|
||||
--ExportScript.lastExportTimeHI = currentTime
|
||||
ExportScript.lastExportTimeHI = ExportScript.lastExportTimeHI + ExportScript.Config.ExportInterval
|
||||
--end
|
||||
|
||||
--if currentTime - ExportScript.lastExportTimeLI > ExportScript.Config.ExportLowTickInterval then
|
||||
if ExportScript.lastExportTimeHI > ExportScript.Config.ExportLowTickInterval then
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("run low importance export universally")
|
||||
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.Tools.WriteToLog("run low importance export Ikarus")
|
||||
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.Tools.WriteToLog("run low importance export DAC")
|
||||
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
|
||||
end
|
||||
|
||||
--ExportScript.lastExportTimeLI = currentTime
|
||||
ExportScript.lastExportTimeHI = 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 currentTime - ExportScript.lastExportTimeHI > ExportScript.Config.ExportInterval then
|
||||
|
||||
if ExportScript.Config.IkarusExport then
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("run hight importance export Ikarus")
|
||||
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.Tools.WriteToLog("run hight importance export DAC")
|
||||
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.WriteToLog("reset fc ikarus")
|
||||
ExportScript.Tools.ResetChangeValues()
|
||||
end
|
||||
ExportScript.FirstNewDataSend = false
|
||||
else
|
||||
ExportScript.FirstNewDataSendCount = ExportScript.FirstNewDataSendCount - 1
|
||||
end
|
||||
|
||||
--ExportScript.lastExportTimeHI = currentTime
|
||||
ExportScript.lastExportTimeHI = ExportScript.lastExportTimeHI + ExportScript.Config.ExportInterval
|
||||
--end
|
||||
|
||||
--if currentTime - ExportScript.lastExportTimeLI > ExportScript.Config.ExportLowTickInterval then
|
||||
if ExportScript.lastExportTimeHI > ExportScript.Config.ExportLowTickInterval then
|
||||
if ExportScript.Config.IkarusExport then
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("run low importance export Ikarus")
|
||||
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.Tools.WriteToLog("run low importance export DAC")
|
||||
ExportScript.ProcessDACLowImportance(lDevice)
|
||||
else
|
||||
ExportScript.coProcessDACLowImportance = coroutine.create(ExportScript.ProcessDACLowImportance)
|
||||
coStatus = coroutine.resume( ExportScript.coProcessDACLowImportance, lDevice)
|
||||
end
|
||||
end
|
||||
|
||||
--ExportScript.lastExportTimeLI = currentTime
|
||||
ExportScript.lastExportTimeHI = 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
|
||||
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
|
||||
-- for part, pos in string.gmatch(str, lPat) do -- Lua Version > 5.1
|
||||
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
|
||||
|
||||
-- remove trailing and leading whitespace from string.
|
||||
function ExportScript.Tools.trim(s)
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
-- remove leading whitespace from string.
|
||||
function ExportScript.Tools.ltrim(s)
|
||||
return (s:gsub("^%s*", ""))
|
||||
end
|
||||
|
||||
-- remove trailing whitespace from string.
|
||||
function ExportScript.Tools.rtrim(s)
|
||||
local n = #s
|
||||
while n > 0 and s:find("^%s", n) do n = n - 1 end
|
||||
return s:sub(1, n)
|
||||
end
|
||||
-- The following more obvious implementation is generally not
|
||||
-- as efficient, particularly for long strings since Lua pattern matching
|
||||
-- starts at the left (though in special cases it is more efficient).
|
||||
-- Related discussion on p.197 of book "Beginning Lua Programming".
|
||||
--[[
|
||||
function ExportScript.Tools.rtrim(s)
|
||||
return (s:gsub("%s*$", ""))
|
||||
end
|
||||
]]
|
||||
|
||||
-- substitute variables into string.
|
||||
-- Example: subst("a=$(a),b=$(b)", {a=1, b=2}) --> "a=1,b=2".
|
||||
function ExportScript.Tools.subst(s, t)
|
||||
-- note: handle {a=false} substitution
|
||||
s = s:gsub("%$%(([%w_]+)%)", function(name)
|
||||
local val = t[name]
|
||||
return val ~= nil and tostring(val)
|
||||
end)
|
||||
return s
|
||||
end
|
||||
|
||||
--[[
|
||||
function ExportScript.Tools.round(num, idp)
|
||||
local lMult = 10^(idp or 0)
|
||||
return math.floor(num * lMult + 0.5) / lMult
|
||||
end
|
||||
]]
|
||||
|
||||
-- this function negate the numeric input values
|
||||
function ExportScript.Tools.negate(Input)
|
||||
if type(Input) == "number" then
|
||||
return (Input > 0.0 and (0 - Input) or (Input - Input - Input))
|
||||
else
|
||||
return Input
|
||||
end
|
||||
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 id == nil then
|
||||
ExportScript.Tools.WriteToLog("Export id is nil")
|
||||
return
|
||||
end
|
||||
if value == nil then
|
||||
ExportScript.Tools.WriteToLog("Value for id "..id.." is nil")
|
||||
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.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 id == nil then
|
||||
ExportScript.Tools.WriteToLog("Export id is nil")
|
||||
return
|
||||
end
|
||||
if value == nil then
|
||||
ExportScript.Tools.WriteToLog("Value for id "..id.." is nil")
|
||||
return
|
||||
end
|
||||
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 = ""
|
||||
|
||||
lES_SimID = ExportScript.SimID
|
||||
|
||||
local lPacket = lES_SimID .. table.concat(ExportScript.SendStrings, ExportScript.Config.IkarusSeparator) .. "\n"
|
||||
ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort))
|
||||
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("FlushData: send the following data to host: "..ExportScript.Config.IkarusHost..", Port: "..ExportScript.Config.IkarusPort..", Data: "..lPacket)
|
||||
end
|
||||
|
||||
ExportScript.SendStrings = {}
|
||||
ExportScript.PacketSize = 0
|
||||
else
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("FlushData: nothing sent")
|
||||
end
|
||||
end
|
||||
end
|
||||
]]
|
||||
|
||||
function ExportScript.Tools.FlushData()
|
||||
local lFlushData = ExportScript.socket.protect(function()
|
||||
if #ExportScript.SendStrings > 0 then
|
||||
local lES_SimID = ""
|
||||
|
||||
lES_SimID = ExportScript.SimID
|
||||
|
||||
local lPacket = lES_SimID .. table.concat(ExportScript.SendStrings, ExportScript.Config.IkarusSeparator) .. "\n"
|
||||
--ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort))
|
||||
local try = ExportScript.socket.newtry(function() ExportScript.UDPsender:close() ExportScript.Tools.createUDPSender() ExportScript.Tools.ResetChangeValues() end)
|
||||
try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort))
|
||||
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("FlushData: send to host: "..ExportScript.Config.IkarusHost..", Port: "..ExportScript.Config.IkarusPort..", Data: "..lPacket)
|
||||
end
|
||||
|
||||
ExportScript.SendStrings = {}
|
||||
ExportScript.PacketSize = 0
|
||||
else
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("FlushData: nothing sent")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local ln, lerror = lFlushData()
|
||||
if lerror ~= nil then
|
||||
ExportScript.Tools.WriteToLog("FlushData protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function ExportScript.Tools.FlushDataDAC(hardware)
|
||||
hardware = hardware or 1
|
||||
|
||||
if ExportScript.Config.DAC[hardware] == nil then
|
||||
ExportScript.Tools.WriteToLog("FlushDataDAC: unknown hardware ID '"..hardware.."'")
|
||||
return
|
||||
end
|
||||
|
||||
local lFlushDataDAC = ExportScript.socket.protect(function()
|
||||
if #ExportScript.SendStringsDAC[hardware] > 0 then
|
||||
local lPacket = ExportScript.SimID .. table.concat(ExportScript.SendStringsDAC[hardware], ExportScript.Config.DAC[hardware].Separator) .. "\n"
|
||||
--ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort))
|
||||
local try = ExportScript.socket.newtry(function() ExportScript.UDPsender:close() ExportScript.Tools.createUDPSender() ExportScript.Tools.ResetChangeValuesDAC() end)
|
||||
try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort))
|
||||
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("FlushDataDAC["..hardware.."]: send to host: "..ExportScript.Config.DAC[hardware].Host..", Port: "..ExportScript.Config.DAC[hardware].SendPort..", Data: "..lPacket)
|
||||
end
|
||||
|
||||
ExportScript.SendStringsDAC[hardware] = {}
|
||||
ExportScript.PacketSizeDAC[hardware] = 0
|
||||
else
|
||||
if ExportScript.Config.SocketDebug then
|
||||
ExportScript.Tools.WriteToLog("FlushDataDAC["..hardware.."]: nothing sent")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local ln, lerror = lFlushDataDAC()
|
||||
if lerror ~= nil then
|
||||
ExportScript.Tools.WriteToLog("FlushDataDAC protect: "..ExportScript.Tools.dump(ln)..", "..ExportScript.Tools.dump(lerror))
|
||||
end
|
||||
end
|
||||
|
||||
function ExportScript.Tools.ResetChangeValues()
|
||||
ExportScript.LastData = {}
|
||||
end
|
||||
|
||||
function ExportScript.Tools.ResetChangeValuesDAC()
|
||||
for i = 1, #ExportScript.Config.DAC, 1 do
|
||||
ExportScript.LastDataDAC[i] = {}
|
||||
end
|
||||
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
|
||||
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog("MyInfo: "..ExportScript.Tools.dump(lMyInfo))
|
||||
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)
|
||||
if ExportScript.Config.DACExport then
|
||||
ExportScript.Tools.SendDataDAC("File", lMyInfo.Name)
|
||||
for i=1, #ExportScript.Config.DAC, 1 do
|
||||
ExportScript.Tools.FlushDataDAC(i)
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport then
|
||||
ExportScript.Tools.SendData("File", lMyInfo.Name)
|
||||
end
|
||||
|
||||
ExportScript.Tools.WriteToLog("File '"..lModuleFile.."' loaded")
|
||||
|
||||
ExportScript.Tools.WriteToLog("Version:")
|
||||
for k,v in pairs(ExportScript.Version) do
|
||||
ExportScript.Tools.WriteToLog(k..": "..v)
|
||||
end
|
||||
|
||||
ExportScript.FirstNewDataSend = ExportScript.Config.FirstNewDataSend
|
||||
ExportScript.FirstNewDataSendCount = ExportScript.Config.FirstNewDataSendCount
|
||||
|
||||
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
|
||||
|
||||
if ExportScript.Config.IkarusExport then
|
||||
for Map, LatLong in pairs(ExportScript.Maps) do
|
||||
if lMyInfo.LatLongAlt.Lat > LatLong.Lat2 and lMyInfo.LatLongAlt.Lat < LatLong.Lat1 then
|
||||
if lMyInfo.LatLongAlt.Long > LatLong.Long1 and lMyInfo.LatLongAlt.Long < LatLong.Long2 then
|
||||
ExportScript.Tools.WriteToLog("Detected Map: "..Map)
|
||||
ExportScript.Tools.SendData("Map", Map)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ExportScript.Tools.FlushData()
|
||||
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("Version:")
|
||||
for k,v in pairs(ExportScript.Version) do
|
||||
ExportScript.Tools.WriteToLog(k..": "..v)
|
||||
end
|
||||
ExportScript.Tools.WriteToLog("Unknown Module Name: "..lMyInfo.Name)
|
||||
end
|
||||
end
|
||||
|
||||
-- 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
|
||||
|
||||
-- the function checks whether the cockpit light should be activated in ikarus on the basis of the parameters
|
||||
-- functional parameters, a single ID, or a table with IDs
|
||||
function ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, ExportIDs)
|
||||
local TmpExportIDs = ExportIDs or 0
|
||||
local TmpLight = false
|
||||
|
||||
if type(mainPanelDevice) ~= "table" then
|
||||
return
|
||||
end
|
||||
|
||||
if type(TmpExportIDs) == "table" then
|
||||
for key,value in pairs(TmpExportIDs) do
|
||||
if type(value) == "number" then
|
||||
if mainPanelDevice:get_argument_value(value) > 0.4 then
|
||||
TmpLight = true
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif type(TmpExportIDs) == "number" then
|
||||
if mainPanelDevice:get_argument_value(TmpExportIDs) > 0.4 then
|
||||
TmpLight = true
|
||||
end
|
||||
end
|
||||
|
||||
if TmpLight then
|
||||
ExportScript.Tools.SendData(2222, "1.0") -- Ikarus Cockpit Light on
|
||||
else
|
||||
ExportScript.Tools.SendData(2222, "0.0") -- Ikarus Cockpit Light off
|
||||
end
|
||||
end
|
||||
|
||||
-- The function returns a correctly formatted string with the given radio frequency.
|
||||
-- Frequency: MHz/KHz, format: e.g. "7.3" or "5.2", fill with leading zeros (default false), least value of frequency (default 0.025 (MHz))
|
||||
function ExportScript.Tools.RoundFreqeuncy(Freqeuncy, Format, PrefixZeros, LeastValue)
|
||||
local freqeuncy = Freqeuncy or 0.0
|
||||
local format = Format or "7.3"
|
||||
local prefixzeros = PrefixZeros or false
|
||||
local leastvalue = LeastValue or 0.025
|
||||
local tmpstring = ""
|
||||
local tmp1, tmp2, tmp3, tmp4 = 0, 0, 0, 0
|
||||
|
||||
local from ,to = string.find(format, "%.")
|
||||
tmp1 = string.sub(format, 0, to)
|
||||
tmp2 = string.sub(format, to)
|
||||
tmp1 = tonumber(string.sub(tmp1, string.find(tmp1, "%d+")))
|
||||
tmp2 = tonumber(string.sub(tmp2, string.find(tmp2, "%d+")))
|
||||
|
||||
local tmp3, tmp4 = math.modf(freqeuncy)
|
||||
local bla3, bla4 = math.modf(tmp4 / leastvalue)
|
||||
|
||||
tmpstring = (tmp3 + (bla3 * leastvalue ))
|
||||
|
||||
tmpstring = string.format("%."..tmp2.."f", tmpstring)
|
||||
|
||||
-- while string.len(tmpstring) < tmp1 do
|
||||
-- tmpstring = " "..tmpstring
|
||||
-- end
|
||||
|
||||
tmpstring = string.rep(" ", tmp1 - string.len(tmpstring))..tmpstring
|
||||
|
||||
if prefixzeros then
|
||||
tmpstring = string.gsub(tmpstring, " ", "0")
|
||||
end
|
||||
|
||||
return tmpstring
|
||||
end
|
||||
|
||||
-- The function return a table with values of given indicator
|
||||
-- The value is retrievable via a named index. e.g. TmpReturn.txt_digits
|
||||
function ExportScript.Tools.getListIndicatorValue(IndicatorID)
|
||||
local ListIindicator = list_indication(IndicatorID)
|
||||
local TmpReturn = {}
|
||||
|
||||
if ExportScript.Config.Debug then
|
||||
ExportScript.Tools.WriteToLog('list_indication('..IndicatorID..'): '..ExportScript.Tools.dump(ListIindicator))
|
||||
end
|
||||
|
||||
if ListIindicator == "" then
|
||||
return nil
|
||||
end
|
||||
|
||||
local ListindicatorMatch = ListIindicator:gmatch("-----------------------------------------\n([^\n]+)\n([^\n]*)\n")
|
||||
while true do
|
||||
local Key, Value = ListindicatorMatch()
|
||||
if not Key then
|
||||
break
|
||||
end
|
||||
TmpReturn[Key] = Value
|
||||
end
|
||||
|
||||
return TmpReturn
|
||||
end
|
||||
|
||||
-- The function format a given string for a display
|
||||
-- String: value for show in display, maxChars: Display size (default 5), LEFTorRIGHT: flush with left "l" or right "r" site (default "r")
|
||||
function ExportScript.Tools.DisplayFormat(String, maxChars, LEFTorRight, DAC)
|
||||
local lString = String or ""
|
||||
local lmaxChars = maxChars or 5
|
||||
local lLEFTorRight = LEFTorRight or "r"
|
||||
local lDAC = DAC or false
|
||||
local lTmpLen = 0
|
||||
local lRep = " "
|
||||
|
||||
if lDAC then
|
||||
lRep = "-"
|
||||
end
|
||||
|
||||
lString = ExportScript.utf8.sub(lString, 0, lmaxChars)
|
||||
lTmpLen = ExportScript.utf8.len(lString)
|
||||
|
||||
if lTmpLen < lmaxChars then
|
||||
if string.lower(lLEFTorRight) == "l" then
|
||||
lString = lString..string.rep(" ", lmaxChars - lTmpLen)
|
||||
else
|
||||
lString = string.rep(" ", lmaxChars - lTmpLen)..lString
|
||||
end
|
||||
end
|
||||
|
||||
return lString
|
||||
end
|
||||
|
||||
function ExportScript.Tools.KeyInTable(Table, Key)
|
||||
for key, value in pairs(Table) do
|
||||
if key == Key then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function ExportScript.Tools.ValueInTable(Table, Value)
|
||||
for key, value in pairs(Table) do
|
||||
if value == Value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
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
|
||||
@@ -0,0 +1,411 @@
|
||||
-- Ikarus and D.A.C. Export Script
|
||||
--
|
||||
-- generic Radio File
|
||||
--
|
||||
-- Copyright by Michael aka McMicha 2014
|
||||
-- Contact dcs2arcaze.micha@farbpigmente.org
|
||||
|
||||
ExportScript.Version.genericRadio = "1.2.0"
|
||||
|
||||
--[[
|
||||
-- Config and execute in function ExportScript.ProcessDACConfigLowImportance()
|
||||
|
||||
-- genericRadioConf for example A-10C Radio AN/ARC-164 UHF
|
||||
ExportScript.genericRadioConf = {}
|
||||
ExportScript.genericRadioConf['maxRadios'] = 1 -- numbers of aviables/supported radios
|
||||
ExportScript.genericRadioConf[1] = {} -- first radio
|
||||
ExportScript.genericRadioConf[1]['Name'] = "AN/ARC-164 UHF" -- name of radio
|
||||
ExportScript.genericRadioConf[1]['DeviceID'] = 54 -- DeviceID for GetDevice from device.lua
|
||||
ExportScript.genericRadioConf[1]['setFrequency'] = true -- change frequency active
|
||||
ExportScript.genericRadioConf[1]['FrequencyMultiplicator'] = 1000000 -- multiplicator from Hz to MHz
|
||||
ExportScript.genericRadioConf[1]['FrequencyFormat'] = "%7.3f" -- frequency view format LUA style
|
||||
ExportScript.genericRadioConf[1]['FrequencyStep'] = 25 -- minimal step for frequency change
|
||||
ExportScript.genericRadioConf[1]['minFrequency'] = 220.000 -- lowest frequency
|
||||
ExportScript.genericRadioConf[1]['maxFrequency'] = 314.450 -- highest frequency
|
||||
ExportScript.genericRadioConf[1]['Power'] = {} -- power button active
|
||||
ExportScript.genericRadioConf[1]['Power']['ButtonID'] = 3008 -- power button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOn'] = 0.1 -- power on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Power']['ValueOff'] = 0.0 -- power off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Volume'] = {} -- volume knob active
|
||||
ExportScript.genericRadioConf[1]['Volume']['ButtonID'] = 3011 -- volume button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Preset'] = {} -- preset knob active
|
||||
ExportScript.genericRadioConf[1]['Preset']['ArgumentID'] = 161 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Preset']['ButtonID'] = 3001 -- preset button id from cklickable.lua
|
||||
-- ExportScript.genericRadioConf[1]['Preset']['ButtonID2'] = 3002 -- preset button id from cklickable.lua
|
||||
-- Preset based on switchlogic on clickabledata.lua
|
||||
ExportScript.genericRadioConf[1]['Preset']['List'] = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20",[1.00]="01"}
|
||||
ExportScript.genericRadioConf[1]['Preset']['Step'] = 0.05 -- minimal step for preset change
|
||||
-- ExportScript.genericRadioConf[1]['Preset']['Step2'] = -0.05 -- minimal step for preset change
|
||||
ExportScript.genericRadioConf[1]['Squelch'] = {} -- squelch switch active
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ArgumentID'] = 170 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ButtonID'] = 3010 -- squelch button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ValueOn'] = 0.0 -- squelch on value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Squelch']['ValueOff'] = 1.0 -- squelch off value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['Load'] = {} -- load button preset
|
||||
ExportScript.genericRadioConf[1]['Load']['ButtonID'] = 3015 -- load button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset'] = {} -- switch manual or preset active
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ArgumentID'] = 167 -- ManualPreset argument id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ButtonID'] = 3007 -- ManualPreset button id from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ValueManual'] = 0.0-- ManualPreset Manual value from cklickable.lua
|
||||
ExportScript.genericRadioConf[1]['ManualPreset']['ValuePreset'] = 0.1-- ManualPreset Preset value from cklickable.lua
|
||||
|
||||
...
|
||||
|
||||
ExportScript.genericRadio(nil, nil)]]
|
||||
|
||||
function ExportScript.genericRadio(key, value)
|
||||
--ExportScript.Tools.WriteToLog('genericRadioConf: '..ExportScript.Tools.dump(ExportScript.genericRadioConf))
|
||||
if type(ExportScript.genericRadioConf) ~= "table" then
|
||||
ExportScript.Tools.WriteToLog("No Radio defined.")
|
||||
return
|
||||
end
|
||||
|
||||
local lRotaryFrequency_1, lRotaryFrequency_2, lVolume, lPreset, lLoad, lSquelch, lManualPreset, lPower, lDevice, lClickAction, lSetFrequency = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
|
||||
local lMainPanelDevice = GetDevice(0)
|
||||
|
||||
if ExportScript.AF.genericRadio == nil then
|
||||
ExportScript.AF.genericRadio = 0
|
||||
end
|
||||
if ExportScript.AF.genericRadioFrequency1 == nil then
|
||||
ExportScript.AF.genericRadioFrequency1 = 0.0
|
||||
end
|
||||
if ExportScript.AF.genericRadioFrequency2 == nil then
|
||||
ExportScript.AF.genericRadioFrequency2 = 0.0
|
||||
end
|
||||
if ExportScript.AF.genericRadioPower == nil then
|
||||
ExportScript.AF.genericRadioPower = {}
|
||||
end
|
||||
if ExportScript.AF.genericRadioPresetManual == nil then
|
||||
ExportScript.AF.genericRadioPresetManual = {}
|
||||
end
|
||||
if ExportScript.AF.genericRadioSquelch == nil then
|
||||
ExportScript.AF.genericRadioSquelch = {}
|
||||
end
|
||||
if ExportScript.AF.genericRadioPreset == nil then
|
||||
ExportScript.AF.genericRadioPreset = {}
|
||||
end
|
||||
|
||||
if key == "3001" then
|
||||
ExportScript.AF.genericRadio = tonumber(value)
|
||||
end
|
||||
if key == "3002" then
|
||||
lRotaryFrequency_1 = tonumber(value)
|
||||
end
|
||||
if key == "3003" then
|
||||
lRotaryFrequency_2 = tonumber(value)
|
||||
end
|
||||
if key == "3004" then
|
||||
lVolume = tonumber(value)
|
||||
end
|
||||
if key == "3005" then
|
||||
lPreset = tonumber(value)
|
||||
end
|
||||
if key == "3006" then
|
||||
lLoad = tonumber(value)
|
||||
end
|
||||
if key == "3007" then
|
||||
lSquelch = tonumber(value)
|
||||
end
|
||||
if key == "3008" then
|
||||
lManualPreset = tonumber(value)
|
||||
end
|
||||
if key == "3009" then
|
||||
lPower = tonumber(value)
|
||||
end
|
||||
|
||||
local lPresetChannelFrequency = "-" -- ID 3000
|
||||
local lPresetChannel = "-" -- ID 3001
|
||||
local lFrequency = "-" -- ID 3002
|
||||
|
||||
if ExportScript.AF.genericRadio == 0 or ExportScript.AF.genericRadio > ExportScript.genericRadioConf['maxRadios'] then
|
||||
if ExportScript.AF.genericRadio ~= 0 then
|
||||
ExportScript.Tools.WriteToLog("Radio Nr. "..ExportScript.AF.genericRadio.." not defined.")
|
||||
end
|
||||
ExportScript.Tools.SendDataDAC("3000", lPresetChannelFrequency)
|
||||
ExportScript.Tools.SendDataDAC("3001", lPresetChannel)
|
||||
ExportScript.Tools.SendDataDAC("3002", lFrequency)
|
||||
ExportScript.Tools.SendDataDAC("3010", 0)
|
||||
ExportScript.Tools.SendDataDAC("3011", 0)
|
||||
ExportScript.Tools.SendDataDAC("3012", 0)
|
||||
ExportScript.Tools.SendDataDAC("3013", 0)
|
||||
return
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
local lRADIO = GetDevice(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'])
|
||||
|
||||
-- check status of the radio
|
||||
if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then
|
||||
if lRADIO:is_on() then
|
||||
ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0
|
||||
else
|
||||
ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0
|
||||
end
|
||||
end
|
||||
|
||||
-- check Manual/Preset switch
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset'] ~= nil then
|
||||
if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then
|
||||
ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ArgumentID']), 1) == ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ValueOn']) and 1 or 0)
|
||||
end
|
||||
else
|
||||
ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0
|
||||
end
|
||||
|
||||
-- check Squelch switch
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch'] ~= nil then
|
||||
if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then
|
||||
ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ArgumentID']), 1) == ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ValueOn']) and 1 or 0)
|
||||
end
|
||||
else
|
||||
ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0
|
||||
end
|
||||
|
||||
if ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] == nil then
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = 0
|
||||
end
|
||||
|
||||
if lRADIO:is_on() then
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset'] ~= nil then
|
||||
--lPresetChannel = string.format("%s", ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['List'][ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ArgumentID']), 2)])
|
||||
--ExportScript.Tools.WriteToLog('Preset index: '..ExportScript.Tools.dump(ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ArgumentID']), string.match(string.reverse(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']), '.'))))
|
||||
lPresetChannel = string.format("%s", ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['List'][ExportScript.Tools.round(lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ArgumentID']), string.match(string.reverse(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']), '.'))])
|
||||
end
|
||||
|
||||
lFrequency = ExportScript.Tools.round(lRADIO:get_frequency()/ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyMultiplicator'] , 3, "floor")
|
||||
lFrequency = string.format(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyFormat'], lFrequency)
|
||||
|
||||
lPresetChannelFrequency = string.format("%s%s", lPresetChannel, lFrequency)
|
||||
lPresetChannelFrequency = lPresetChannelFrequency:gsub(" ", "0")
|
||||
lPresetChannelFrequency = lPresetChannelFrequency:gsub("-", "")
|
||||
--ExportScript.Tools.WriteToLog('lPresetChannel: '..ExportScript.Tools.dump(lPresetChannel))
|
||||
--ExportScript.Tools.WriteToLog('lFrequency: '..ExportScript.Tools.dump(lFrequency))
|
||||
--ExportScript.Tools.WriteToLog('lPresetChannelFrequency: '..ExportScript.Tools.dump(lPresetChannelFrequency))
|
||||
-- setFrequency == true
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['setFrequency'] then
|
||||
-- minimal frequency, for example lMinFrequency1=220, lMinFrequency2=0 from 220.000
|
||||
local lMinFrequency1, lMinFrequency2 = math.modf(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['minFrequency'])
|
||||
lMinFrequency2 = lMinFrequency2 * 1000
|
||||
-- maximal frequency, for example lMaxFrequency1=314, lMaxFrequency2=975 from 314.975
|
||||
local lMaxFrequency1, lMaxFrequency2 = math.modf(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['maxFrequency'])
|
||||
lMaxFrequency2 = lMaxFrequency2 * 1000
|
||||
|
||||
if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then
|
||||
|
||||
local lTmpFrequency = ExportScript.Tools.StrSplit(lFrequency, "%.") -- %. um den Punkt als Punkt zu suchen
|
||||
|
||||
if type(lTmpFrequency) == "table" and lTmpFrequency[1] ~= nil then
|
||||
lTmpFrequency[1] = tonumber(lTmpFrequency[1])
|
||||
if lTmpFrequency[2] == nil then
|
||||
lTmpFrequency[2] = 0
|
||||
else
|
||||
lTmpFrequency[2] = tonumber(lTmpFrequency[2])
|
||||
local ltmp = string.format("%.0f", lTmpFrequency[2] / ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'])
|
||||
lTmpFrequency[2] = ltmp * ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']
|
||||
end
|
||||
if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then
|
||||
lTmpFrequency[1] = lTmpFrequency[1] - 1
|
||||
if lTmpFrequency[1] == (lMinFrequency1 - 1) then
|
||||
lTmpFrequency[1] = lMaxFrequency1
|
||||
end
|
||||
ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1
|
||||
else
|
||||
lTmpFrequency[1] = lTmpFrequency[1] + 1
|
||||
if lTmpFrequency[1] == (lMaxFrequency1 + 1) then
|
||||
lTmpFrequency[1] = lMinFrequency1
|
||||
end
|
||||
ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1
|
||||
end
|
||||
|
||||
lTmpFrequency[2] = string.format("%.3f", lTmpFrequency[2] / 1000)
|
||||
lTmpFrequency = string.format("%.3f", lTmpFrequency[1] + lTmpFrequency[2])
|
||||
lTmpFrequency = tonumber(lTmpFrequency)
|
||||
lSetFrequency = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
Frequency = lTmpFrequency * 1000000}
|
||||
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("1. generic "..ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Name'].." Radio, don't split frequency: "..lFrequency)
|
||||
end
|
||||
end
|
||||
|
||||
if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then
|
||||
|
||||
local lTmpFrequency = ExportScript.Tools.StrSplit(lFrequency, "%.")
|
||||
|
||||
if type(lTmpFrequency) == "table" and lTmpFrequency[1] ~= nil then
|
||||
lTmpFrequency[1] = tonumber(lTmpFrequency[1])
|
||||
if lTmpFrequency[2] == nil then
|
||||
lTmpFrequency[2] = 0
|
||||
else
|
||||
lTmpFrequency[2] = tonumber(lTmpFrequency[2])
|
||||
local ltmp = string.format("%.0f", lTmpFrequency[2] / ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'])
|
||||
lTmpFrequency[2] = ltmp * ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']
|
||||
end
|
||||
if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then
|
||||
lTmpFrequency[2] = lTmpFrequency[2] - ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']
|
||||
if lTmpFrequency[2] == (ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep'] * -1) then
|
||||
lTmpFrequency[2] = lMaxFrequency2
|
||||
end
|
||||
ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2
|
||||
else
|
||||
lTmpFrequency[2] = lTmpFrequency[2] + ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']
|
||||
if lTmpFrequency[2] == (lMaxFrequency2 + ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['FrequencyStep']) then
|
||||
lTmpFrequency[2] = 0
|
||||
end
|
||||
ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2
|
||||
end
|
||||
|
||||
lTmpFrequency[2] = string.format("%.3f", lTmpFrequency[2] / 1000)
|
||||
lTmpFrequency = string.format("%.3f", lTmpFrequency[1] + lTmpFrequency[2])
|
||||
lTmpFrequency = tonumber(lTmpFrequency)
|
||||
lSetFrequency = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
Frequency = lTmpFrequency * 1000000}
|
||||
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("2. generic "..ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Name'].." Radio, don't split frequency: "..lFrequency)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset'] ~= nil then
|
||||
if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID2'] == nil and ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step2'] == nil then
|
||||
local lTempPresetKeys = {}
|
||||
for k,v in pairs(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['List']) do
|
||||
table.insert(lTempPresetKeys, k)
|
||||
end
|
||||
|
||||
local lMinKey = math.min(unpack(lTempPresetKeys))
|
||||
local lMaxKey = math.max(unpack(lTempPresetKeys))
|
||||
|
||||
if lPreset > ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] then
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] + ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']
|
||||
if ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] > lMaxKey then
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lMinKey
|
||||
end
|
||||
else
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] - ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']
|
||||
if ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] < lMinKey then
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lMaxKey
|
||||
end
|
||||
end
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID'],
|
||||
Value = ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio]}
|
||||
else
|
||||
if lPreset < ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] or lPreset == 0.0 or lPreset == 2.0 then
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID'],
|
||||
Value = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step']}
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lPreset
|
||||
else
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['ButtonID2'],
|
||||
Value = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Preset']['Step2']}
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lPreset
|
||||
end
|
||||
ExportScript.AF.genericRadioPreset[ExportScript.AF.genericRadio] = lPreset
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Volume'] ~= nil then
|
||||
if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then
|
||||
lVolume = lVolume / 2
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Volume']['ButtonID'],
|
||||
Value = lVolume}
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load'] ~= nil then
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ButtonID'] ~= nil then
|
||||
if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ButtonID'],
|
||||
Value = lLoad}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch'] ~= nil then
|
||||
if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then
|
||||
if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then
|
||||
-- Squelch off
|
||||
lSquelch = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ValueOff']
|
||||
ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0
|
||||
elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then
|
||||
-- Squelch on
|
||||
lSquelch = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ValueOn']
|
||||
ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0
|
||||
end
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Squelch']['ButtonID'],
|
||||
Value = lSquelch}
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset'] ~= nil then
|
||||
if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then
|
||||
if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then
|
||||
-- Manual
|
||||
lManualPreset = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ValueManual']
|
||||
ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0
|
||||
elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0 then
|
||||
-- Preset
|
||||
lManualPreset = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ValuePreset']
|
||||
ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0
|
||||
end
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['ManualPreset']['ButtonID'],
|
||||
Value = lManualPreset}
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power'] ~= nil then
|
||||
if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then
|
||||
if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then
|
||||
-- Power off
|
||||
lPower = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power']['ValueOff']
|
||||
ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0
|
||||
elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then
|
||||
--Power on
|
||||
lPower = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power']['ValueOn']
|
||||
ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0
|
||||
end
|
||||
lClickAction = {DeviceID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['DeviceID'],
|
||||
ButtonID = ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Power']['ButtonID'],
|
||||
Value = lPower}
|
||||
end
|
||||
end
|
||||
|
||||
ExportScript.Tools.SendDataDAC("3000", lPresetChannelFrequency)
|
||||
ExportScript.Tools.SendDataDAC("3001", lPresetChannel)
|
||||
ExportScript.Tools.SendDataDAC("3002", lFrequency)
|
||||
ExportScript.Tools.SendDataDAC("3010", ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio])
|
||||
ExportScript.Tools.SendDataDAC("3011", ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio])
|
||||
ExportScript.Tools.SendDataDAC("3012", ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio])
|
||||
-- is only for radios with a lamp for Load button, for example Ka-50 Load Button is Autotune with lamp
|
||||
if ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load'] ~= nil and ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ArgumentID'] ~= nil then
|
||||
ExportScript.Tools.SendDataDAC("3013", lMainPanelDevice:get_argument_value(ExportScript.genericRadioConf[ExportScript.AF.genericRadio]['Load']['ArgumentID']))
|
||||
else
|
||||
ExportScript.Tools.SendDataDAC("3013", 0)
|
||||
end
|
||||
|
||||
if lClickAction ~= nil then
|
||||
lDevice = GetDevice(lClickAction.DeviceID)
|
||||
if type(lDevice) == "table" then
|
||||
--ExportScript.Tools.WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ")
|
||||
lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value)
|
||||
end
|
||||
elseif lSetFrequency ~= nil then
|
||||
lDevice = GetDevice(lSetFrequency.DeviceID)
|
||||
if type(lDevice) == "table" and lDevice:is_on() then
|
||||
--ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ")
|
||||
lDevice:set_frequency(lSetFrequency.Frequency)
|
||||
else
|
||||
ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,161 @@
|
||||
-- Provides UTF-8 aware string functions implemented in pure lua:
|
||||
-- * string.utf8len(s)
|
||||
-- * string.utf8sub(s, i, j)
|
||||
--
|
||||
-- All functions behave as their non UTF-8 aware counterparts with the exception
|
||||
-- that UTF-8 characters are used instead of bytes for all units.
|
||||
--
|
||||
-- Note: all validations had been removed due to awesome usage specifics.
|
||||
--[[
|
||||
Copyright (c) 2006-2007, Kyle Smith
|
||||
Modified by Alexander Yakushev, 2010-2013.
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--]]
|
||||
|
||||
-- ABNF from RFC 3629
|
||||
--
|
||||
-- UTF8-octets = *( UTF8-char )
|
||||
-- UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
|
||||
-- UTF8-1 = %x00-7F
|
||||
-- UTF8-2 = %xC2-DF UTF8-tail
|
||||
-- UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
|
||||
-- %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
|
||||
-- UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
|
||||
-- %xF4 %x80-8F 2( UTF8-tail )
|
||||
-- UTF8-tail = %x80-BF
|
||||
--
|
||||
|
||||
-- returns the number of bytes used by the UTF-8 character at byte i in s
|
||||
-- also doubles as a UTF-8 character validator
|
||||
|
||||
local utf8 = {}
|
||||
|
||||
function utf8.charbytes (s, i)
|
||||
-- argument defaults
|
||||
i = i or 1
|
||||
local c = string.byte(s, i)
|
||||
|
||||
-- determine bytes needed for character, based on RFC 3629
|
||||
if c > 0 and c <= 127 then
|
||||
-- UTF8-1
|
||||
return 1
|
||||
elseif c >= 194 and c <= 223 then
|
||||
-- UTF8-2
|
||||
local c2 = string.byte(s, i + 1)
|
||||
return 2
|
||||
elseif c >= 224 and c <= 239 then
|
||||
-- UTF8-3
|
||||
local c2 = s:byte(i + 1)
|
||||
local c3 = s:byte(i + 2)
|
||||
return 3
|
||||
elseif c >= 240 and c <= 244 then
|
||||
-- UTF8-4
|
||||
local c2 = s:byte(i + 1)
|
||||
local c3 = s:byte(i + 2)
|
||||
local c4 = s:byte(i + 3)
|
||||
return 4
|
||||
end
|
||||
end
|
||||
|
||||
-- returns the number of characters in a UTF-8 string
|
||||
function utf8.len (s)
|
||||
local pos = 1
|
||||
local bytes = string.len(s)
|
||||
local len = 0
|
||||
|
||||
while pos <= bytes and len ~= chars do
|
||||
local c = string.byte(s,pos)
|
||||
len = len + 1
|
||||
|
||||
pos = pos + utf8.charbytes(s, pos)
|
||||
end
|
||||
|
||||
if chars ~= nil then
|
||||
return pos - 1
|
||||
end
|
||||
|
||||
return len
|
||||
end
|
||||
|
||||
-- functions identically to string.sub except that i and j are UTF-8 characters
|
||||
-- instead of bytes
|
||||
function utf8.sub (s, i, j)
|
||||
j = j or -1
|
||||
|
||||
if i == nil then
|
||||
return ""
|
||||
end
|
||||
|
||||
local pos = 1
|
||||
local bytes = string.len(s)
|
||||
local len = 0
|
||||
|
||||
-- only set l if i or j is negative
|
||||
local l = (i >= 0 and j >= 0) or utf8.len(s)
|
||||
local startChar = (i >= 0) and i or l + i + 1
|
||||
local endChar = (j >= 0) and j or l + j + 1
|
||||
|
||||
-- can't have start before end!
|
||||
if startChar > endChar then
|
||||
return ""
|
||||
end
|
||||
|
||||
-- byte offsets to pass to string.sub
|
||||
local startByte, endByte = 1, bytes
|
||||
|
||||
while pos <= bytes do
|
||||
len = len + 1
|
||||
|
||||
if len == startChar then
|
||||
startByte = pos
|
||||
end
|
||||
|
||||
pos = pos + utf8.charbytes(s, pos)
|
||||
|
||||
if len == endChar then
|
||||
endByte = pos - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
return string.sub(s, startByte, endByte)
|
||||
end
|
||||
|
||||
-- replace UTF-8 characters based on a mapping table
|
||||
function utf8.replace (s, mapping)
|
||||
local pos = 1
|
||||
local bytes = string.len(s)
|
||||
local charbytes
|
||||
local newstr = ""
|
||||
|
||||
while pos <= bytes do
|
||||
charbytes = utf8.charbytes(s, pos)
|
||||
local c = string.sub(s, pos, pos + charbytes - 1)
|
||||
newstr = newstr .. (mapping[c] or c)
|
||||
pos = pos + charbytes
|
||||
end
|
||||
|
||||
return newstr
|
||||
end
|
||||
|
||||
return utf8
|
||||
+2
-721
@@ -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
|
||||
|
||||
----------
|
||||
-- DATA --
|
||||
----------
|
||||
|
||||
-- Glass Cockpit Software
|
||||
-- for example
|
||||
-- HELIOS (http://www.gadrocsworkshop.com/helios/), Type 1
|
||||
-- HawgTouch (http://forums.eagle.ru/showthread.php?t=71729), Type 2
|
||||
gES_GlassCockpitExport = true -- false for not use
|
||||
gES_GlassCockpitHost = "127.0.0.1" -- IP for HELIOS or HawgToch
|
||||
gES_GlassCockpitPort = 1625 -- Port for HELIOS (9089) or HawgTouch (1625)
|
||||
gES_GlassCockpitSeparator = ":"
|
||||
gES_GlassCockpitType = 2 -- 1 = HELIOS, 2 = HawgTouch
|
||||
|
||||
-- for example D.A.C. or SIOC
|
||||
gES_HARDWAREExport = true -- false for not use
|
||||
gES_HARDWARE = {}
|
||||
-- first hardware
|
||||
gES_HARDWARE[1] = {}
|
||||
gES_HARDWARE[1].Host = "127.0.0.1" -- IP for hardware 1
|
||||
gES_HARDWARE[1].SendPort = 26026 -- Port for hardware 1
|
||||
gES_HARDWARE[1].Separator = ":"
|
||||
-- secound to n hardware
|
||||
--gES_HARDWARE[2] = {}
|
||||
--gES_HARDWARE[2].Host = "127.0.0.1" -- IP for hardware 2
|
||||
--gES_HARDWARE[2].SendPort = 9092 -- Port for hardware 2
|
||||
--gES_HARDWARE[2].Separator = ";"
|
||||
|
||||
-- D.A.C. can data send
|
||||
gES_HARDWAREListner = true -- false for not use
|
||||
gES_HARDWAREListnerPort = 26027 -- Listener Port for D.A.C.
|
||||
|
||||
gES_ExportInterval = 0.1
|
||||
gES_ExportLowTickInterval = 1
|
||||
gES_ExportModulePath = lfs.writedir().."ExportsModules\\"
|
||||
gES_LogPath = lfs.writedir().."Logs\\Export.log"
|
||||
gES_Debug = false
|
||||
gES_FirstNewDataSend = true
|
||||
gES_FirstNewDataSendCount = 5
|
||||
gES_genericRadioHardwareID = 1
|
||||
|
||||
------------
|
||||
-- SCRIPT --
|
||||
------------
|
||||
|
||||
os.setlocale("ISO-8559-1", "numeric")
|
||||
|
||||
-- Simulation id
|
||||
gES_SimID = string.format("%08x*",os.time())
|
||||
|
||||
-- State data for export
|
||||
gES_PacketSize = 0
|
||||
gES_SendStrings = {}
|
||||
gES_LastData = {}
|
||||
|
||||
gES_PacketSizeHW = {}
|
||||
gES_SendStringsHW = {}
|
||||
gES_LastDataHW = {}
|
||||
|
||||
for i = 1, #gES_HARDWARE, 1 do
|
||||
gES_PacketSizeHW[i] = 0
|
||||
gES_SendStringsHW[i] = {}
|
||||
gES_LastDataHW[i] = {}
|
||||
end
|
||||
|
||||
-- Frame counter for non important data
|
||||
gES_TickCount = 0
|
||||
gES_TickCountHW = 0
|
||||
|
||||
-- Found DCS or FC Module
|
||||
gES_FoundDCSModule = false
|
||||
gES_FoundFCModule = false
|
||||
gES_FoundNoModul = true
|
||||
|
||||
---------------------------------------------
|
||||
-- DCS Export API Function Implementations --
|
||||
---------------------------------------------
|
||||
|
||||
function LuaExportStart()
|
||||
-- Works once just before mission start.
|
||||
-- (and before player selects their aircraft, if there is a choice!)
|
||||
|
||||
-- 2) Setup udp sockets to talk to GlassCockpit
|
||||
package.path = package.path..";.\\LuaSocket\\?.lua"
|
||||
package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
|
||||
|
||||
gES_socket = require("socket")
|
||||
|
||||
gES_c = gES_socket.udp()
|
||||
gES_c:setsockname("*", 0)
|
||||
gES_c:setoption('broadcast', true)
|
||||
gES_c:settimeout(.001) -- set the timeout for reading the socket
|
||||
|
||||
if gES_HARDWAREListner then
|
||||
gES_c2 = gES_socket.udp()
|
||||
gES_c2:setsockname("*", gES_HARDWAREListnerPort)
|
||||
gES_c2:setoption('broadcast', true)
|
||||
gES_c2:settimeout(.001) -- set the timeout for reading the socket
|
||||
end
|
||||
|
||||
-- local lrename1, lrename2 = os.rename(gES_LogPath, gES_LogPath..".old")
|
||||
gES_logFile = io.open(gES_LogPath, "w+")
|
||||
WriteToLog("Export Modules Script Path: "..gES_ExportModulePath)
|
||||
-- if lrenmae1 == nil then
|
||||
-- WriteToLog("Rename Error: "..lrename2)
|
||||
-- end
|
||||
|
||||
SelectModule() -- point globals to Module functions and data.
|
||||
end
|
||||
|
||||
function WriteToLog(message)
|
||||
if gES_logFile then
|
||||
gES_logFile:write(os.date("%X :")..message.."\r\n")
|
||||
end
|
||||
end
|
||||
|
||||
function LuaExportBeforeNextFrame()
|
||||
ProcessInput()
|
||||
end
|
||||
|
||||
function LuaExportAfterNextFrame()
|
||||
end
|
||||
|
||||
function LuaExportStop()
|
||||
-- Works once just after mission stop.
|
||||
for i=1, #gES_HARDWARE, 1 do
|
||||
SendDataHW("DAC", "stop", i)
|
||||
FlushDataHW(i)
|
||||
end
|
||||
|
||||
gES_c:close()
|
||||
if gES_HARDWAREListner then
|
||||
gES_c2:close()
|
||||
end
|
||||
|
||||
if gES_logFile then
|
||||
gES_logFile:flush()
|
||||
gES_logFile:close()
|
||||
gES_logFile = nil
|
||||
end
|
||||
end
|
||||
|
||||
function ProcessInput()
|
||||
local lCommand, lCommandArgs, lDevice
|
||||
-- C1,3001,4
|
||||
-- lComand = C
|
||||
-- lCommandArgs[1] = 1 => lDevice
|
||||
-- lCommandArgs[2] = 3001
|
||||
-- lCommandArgs[3] = 4
|
||||
|
||||
if gES_GlassCockpitExport then
|
||||
local lInput,from,port = gES_c:receivefrom()
|
||||
|
||||
if lInput then
|
||||
if gES_Debug then
|
||||
WriteToLog("lInput: "..lInput..", from: "..from..", port: "..port)
|
||||
end
|
||||
lCommand = string.sub(lInput,1,1)
|
||||
|
||||
if lCommand == "R" then
|
||||
ResetChangeValues()
|
||||
end
|
||||
|
||||
if (lCommand == "C") then
|
||||
lCommandArgs = StrSplit(string.sub(lInput,2),",")
|
||||
lDevice = GetDevice(lCommandArgs[1])
|
||||
if type(lDevice) == "table" then
|
||||
lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if gES_HARDWAREListner then
|
||||
local lInput2,from2,port2 = gES_c2:receivefrom() -- Hardware
|
||||
|
||||
if lInput2 then
|
||||
if gES_Debug then
|
||||
WriteToLog("lInput2: "..lInput2..", from2: "..from2..", port2: "..port2)
|
||||
end
|
||||
lCommand = string.sub(lInput2,1,1)
|
||||
|
||||
if lCommand == "C" then
|
||||
ResetChangeValuesHW()
|
||||
end
|
||||
|
||||
if (lCommand == "C") then
|
||||
lCommandArgs = StrSplit(string.sub(lInput2,2),",")
|
||||
lDevice = GetDevice(lCommandArgs[1])
|
||||
if lDevice ~= "1000" then
|
||||
if type(lDevice) == "table" then
|
||||
lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3])
|
||||
end
|
||||
elseif lDevice == "1000" then
|
||||
--genericRadio(key, value, hardware)
|
||||
genericRadio(lCommandArgs[2],lCommandArgs[3], gES_genericRadioHardwareID)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function LuaExportActivityNextEvent(t)
|
||||
t = t + gES_ExportInterval
|
||||
|
||||
gES_TickCount = gES_TickCount + 1
|
||||
|
||||
local lMyInfo = LoGetSelfData()
|
||||
if lMyInfo ~= nil then
|
||||
if gES_ModuleName ~= lMyInfo.Name then
|
||||
SelectModule() -- point globals to Module functions and data.
|
||||
end
|
||||
lMyInfo = nil
|
||||
end
|
||||
|
||||
local lDevice = GetDevice(0)
|
||||
if type(lDevice) == "table" and gES_FoundDCSModule then
|
||||
|
||||
lDevice:update_arguments()
|
||||
|
||||
if gES_GlassCockpitExport then
|
||||
--ProcessArguments(lDevice, gES_EveryFrameArguments) -- Module arguments as appropriate
|
||||
coProcessArguments_EveryFrame = coroutine.create(ProcessArguments)
|
||||
status = coroutine.resume( coProcessArguments_EveryFrame, lDevice, gES_EveryFrameArguments)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessArguments_EveryFrame Status: "..dump(status))
|
||||
end
|
||||
--ProcessGlassCockpitDCSHighImportance(lDevice) -- Module, as appropriate; determined in SelectModule()
|
||||
coProcessGlassCockpitDCSHighImportance = coroutine.create(ProcessGlassCockpitDCSHighImportance)
|
||||
status = coroutine.resume( coProcessGlassCockpitDCSHighImportance, lDevice)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessGlassCockpitDCSHighImportance Status: "..dump(status))
|
||||
end
|
||||
end
|
||||
if gES_HARDWAREExport then
|
||||
--ProcessHARDWAREHighImportance(lDevice) -- Module, as appropriate; determined in SelectModule()
|
||||
coProcessHARDWAREHighImportance = coroutine.create(ProcessHARDWAREHighImportance)
|
||||
status = coroutine.resume( coProcessHARDWAREHighImportance, lDevice)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessHARDWAREHighImportance Status: "..dump(status))
|
||||
end
|
||||
end
|
||||
|
||||
if gES_FirstNewDataSend and gES_FirstNewDataSendCount == 0 then
|
||||
if gES_HARDWAREExport then
|
||||
ResetChangeValuesHW()
|
||||
end
|
||||
if gES_GlassCockpitExport then
|
||||
ResetChangeValues()
|
||||
end
|
||||
gES_FirstNewDataSend = false
|
||||
else
|
||||
gES_FirstNewDataSendCount = gES_FirstNewDataSendCount - 1
|
||||
end
|
||||
|
||||
if gES_TickCount >= gES_ExportLowTickInterval then
|
||||
if gES_GlassCockpitExport then
|
||||
--ProcessArguments(lDevice, gES_Arguments) -- Module arguments as appropriate
|
||||
coProcessArguments_Arguments = coroutine.create(ProcessArguments)
|
||||
status = coroutine.resume( coProcessArguments_Arguments, lDevice, gES_Arguments)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessArguments_Arguments Status: "..dump(status))
|
||||
end
|
||||
--ProcessGlassCockpitDCSLowImportance(lDevice) -- Module as appropriate; determined in SelectModule()
|
||||
coProcessGlassCockpitDCSLowImportance = coroutine.create(ProcessGlassCockpitDCSLowImportance)
|
||||
status = coroutine.resume( coProcessGlassCockpitDCSLowImportance, lDevice)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessGlassCockpitDCSLowImportance Status: "..dump(status))
|
||||
end
|
||||
end
|
||||
|
||||
if gES_HARDWAREExport then
|
||||
--ProcessHARDWARELowImportance(lDevice) -- Module, as appropriate; determined in SelectModule()
|
||||
coProcessHARDWARELowImportance = coroutine.create(ProcessHARDWARELowImportance)
|
||||
status = coroutine.resume( coProcessHARDWARELowImportance, lDevice)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessHARDWARELowImportance Status: "..dump(status))
|
||||
end
|
||||
gES_TickCountHW = gES_TickCountHW + 1
|
||||
end
|
||||
gES_TickCount = 0
|
||||
end
|
||||
|
||||
if gES_GlassCockpitExport then
|
||||
FlushData()
|
||||
end
|
||||
|
||||
if gES_HARDWAREExport then
|
||||
for i=1, #gES_HARDWARE, 1 do
|
||||
FlushDataHW(i)
|
||||
end
|
||||
end
|
||||
elseif gES_FoundFCModule then -- Assume FC Aircraft
|
||||
if gES_GlassCockpitExport then
|
||||
--ProcessGlassCockpitFCHighImportance()
|
||||
coProcessGlassCockpitFCHighImportance = coroutine.create(ProcessGlassCockpitFCHighImportance)
|
||||
status = coroutine.resume( coProcessGlassCockpitFCHighImportance)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessGlassCockpitFCHighImportance Status: "..dump(status))
|
||||
end
|
||||
end
|
||||
if gES_HARDWAREExport then
|
||||
--ProcessHARDWAREHighImportance(lDevice)
|
||||
coProcessHARDWAREHighImportance = coroutine.create(ProcessHARDWAREHighImportance)
|
||||
status = coroutine.resume( coProcessHARDWAREHighImportance, lDevice)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessHARDWAREHighImportance Status: "..dump(status))
|
||||
end
|
||||
end
|
||||
|
||||
if gES_FirstNewDataSend and gES_FirstNewDataSendCount == 0 then
|
||||
if gES_HARDWAREExport then
|
||||
ResetChangeValuesHW()
|
||||
end
|
||||
if gES_GlassCockpitExport then
|
||||
ResetChangeValues()
|
||||
end
|
||||
gES_FirstNewDataSend = false
|
||||
else
|
||||
gES_FirstNewDataSendCount = gES_FirstNewDataSendCount - 1
|
||||
end
|
||||
|
||||
if gES_TickCount >= gES_ExportLowTickInterval then
|
||||
if gES_GlassCockpitExport then
|
||||
--ProcessGlassCockpitFCLowImportance()
|
||||
coProcessGlassCockpitFCLowImportance = coroutine.create(ProcessGlassCockpitFCLowImportance)
|
||||
status = coroutine.resume( coProcessGlassCockpitFCLowImportance)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessGlassCockpitFCLowImportance Status: "..dump(status))
|
||||
end
|
||||
end
|
||||
|
||||
if gES_HARDWAREExport then
|
||||
--ProcessHARDWARELowImportance(lDevice)
|
||||
coProcessHARDWARELowImportance = coroutine.create(ProcessHARDWARELowImportance)
|
||||
status = coroutine.resume( coProcessHARDWARELowImportance, lDevice)
|
||||
if gES_Debug then
|
||||
WriteToLog("coProcessHARDWARELowImportance Status: "..dump(status))
|
||||
end
|
||||
gES_TickCountHW = gES_TickCountHW + 1
|
||||
end
|
||||
gES_TickCount = 0
|
||||
end
|
||||
|
||||
if gES_GlassCockpitExport then
|
||||
FlushData()
|
||||
end
|
||||
|
||||
if gES_HARDWAREExport then
|
||||
for i=1, #gES_HARDWARE, 1 do
|
||||
FlushDataHW(i)
|
||||
end
|
||||
end
|
||||
else -- No Module found
|
||||
if gES_FoundNoModul then
|
||||
WriteToLog("No Module Found.")
|
||||
SelectModule() -- point globals to Module functions and data.
|
||||
end
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
-- Helper Functions
|
||||
function StrSplit(str, delim, maxNb)
|
||||
-- Eliminate bad cases...
|
||||
if string.find(str, delim) == nil then
|
||||
return { str }
|
||||
end
|
||||
if maxNb == nil or maxNb < 1 then
|
||||
maxNb = 0 -- No limit
|
||||
end
|
||||
local lResult = {}
|
||||
local lPat = "(.-)" .. delim .. "()"
|
||||
local lNb = 0
|
||||
local lLastPos
|
||||
for part, pos in string.gfind(str, lPat) do
|
||||
lNb = lNb + 1
|
||||
lResult[lNb] = part
|
||||
lLastPos = pos
|
||||
if lNb == maxNb then break end
|
||||
end
|
||||
-- Handle the last field
|
||||
if lNb ~= maxNb then
|
||||
lResult[lNb + 1] = string.sub(str, lLastPos)
|
||||
end
|
||||
return lResult
|
||||
end
|
||||
|
||||
function round(num, idp)
|
||||
local lMult = 10^(idp or 0)
|
||||
return math.floor(num * lMult + 0.5) / lMult
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- Status Gathering Functions
|
||||
function ProcessArguments(device, arguments)
|
||||
local lArgument , lFormat , lArgumentValue
|
||||
local lCounter = 0
|
||||
|
||||
if gES_Debug then
|
||||
WriteToLog("======Begin========")
|
||||
end
|
||||
|
||||
for lArgument, lFormat in pairs(arguments) do
|
||||
lArgumentValue = string.format(lFormat,device:get_argument_value(lArgument))
|
||||
if gES_Debug then
|
||||
lCounter = lCounter + 1
|
||||
WriteToLog(lCounter..". ID: "..lArgument..", Fromat: "..lFormat..", Value: "..lArgumentValue)
|
||||
end
|
||||
SendData(lArgument, lArgumentValue)
|
||||
end
|
||||
|
||||
if gES_Debug then
|
||||
WriteToLog("======End========")
|
||||
end
|
||||
end
|
||||
|
||||
-- Network Functions for GlassCockpit
|
||||
function SendData(id, value)
|
||||
if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then
|
||||
value = value:sub(2)
|
||||
end
|
||||
|
||||
if gES_LastData[id] == nil or gES_LastData[id] ~= value then
|
||||
local ldata = id .. "=" .. value
|
||||
local ldataLen = string.len(ldata)
|
||||
|
||||
if ldataLen + gES_PacketSize > 576 then
|
||||
FlushData()
|
||||
end
|
||||
|
||||
table.insert(gES_SendStrings, ldata)
|
||||
gES_LastData[id] = value
|
||||
gES_PacketSize = gES_PacketSize + ldataLen + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- Network Functions for Hardware
|
||||
function SendDataHW(id, value, hardware)
|
||||
hardware = hardware or 1
|
||||
|
||||
if gES_HARDWARE[hardware] == nil then
|
||||
WriteToLog("unknown hardware ID '"..hardware.."' for value: '"..id.."="..value.."'")
|
||||
return
|
||||
end
|
||||
|
||||
if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then
|
||||
value = value:sub(2)
|
||||
end
|
||||
|
||||
if gES_LastDataHW[hardware][id] == nil or gES_LastDataHW[hardware][id] ~= value then
|
||||
local ldata = id .. "=" .. value
|
||||
local ldataLen = string.len(ldata)
|
||||
|
||||
if ldataLen + gES_PacketSizeHW[hardware] > 576 then
|
||||
FlushDataHW(hardware)
|
||||
end
|
||||
|
||||
table.insert(gES_SendStringsHW[hardware], ldata)
|
||||
gES_LastDataHW[hardware][id] = value
|
||||
gES_PacketSizeHW[hardware] = gES_PacketSizeHW[hardware] + ldataLen + 1
|
||||
--WriteToLog("id=ldata: "..ldata)
|
||||
--WriteToLog("gES_LastDataHW["..hardware.."]: "..dump(gES_LastDataHW[hardware]))
|
||||
end
|
||||
end
|
||||
|
||||
function FlushData()
|
||||
if #gES_SendStrings > 0 then
|
||||
local lES_SimID = ""
|
||||
if gES_GlassCockpitType == 1 then
|
||||
lES_SimID = gES_SimID
|
||||
elseif gES_GlassCockpitType == 2 then
|
||||
lES_SimID = ""
|
||||
end
|
||||
local lPacket = lES_SimID .. table.concat(gES_SendStrings, gES_GlassCockpitSeparator) .. "\n"
|
||||
gES_socket.try(gES_c:sendto(lPacket, gES_GlassCockpitHost, gES_GlassCockpitPort))
|
||||
gES_SendStrings = {}
|
||||
gES_PacketSize = 0
|
||||
end
|
||||
end
|
||||
|
||||
function FlushDataHW(hardware)
|
||||
hardware = hardware or 1
|
||||
|
||||
if gES_HARDWARE[hardware] == nil then
|
||||
WriteToLog("unknown hardware ID '"..hardware.."'")
|
||||
return
|
||||
end
|
||||
|
||||
if #gES_SendStringsHW[hardware] > 0 then
|
||||
local lPacket = gES_SimID .. table.concat(gES_SendStringsHW[hardware], gES_HARDWARE[hardware].Separator) .. "\n"
|
||||
gES_socket.try(gES_c:sendto(lPacket, gES_HARDWARE[hardware].Host, gES_HARDWARE[hardware].SendPort))
|
||||
gES_SendStringsHW[hardware] = {}
|
||||
gES_PacketSizeHW[hardware] = 0
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function ResetChangeValues()
|
||||
gES_LastData = {}
|
||||
gES_TickCount = 10
|
||||
end
|
||||
|
||||
function ResetChangeValuesHW()
|
||||
for i = 1, #gES_HARDWARE, 1 do
|
||||
gES_LastDataHW[i] = {}
|
||||
end
|
||||
gES_TickCount = 10
|
||||
gES_TickCountHW = 0
|
||||
end
|
||||
|
||||
function SelectModule()
|
||||
-- Select Module...
|
||||
gES_FoundDCSModule = false
|
||||
gES_FoundFCModule = false
|
||||
gES_FoundNoModul = true
|
||||
|
||||
local lMyInfo = LoGetSelfData()
|
||||
if lMyInfo == nil then -- End SelectModule, if don't selected a aircraft
|
||||
return
|
||||
end
|
||||
|
||||
gES_ModuleName = lMyInfo.Name
|
||||
local lModuleName = gES_ModuleName..".lua"
|
||||
local lModuleFile = ""
|
||||
|
||||
gES_FoundNoModul = false
|
||||
|
||||
for file in lfs.dir(gES_ExportModulePath) do
|
||||
if lfs.attributes(gES_ExportModulePath..file,"mode") == "file" then
|
||||
if file == lModuleName then
|
||||
lModuleFile = gES_ExportModulePath..file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
WriteToLog("File Path: "..lModuleFile)
|
||||
|
||||
if string.len(lModuleFile) > 1 then
|
||||
ResetChangeValuesHW()
|
||||
|
||||
-- load Aircraft File
|
||||
dofile(lModuleFile)
|
||||
for i=1, #gES_HARDWARE, 1 do
|
||||
SendDataHW("File", lMyInfo.Name, i)
|
||||
FlushDataHW(i)
|
||||
end
|
||||
|
||||
WriteToLog("File '"..lModuleFile.."' loaded")
|
||||
|
||||
gES_FirstNewDataSend = true
|
||||
gES_FirstNewDataSendCount = 5
|
||||
|
||||
if gES_FoundDCSModule then
|
||||
local lCounter = 0
|
||||
for k, v in pairs(gES_GlassCockpitConfigEveryFrameArguments) do
|
||||
lCounter = lCounter + 1
|
||||
end
|
||||
if gES_Debug then
|
||||
WriteToLog("gES_GlassCockpitConfigEveryFrameArguments Count: "..lCounter)
|
||||
end
|
||||
if lCounter > 0 then
|
||||
gES_EveryFrameArguments = gES_GlassCockpitConfigEveryFrameArguments
|
||||
else
|
||||
-- no Arguments
|
||||
gES_EveryFrameArguments = {}
|
||||
end
|
||||
lCounter = 0
|
||||
for k, v in pairs(gES_GlassCockpitConfigArguments) do
|
||||
lCounter = lCounter + 1
|
||||
end
|
||||
if gES_Debug then
|
||||
WriteToLog("gES_GlassCockpitConfigArguments Count: "..lCounter)
|
||||
end
|
||||
if lCounter > 0 then
|
||||
gES_Arguments = gES_GlassCockpitConfigArguments
|
||||
else
|
||||
-- no Arguments
|
||||
gES_Arguments = {}
|
||||
end
|
||||
|
||||
ProcessGlassCockpitDCSHighImportance = ProcessGlassCockpitDCSConfigHighImportance
|
||||
ProcessGlassCockpitDCSLowImportance = ProcessGlassCockpitDCSConfigLowImportance
|
||||
ProcessHARDWAREHighImportance = ProcessHARDWAREConfigHighImportance
|
||||
ProcessHARDWARELowImportance = ProcessHARDWAREConfigLowImportance
|
||||
|
||||
elseif gES_FoundFCModule then
|
||||
ProcessGlassCockpitFCHighImportance = ProcessGlassCockpitFCHighImportanceConfig
|
||||
ProcessGlassCockpitFCLowImportance = ProcessGlassCockpitFCLowImportanceConfig
|
||||
ProcessHARDWAREHighImportance = ProcessHARDWAREConfigHighImportance
|
||||
ProcessHARDWARELowImportance = ProcessHARDWAREConfigLowImportance
|
||||
else
|
||||
WriteToLog("Unknown Module Type: "..lMyInfo.Name)
|
||||
end
|
||||
|
||||
else -- Unknown Module
|
||||
ProcessGlassCockpitDCSHighImportance = ProcessGlassCockpitDCSHighImportanceNoConfig
|
||||
ProcessGlassCockpitDCSLowImportance = ProcessGlassCockpitDCSLowImportanceNoConfig
|
||||
ProcessGlassCockpitFCHighImportance = ProcessGlassCockpitFCHighImportanceNoConfig
|
||||
ProcessGlassCockpitFCLowImportance = ProcessGlassCockpitFCLowImportanceNoConfig
|
||||
ProcessHARDWAREHighImportance = ProcessHARDWARENoConfigHighImportance
|
||||
ProcessHARDWARELowImportance = ProcessHARDWARENoConfigLowImportance
|
||||
gES_EveryFrameArguments = {}
|
||||
gES_Arguments = {}
|
||||
WriteToLog("Unknown Module Name: "..lMyInfo.Name)
|
||||
end
|
||||
end
|
||||
|
||||
-- The dump function show the content of the specified variable.
|
||||
-- dump is similar to PHP function var_dump and show variables from type
|
||||
-- "nil, "number", "string", "boolean, "table", "function", "thread" and "userdata"
|
||||
function dump(var, depth)
|
||||
depth = depth or 0
|
||||
if type(var) == "string" then
|
||||
return 'string: "' .. var .. '"\n'
|
||||
elseif type(var) == "nil" then
|
||||
return 'nil\n'
|
||||
elseif type(var) == "number" then
|
||||
return 'number: "' .. var .. '"\n'
|
||||
elseif type(var) == "boolean" then
|
||||
return 'boolean: "' .. tostring(var) .. '"\n'
|
||||
elseif type(var) == "function" then
|
||||
if debug and debug.getinfo then
|
||||
fcnname = tostring(var)
|
||||
local info = debug.getinfo(var, "S")
|
||||
if info.what == "C" then
|
||||
return string.format('%q', fcnname .. ', C function') .. '\n'
|
||||
else
|
||||
if (string.sub(info.source, 1, 2) == [[./]]) then
|
||||
return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')' .. info.source) ..'\n'
|
||||
else
|
||||
return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')') ..'\n'
|
||||
end
|
||||
end
|
||||
else
|
||||
return 'a function\n'
|
||||
end
|
||||
elseif type(var) == "thread" then
|
||||
return 'thread\n'
|
||||
elseif type(var) == "userdata" then
|
||||
return tostring(var)..'\n'
|
||||
elseif type(var) == "table" then
|
||||
depth = depth + 1
|
||||
out = "{\n"
|
||||
for k,v in pairs(var) do
|
||||
out = out .. (" "):rep(depth*4).. "["..k.."] = " .. dump(v, depth)
|
||||
end
|
||||
return out .. (" "):rep((depth-1)*4) .. "}\n"
|
||||
else
|
||||
return tostring(var) .. "\n"
|
||||
end
|
||||
end
|
||||
|
||||
-- round function for math libraray
|
||||
-- number : value
|
||||
-- decimals: number of decimal
|
||||
-- method : ceil: Returns the smallest integer larger than or equal to number
|
||||
-- floor: Returns the smallest integer smaller than or equal to number
|
||||
function math.round(number, decimals, method)
|
||||
if string.find(number, "%p" ) ~= nil then
|
||||
decimals = decimals or 0
|
||||
local lFactor = 10 ^ decimals
|
||||
if (method == "ceil" or method == "floor") then
|
||||
-- ceil: Returns the smallest integer larger than or equal to number
|
||||
-- floor: Returns the smallest integer smaller than or equal to number
|
||||
return math[method](number * lFactor) / lFactor
|
||||
else
|
||||
return tonumber(("%."..decimals.."f"):format(number))
|
||||
end
|
||||
else
|
||||
return number
|
||||
end
|
||||
end
|
||||
|
||||
-- split function for string libraray
|
||||
-- stringvalue: value
|
||||
-- delimiter : delimiter for split
|
||||
-- for example, see http://www.lua.org/manual/5.1/manual.html#5.4.1
|
||||
function string.split(stringvalue, delimiter)
|
||||
result = {};
|
||||
for match in (stringvalue..delimiter):gmatch("(.-)"..delimiter) do
|
||||
table.insert(result, match);
|
||||
end
|
||||
return result;
|
||||
end
|
||||
|
||||
-- Pointed to by ProcessGlassCockpitDCSHighImportance, if the player aircraft is something else
|
||||
function ProcessGlassCockpitDCSHighImportanceNoConfig(mainPanelDevice)
|
||||
end
|
||||
-- Pointed to by ProcessGlassCockpitDCSLowImportance, if the player aircraft is something else
|
||||
function ProcessGlassCockpitDCSLowImportanceNoConfig(mainPanelDevice)
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- FLAMING CLIFFS AIRCRAFT / Su-25T --
|
||||
-- FC aircraft don't support GetDevice --
|
||||
-----------------------------------------
|
||||
-- the player aircraft is a Flaming Cliffs or similar aircraft
|
||||
function ProcessGlassCockpitFCHighImportanceNoConfig()
|
||||
end
|
||||
function ProcessGlassCockpitFCLowImportanceNoConfig()
|
||||
end
|
||||
|
||||
-- Hardware exports
|
||||
function ProcessHARDWARENoConfigHighImportance(mainPanelDevice)
|
||||
end
|
||||
function ProcessHARDWARENoConfigLowImportance(mainPanelDevice)
|
||||
end
|
||||
|
||||
--dofile("./AriesWings/AriesRadio.luac")
|
||||
-- load the DCS ExportScript for DAC and Ikarus
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]])
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 361 KiB |
Reference in New Issue
Block a user