From 4a7fe3ee281e1a73f50eebf664b7fc2b3e9a422b Mon Sep 17 00:00:00 2001 From: Saschl Date: Fri, 2 Dec 2022 22:59:33 +0100 Subject: [PATCH] feat(hyd): changed gear lever mechanism / added gear door drag #7390 @d3aeb55 --- .github/CHANGELOG.md | 1 + docs/a320-simvars.md | 12 ++ .../FlyByWire_A320_NEO/Checklist/Library.xml | 10 +- .../AirPlanes/FlyByWire_A320_NEO/Climb.flt | 1 + .../AirPlanes/FlyByWire_A320_NEO/approach.FLT | 1 + .../AirPlanes/FlyByWire_A320_NEO/apron.FLT | 1 + .../AirPlanes/FlyByWire_A320_NEO/cruise.FLT | 1 + .../AirPlanes/FlyByWire_A320_NEO/final.FLT | 1 + .../AirPlanes/FlyByWire_A320_NEO/hangar.flt | 1 + .../model/A320_NEO_INTERIOR.xml | 10 +- .../AirPlanes/FlyByWire_A320_NEO/runway.FLT | 1 + .../FlyByWire_A320_NEO/sound/sound.xml | 4 +- .../AirPlanes/FlyByWire_A320_NEO/taxi.flt | 1 + .../Pages/A32NX_Core/A32NX_BrakeTemp.js | 4 +- .../Pages/A32NX_Core/A32NX_LocalVarUpdater.js | 2 +- .../NavSystems/A320_Neo/A32NX_NavSystem.js | 2 +- src/behavior/src/A32NX_Interior_Handling.xml | 41 +++++ src/behavior/src/A32NX_Interior_Misc.xml | 46 ------ .../src/EFB/Ground/Pages/Payload/Payload.tsx | 8 +- .../src/EWD/elements/PseudoFWC.tsx | 2 +- src/systems/a320_systems/src/hydraulic/mod.rs | 3 +- src/systems/a320_systems_wasm/src/gear.rs | 49 ++++-- src/systems/systems/src/landing_gear/mod.rs | 155 ++++++++++++++---- 23 files changed, 239 insertions(+), 118 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 29991bdbd4c6..15a555c80191 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -65,6 +65,7 @@ 1. [FMGC] Fix inbound leg time for holds - @tracernz (Mike) 1. [MCDU] Improved visuals of Init-A and Init-B page - @derl30n (Leon) 1. [MODEL] Added new animated gear gravity extension handle- @tyler58546 (tyler58546), @MoreRightRudder (Mike), @Crocket63 (crocket), @Lantarius +1. [HYD] Custom Lvar for gear lever to fix ground collision bug - @Crocket63 (crocket) 1. [HYD] Randomised per actuator flow restrictions at plane init - @Crocket63 (crocket) 1. [MCDU] Hide stored elements on A/C Status when there are none - @tracernz (Mike) 1. [FMGC] Fix ident for CD legs - @tracernz (Mike) diff --git a/docs/a320-simvars.md b/docs/a320-simvars.md index 185e21f94117..b14a824ef5ed 100644 --- a/docs/a320-simvars.md +++ b/docs/a320-simvars.md @@ -3369,6 +3369,18 @@ In the variables below, {number} should be replaced with one item in the set: { - Indicates the position of the gear emergency extension crank handle from 0 to 300 (3 turns) - Percent +- A32NX_GEAR_LEVER_POSITION_REQUEST + - Indicates that the pilot tries to move the gear lever (1=down) + - Boolean + +- A32NX_GEAR_HANDLE_POSITION + - Indicates the actual position of the gear handle + - Percent over 100 + +- A32NX_GEAR_HANDLE_HITS_LOCK_SOUND + - Indicates that gear lever just hit the baulk lock mechanism + - Boolean + ## ATC (ATA 34) - A32NX_TRANSPONDER_MODE diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Checklist/Library.xml b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Checklist/Library.xml index 0fcc7777f0aa..fea5b3479fcb 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Checklist/Library.xml +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Checklist/Library.xml @@ -65,7 +65,7 @@ - + @@ -1150,7 +1150,7 @@ - + @@ -1641,7 +1641,7 @@ - + @@ -1841,7 +1841,7 @@ - + @@ -2381,7 +2381,7 @@ - + diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Climb.flt b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Climb.flt index fcba78061fdf..db8f8a0d8cfe 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Climb.flt +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/Climb.flt @@ -153,6 +153,7 @@ A32NX_SEC_2_PUSHBUTTON_PRESSED=1 A32NX_SEC_3_PUSHBUTTON_PRESSED=1 A32NX_FAC_1_PUSHBUTTON_PRESSED=1 A32NX_FAC_2_PUSHBUTTON_PRESSED=1 +A32NX_GEAR_LEVER_POSITION_REQUEST = 0 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/approach.FLT b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/approach.FLT index 1e81558d79be..06cde06e727f 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/approach.FLT +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/approach.FLT @@ -263,6 +263,7 @@ A32NX_OVHD_PRESS_MODE_SEL_PB_IS_AUTO = 1 A32NX_OVHD_PRESS_MAN_VS_CTL_SWITCH = 1 A32NX_TRANSPONDER_MODE = 1 A32NX_SWITCH_ATC_ALT = 1 +A32NX_GEAR_LEVER_POSITION_REQUEST = 0 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/apron.FLT b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/apron.FLT index 6887dcdf6678..d19ef1cb9e15 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/apron.FLT +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/apron.FLT @@ -272,6 +272,7 @@ A32NX_SWITCH_ATC_ALT = 1 A32NX_GEAR_CENTER_POSITION = 100 A32NX_GEAR_LEFT_POSITION = 100 A32NX_GEAR_RIGHT_POSITION = 100 +A32NX_GEAR_LEVER_POSITION_REQUEST = 1 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/cruise.FLT b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/cruise.FLT index 75c71e9739db..7bb6911dfa0f 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/cruise.FLT +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/cruise.FLT @@ -263,6 +263,7 @@ A32NX_OVHD_PRESS_MODE_SEL_PB_IS_AUTO = 1 A32NX_OVHD_PRESS_MAN_VS_CTL_SWITCH = 1 A32NX_TRANSPONDER_MODE = 1 A32NX_SWITCH_ATC_ALT = 1 +A32NX_GEAR_LEVER_POSITION_REQUEST = 0 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/final.FLT b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/final.FLT index 20ace49e34c9..6ec52b8c5251 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/final.FLT +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/final.FLT @@ -265,6 +265,7 @@ A32NX_SWITCH_ATC_ALT = 1 A32NX_GEAR_CENTER_POSITION = 100 A32NX_GEAR_LEFT_POSITION = 100 A32NX_GEAR_RIGHT_POSITION = 100 +A32NX_GEAR_LEVER_POSITION_REQUEST = 1 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/hangar.flt b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/hangar.flt index 95c1f41f7d74..47cf00778881 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/hangar.flt +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/hangar.flt @@ -246,6 +246,7 @@ XMLVAR_A320_WeatherRadar_Sys=1 A32NX_GEAR_CENTER_POSITION = 100 A32NX_GEAR_LEFT_POSITION = 100 A32NX_GEAR_RIGHT_POSITION = 100 +A32NX_GEAR_LEVER_POSITION_REQUEST = 1 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml index d444b54d3740..c57bba26c367 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml @@ -840,12 +840,12 @@ %((L:A32NX_BRAKE_FAN_BTN_PRESSED, Bool))%{if}Turn OFF brake fan%{else}Turn ON brake fan%{end} - + lever_landing_gear LEVER_LANDINGGEAR - gearleverclick - + 3 + PUSH_AUTOBKR_LDGGEAR_1 1 @@ -1777,7 +1777,7 @@ 5 - (A:GEAR HANDLE POSITION, Bool) (A:GEAR POSITION, percent) 99.9 > and (>O:_ShouldBeConnectedToPowerGrid) + (L:A32NX_LGCIU_2_NOSE_GEAR_DOWNLOCKED, Bool) 1 == (>O:_ShouldBeConnectedToPowerGrid) (O:_ShouldBeConnectedToPowerGrid) sp0 2 (>A:BUS LOOKUP INDEX, Number) (A:CIRCUIT CONNECTION ON:17, Bool) l0 != if{ 17 2 (>K:2:ELECTRICAL_BUS_TO_CIRCUIT_CONNECTION_TOGGLE) } @@ -1833,7 +1833,7 @@ - (A:GEAR CENTER POSITION, Percent over 100) 1 == (L:A32NX_PARK_BRAKE_LEVER_POS, bool) 1 == and + (L:A32NX_GEAR_CENTER_POSITION, Percent over 100) 1 == (L:A32NX_PARK_BRAKE_LEVER_POS, bool) 1 == and (L:A32NX_ELEC_DC_GND_FLT_SVC_BUS_IS_POWERED, Bool) 99 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/runway.FLT b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/runway.FLT index 2efba7cf4971..6458c7ecefa7 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/runway.FLT +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/runway.FLT @@ -273,6 +273,7 @@ A32NX_SWITCH_ATC_ALT = 1 A32NX_GEAR_CENTER_POSITION = 100 A32NX_GEAR_LEFT_POSITION = 100 A32NX_GEAR_RIGHT_POSITION = 100 +A32NX_GEAR_LEVER_POSITION_REQUEST = 1 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml index 26144679aaf3..55f6eaca4534 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml @@ -643,11 +643,11 @@ - + - + diff --git a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/taxi.flt b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/taxi.flt index cff4feae742c..236c68c33027 100644 --- a/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/taxi.flt +++ b/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/taxi.flt @@ -256,6 +256,7 @@ A32NX_SWITCH_ATC_ALT = 1 A32NX_GEAR_CENTER_POSITION = 100 A32NX_GEAR_LEFT_POSITION = 100 A32NX_GEAR_RIGHT_POSITION = 100 +A32NX_GEAR_LEVER_POSITION_REQUEST = 1 [Gauges.0] KollsmanSetting=29.921342849731445313 diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_BrakeTemp.js b/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_BrakeTemp.js index 8e8aca62c1a0..e852e685e67a 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_BrakeTemp.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_BrakeTemp.js @@ -82,9 +82,9 @@ class A32NX_BrakeTemp { SimVar.GetSimVarValue("L:A32NX_REPORTED_BRAKE_TEMPERATURE_4", "celsius") ]; } - const GearLeftPosition = SimVar.GetSimVarValue("GEAR LEFT POSITION", "Percent Over 100"); + const GearLeftPosition = SimVar.GetSimVarValue("L:A32NX_GEAR_LEFT_POSITION", "Percent Over 100"); const GearLeftExtended = GearLeftPosition >= 0.25; - const GearRightExtended = SimVar.GetSimVarValue("GEAR RIGHT POSITION", "Percent Over 100") >= 0.25; + const GearRightExtended = SimVar.GetSimVarValue("L:A32NX_GEAR_RIGHT_POSITION", "Percent Over 100") >= 0.25; const currentBrakeFanState = SimVar.GetSimVarValue("L:A32NX_BRAKE_FAN", "Bool"); const brakeFanButtonIsPressed = SimVar.GetSimVarValue("L:A32NX_BRAKE_FAN_BTN_PRESSED", "Bool"); // if the fan button is pressed down and the left main gear is down and locked, the fan is on diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_LocalVarUpdater.js b/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_LocalVarUpdater.js index 7be23073f2bb..c3386c7ab73d 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_LocalVarUpdater.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/A32NX_Core/A32NX_LocalVarUpdater.js @@ -65,7 +65,7 @@ class A32NX_LocalVarUpdater { } _noSmokingMemoSelector() { - const gearPercent = SimVar.GetSimVarValue("GEAR CENTER POSITION", "Percent"); + const gearPercent = SimVar.GetSimVarValue("L:A32NX_GEAR_CENTER_POSITION", "Percent"); const noSmokingSwitch = SimVar.GetSimVarValue("L:XMLVAR_SWITCH_OVHD_INTLT_NOSMOKING_Position", "Position"); // Switch is ON diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/NavSystems/A320_Neo/A32NX_NavSystem.js b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/NavSystems/A320_Neo/A32NX_NavSystem.js index 93bca47db7e4..73e07f550a5e 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/NavSystems/A320_Neo/A32NX_NavSystem.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/NavSystems/A320_Neo/A32NX_NavSystem.js @@ -2824,7 +2824,7 @@ class Warnings extends NavSystemElement { return this.linearMultiPointsEvaluation(this.pullUp_sinkRate_Points, descentRate, height) == 2; } landingGearCallback() { - const gear = !SimVar.GetSimVarValue("IS GEAR RETRACTABLE", "Boolean") || SimVar.GetSimVarValue("GEAR HANDLE POSITION", "Boolean"); + const gear = !SimVar.GetSimVarValue("IS GEAR RETRACTABLE", "Boolean") || SimVar.GetSimVarValue("L:A32NX_GEAR_HANDLE_POSITION", "Percent over 100") > 0.5; const throttle = SimVar.GetSimVarValue("L:A32NX_AUTOTHRUST_TLA:1", "number"); const flaps = SimVar.GetSimVarValue("L:A32NX_FLAPS_HANDLE_INDEX", "number"); return !gear && (flaps > 1 || (throttle == 0)); diff --git a/src/behavior/src/A32NX_Interior_Handling.xml b/src/behavior/src/A32NX_Interior_Handling.xml index 59f425998359..004d54bf8eaa 100644 --- a/src/behavior/src/A32NX_Interior_Handling.xml +++ b/src/behavior/src/A32NX_Interior_Handling.xml @@ -542,6 +542,47 @@ + + + - -