From 79079a6bb19999437a7b8f3cb61ec7da32906c03 Mon Sep 17 00:00:00 2001 From: mcmicha Date: Thu, 22 Dec 2016 02:47:32 +0100 Subject: [PATCH] change function ExportScript.AF.MechanicalDevicesIndicator --- .../DCS-ExportScript/ExportsModules/Su-27.lua | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua index 8f121c7..42d6d9b 100644 --- a/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua @@ -477,6 +477,7 @@ 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 @@ -550,7 +551,8 @@ function ExportScript.AF.MechanicalDevicesIndicator(FunctionTyp) [status] = number: "0" [value] = number: "0" }]] - local lTrueAirSpeed = LoGetTrueAirSpeed() + --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 @@ -560,29 +562,27 @@ function ExportScript.AF.MechanicalDevicesIndicator(FunctionTyp) 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.25 and 1 or 0) ) -- Intake FOD shields - ExportScript.Tools.SendDataDAC("532", (lMechInfo.flaps.value > 0.93 and 1 or 0) ) -- flap - ExportScript.Tools.SendDataDAC("533", ((lMechInfo.flaps.value > 0.93 and lTrueAirSpeed > 340) and 1 or 0) ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light - ExportScript.Tools.SendDataDAC("534", (lMechInfo.gear.value > 0.5 and 1 or 0) ) -- Intake FOD shields + 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) ) + 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 - 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 + --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.gear.value > 0.5 and 1 or 0)) -- Intake FOD shields - ExportScript.Tools.SendData(532, (lMechInfo.flaps.value > 0.93 and 1 or 0)) -- flap + 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