McMicha 9c007dd9c4 Change to version 1.2.1
change A-10C
add ID 717 for Standby Attitude Indicator knob arrow
add ID 22 for ADI Pitch Trim Knob
add ID 45 for HSI Heading Set Knob
add ID 44 for HSI Course Set Knob
add ID 67 for SAI Cage Standby Attitude Indicator. Hold Right Mouse Button and rotate Scroll Wheel to uncage
add ID 66 for SAI Cage Standby Attitude Indicator. Hold Right Mouse Button and rotate Scroll Wheel to uncage
add ID 68 for Clock Toggle Clock and Elapsed Time Modes
add ID 69 for Clock Start, Stop and Reset Elapsed Timer
change ID 127 to 128 for PTR-THROTTLE-FRICTION (Throttle Friction Control)
add ID 652 for PTR-TEMS-DATA (TEMS DATA)
add ID 773 for PTR-FLAPS (Flap Setting)
add ID 709 for PTR-ARMGS-COVER (Arm Ground Safety Override Cover)
add ID 710 for PTR-ARMGS-OVERRIDE-SWITCH (Arm Ground Safety Override Switch)
add ID 666 for PTR-CBP-AILERON-DISC-L (AILERON DISC L)
add ID 667 for PTR-CBP-AILERON-DISC-R (AILERON DISC R)
add ID 668 for PTR-CBP-SPS-RUDDER-AUTH-LIM (SPS & RUDDER AUTH LIMIT)
add ID 669 for PTR-CBP-ELEVATION-DISC-L (ELEVATION DISC L)
add ID 670 for PTR-CBP-ELEVATION-DISC-R (ELEVATION DISC R)
add ID 671 for PTR-CBP-AILERON-TAB-L (AILERON TAB L)
add ID 672 for PTR-CBP-AILERON-TAB-R (AILERON TAB R)
add ID 673 for PTR-CBP-EMER-FLAP (EMER FLAP)
add ID 674 for PTR-CBP-EMER-TRIM (EMER TRIM)
add ID 675 for PTR-CBP-LAND-GEAR (LAND GEAR)
add ID 676 for PTR-CBP-ENGINE-START-L (ENGINE START L)
add ID 677 for PTR-CBP-ENGINE-START-R (ENGINE START R)
add ID 678 for PTR-CBP-APU-CONT (APU CONT)
add ID 679 for PTR-CBP-ANG-IGNITOR-1 (ENG IGNITOR L/R-1)
add ID 680 for PTR-CBP-ANG-IGNITOR-2 (ENG IGNITOR L/R-2)
add ID 681 for PTR-CBP-EMER-FUEL-SHUTOFF-ENG-L (EMER FUEL SHUTOFF ENG L)
add ID 682 for PTR-CBP-EMER-FUEL-SHUTOFF-ENG-R (EMER FUEL SHUTOFF ENG R)
add ID 683 for PTR-CBP-DC-FUEL-PUMP (DC FUEL PUMP)
add ID 684 for PTR-CBP-BLEED-AIR-CONT-L (BLEED AIR CONT L)
add ID 685 for PTR-CBP-BLEED-AIR-CONT-R (BLEED AIR CONT R)
add ID 686 for PTR-CBP-EXT-STORES-JETT-1 (EXT STORES JETT 1)
add ID 687 for PTR-CBP-EXT-STORES-JETT-2 (EXT STORES JETT 2)
add ID 688 for PTR-CBP-STBY-ATT-IND (STBY ATT IND)
add ID 689 for PTR-CBP-MASTER-CAUT (MASTER CAUT)
add ID 690 for PTR-CBP-PITOT-HEAT-AC (PITOT HEAT AC)
add ID 691 for PTR-CBP-IFF (IFF)
add ID 692 for PTR-CBP-UHF-COMM (UHF COMM)
add ID 693 for PTR-CBP-INTER-COMM (INTER COMM)
add ID 694 for PTR-CBP-GENERATOR-CONT-L (GENERATOR CONT L)
add ID 695 for PTR-CBP-GENERATOR-CONT-R (GENERATOR CONT R)
add ID 696 for PTR-CBP-CONVERTER-L (CONVERTER L)
add ID 697 for PTR-CBP-AUX-ESS-BUS-0A (AUX ESS BUS 0A)
add ID 698 for PTR-CBP-AUX-ESS-BUS-0B (AUX ESS BUS 0B)
add ID 699 for PTR-CBP-AUX-ESS-BUS-0C (AUX ESS BUS 0C)
add ID 700 for PTR-CBP-BATTERY-BUS-TRANS (BATTERY BUS TRANS)
add ID 701 for PTR-CBP-INVERTER-PWR (INVERTER PWR)
add ID 702 for PTR-CBP-INVERTER-CONT (INVERTER CONT)
add ID 703 for PTR-CBP-AUX-ESS-BUS-TIE (AUX ESS BUS TIE)
add ID 62 for PNT-ALT-LEVR-L (Set Pressure)
add ID 60 for PNT-ALT-LEVR-R (ELECT/PNEU)
add ID 770 for Seat Height Adjustment up/down
add ID 787 for Extend boarding ladder cover
add ID 788 for Extend boarding ladder button
add ID 904 for Accelerometer Push to set
add ID 789 for DVADR - Function control toggle switch
add ID 776 for Anti-G suit valve test button
add ID 777 for Internal canopy actuator disengage lever
add ID 785 for Canopy jettison lever
add ID 786 for Canopy Jettison Lever Unlock Button
add ID 706 for IFF - antenna switch
add ID 707 for UHF - antenna switch
add ID 708 for EGI HQ TOD
add ID 16 for RWR Adjust Display Brightness

change AJS37
add ID 131 for Minute
add ID 133 for Second (Arrow)
add ID 1333 for Second
add ID 135 for Clock Setting

change AV8BNA
add ID 350 for Backup ADI Cage

change F-5E-3
format value for Radio with ID 327, 328, 329, 330 and 331
format value for TACAN XY Wheel ID 266
format value for set air speed knob ID 177

change FA-18C_hornet
add ID 439 for FLIR Switch, ON/STBY/OFF
add id 441 for LTD/R Switch, ARM/SAFE/AFT

change Ka-50
add ID 573 for VM_15PV_BALT_tenths

change M-2000C
format value for ADI standby ID 328
format value for Rada altimeter mimimum knob ID 192
change UHF Radio Preset Chanel values

change Mi-8MT
format value for VD 10K L Press ID 21

change SA342L/SA342;/SA342Mistral
change clock (minute) values for ID 42
change clock (second) values for ID 43
add ID 210 for clock ExtCouronne
formate value Radar Alt lamp for ID 97
2019-05-07 23:09:01 +02:00

443 lines
20 KiB
Lua

-- Su-25T Export
ExportScript.FoundFCModule = true
ExportScript.Version.Su25T = "1.2.1"
-- 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_special()
-- 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