From b504ed18a11e70b4652552becba12d59a81c9b86 Mon Sep 17 00:00:00 2001 From: Vladimir Jelovac Date: Wed, 17 Jun 2020 21:58:46 +0200 Subject: [PATCH] Using a single property for all gear chocks #151 --- A320-main.xml | 4 +--- AircraftConfig/autopush-config.xml | 2 +- AircraftConfig/groundservices.xml | 25 +++++-------------------- Models/A320-groundservices.xml | 6 +++--- Nasal/Libraries/libraries.nas | 2 +- Nasal/Systems/brakesystem.nas | 4 ++-- Nasal/Systems/ground_services.nas | 4 +--- Systems/a320-fcs.xml | 11 ++--------- 8 files changed, 16 insertions(+), 42 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 2726fd11..95919679 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -951,9 +951,7 @@ - 0 - 0 - 0 + 0 0 diff --git a/AircraftConfig/autopush-config.xml b/AircraftConfig/autopush-config.xml index 0e9926c0..fbe49dbf 100644 --- a/AircraftConfig/autopush-config.xml +++ b/AircraftConfig/autopush-config.xml @@ -5,7 +5,7 @@ 0.0 15 5.0 - + 1 false diff --git a/AircraftConfig/groundservices.xml b/AircraftConfig/groundservices.xml index e1b3bde3..1598bb0e 100644 --- a/AircraftConfig/groundservices.xml +++ b/AircraftConfig/groundservices.xml @@ -57,18 +57,9 @@ /gear/gear[2]/wow - /services/chocks/nose + /services/chocks/enable - property-toggle - /services/chocks/left - - - property-toggle - /services/chocks/right - - - property-toggle - /services/chocks/nose + dialog-apply true @@ -136,9 +127,7 @@ /controls/gear/brake-parking - /services/chocks/nose - /services/chocks/left - /services/chocks/right + /services/chocks/enable /velocities/groundspeed-kt @@ -164,9 +153,7 @@ /controls/gear/brake-parking - /services/chocks/nose - /services/chocks/left - /services/chocks/right + /services/chocks/enable /velocities/groundspeed-kt @@ -192,9 +179,7 @@ /controls/gear/brake-parking - /services/chocks/nose - /services/chocks/left - /services/chocks/right + /services/chocks/enable /velocities/groundspeed-kt diff --git a/Models/A320-groundservices.xml b/Models/A320-groundservices.xml index 321dd5e9..b964707f 100644 --- a/Models/A320-groundservices.xml +++ b/Models/A320-groundservices.xml @@ -132,7 +132,7 @@ Aircraft/A320-family/Models/Services/Chocks/chock_nose.ac - services/chocks/nose + services/chocks/enable 1 @@ -147,7 +147,7 @@ Aircraft/A320-family/Models/Services/Chocks/chock_left.ac - services/chocks/left + services/chocks/enable 1 @@ -163,7 +163,7 @@ Aircraft/A320-family/Models/Services/Chocks/chock_right.ac - services/chocks/right + services/chocks/enable 1 diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index a7644a60..9c21a954 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -250,7 +250,7 @@ var systemsLoop = maketimer(0.1, func { systems.APUController.loop(); systems.HFLoop(); - if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/nose") == 0 and getprop("/services/chocks/left") == 0 and getprop("/services/chocks/right") == 0))) { + if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/enable") == 0))) { setprop("/controls/electrical/ground-cart", 0); setprop("/controls/pneumatic/switches/groundair", 0); } diff --git a/Nasal/Systems/brakesystem.nas b/Nasal/Systems/brakesystem.nas index 13aebae2..0e70979b 100755 --- a/Nasal/Systems/brakesystem.nas +++ b/Nasal/Systems/brakesystem.nas @@ -169,7 +169,7 @@ var BrakeSystem = var V2_R = V1 - me.BrakeDecel * dt * RBrakeLevel; LThermalEnergy += (Mass * getprop("gear/gear[1]/compression-norm") * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2); - if (getprop("services/chocks/left")) { + if (getprop("services/chocks/enable")) { if (!getprop("controls/gear/brake-parking")) { # cooling effect: reduce thermal energy by (LnCoolFactor) * dt LThermalEnergy = LThermalEnergy * math.exp(LnCoolFactor * dt); @@ -202,7 +202,7 @@ var BrakeSystem = }; RThermalEnergy += (Mass * getprop("gear/gear[2]/compression-norm") * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2); - if (getprop("services/chocks/right")) { + if (getprop("services/chocks/enable")) { if (!getprop("controls/gear/brake-parking")) { # cooling effect: reduce thermal energy by (RnCoolFactor) * dt RThermalEnergy = RThermalEnergy * math.exp(RnCoolFactor * dt); diff --git a/Nasal/Systems/ground_services.nas b/Nasal/Systems/ground_services.nas index 164e8919..88541e28 100644 --- a/Nasal/Systems/ground_services.nas +++ b/Nasal/Systems/ground_services.nas @@ -20,9 +20,7 @@ var ground_services = { # Set them all to 0 if the aircraft is not stationary if (getprop("velocities/groundspeed-kt") >= 2) { - setprop("services/chocks/nose", 0); - setprop("services/chocks/left", 0); - setprop("services/chocks/right", 0); + setprop("services/chocks/enable", 0); setprop("services/fuel-truck/enable", 0); setprop("services/deicing_truck/enable", 0); setprop("services/catering/enable", 0); diff --git a/Systems/a320-fcs.xml b/Systems/a320-fcs.xml index a3ddad8d..0d8af793 100644 --- a/Systems/a320-fcs.xml +++ b/Systems/a320-fcs.xml @@ -930,16 +930,10 @@ 20 - - /services/chocks/nose - 0.5 - - /controls/gear/brake-left /controls/gear/brake-parking - /services/chocks/nose-half - /services/chocks/left + /services/chocks/enable 0 1 @@ -957,8 +951,7 @@ /controls/gear/brake-right /controls/gear/brake-parking - /services/chocks/nose-half - /services/chocks/right + /services/chocks/enable 0 1