From 06be656d9a4dcadb1e22009a9af05bb78d74922b Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 26 Jun 2017 10:05:09 +0100 Subject: [PATCH] man vs --- Models/Instruments/OHpanel/OHpanel.xml | 69 ++++++++++++++++++++++++++ Nasal/libraries.nas | 16 ++++++ Nasal/pneumatics.nas | 16 ++++-- Systems/libraries.xml | 46 +++++++++++++++++ 4 files changed, 142 insertions(+), 5 deletions(-) diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index c9770c42..263e8d5b 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -3199,6 +3199,73 @@ + + pick + ManVSCTLSwitch + + + true + + nasal + + + + property-assign + /systems/pressurization/outflowpos-man-sw + 1 + + + + property-assign + /systems/pressurization/outflowpos-man-sw + 0 + + + + + + true + + nasal + + + + property-assign + /systems/pressurization/outflowpos-man-sw + -1 + + + + property-assign + /systems/pressurization/outflowpos-man-sw + 0 + + + + + + + Man VS rotate + rotate + ManVSCTLSwitch + /systems/pressurization/outflowpos-man-sw + + -1-35 + 00 + 135 + + + 0 + 1 + 0 + +
+ -0.0128 + 0.0433 + -0.2186 +
+
+ pick CabinPressModeBtn @@ -3267,6 +3334,7 @@ pick DitchBtn1 + DitchBtn2 DitchBtn2O @@ -4140,6 +4208,7 @@ + Seatbelt sign rotate rotate diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 525d1aa8..4f6d8b5a 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -398,3 +398,19 @@ var toggleSTD = func { setprop("/modes/altimeter/std", 1); } } + +var increaseManVS = func { + var manvs = getprop("/systems/pressurization/outflowpos-man"); + var auto = getprop("/systems/pressurization/auto"); + if (manvs <= 1 and manvs >= 0 and !auto) { + setprop("/systems/pressurization/outflowpos-man", manvs + 0.001); + } +} + +var decreaseManVS = func { + var manvs = getprop("/systems/pressurization/outflowpos-man"); + var auto = getprop("/systems/pressurization/auto"); + if (manvs <= 1 and manvs >= 0 and !auto) { + setprop("/systems/pressurization/outflowpos-man", manvs - 0.001); + } +} \ No newline at end of file diff --git a/Nasal/pneumatics.nas b/Nasal/pneumatics.nas index 3616200f..992ee7c3 100644 --- a/Nasal/pneumatics.nas +++ b/Nasal/pneumatics.nas @@ -16,7 +16,6 @@ var pneu_init = func { setprop("/controls/pneumatic/switches/ram-air", 0); setprop("/controls/pneumatic/switches/pack-flo", 9); # LO: 7, NORM: 9, HI: 11. setprop("/controls/pneumatic/switches/xbleed", 1); # SHUT: 0, AUTO: 1, OPEN: 2. # I will simulate later, once I get the knob animated. -JD - setprop("/controls/pressurization/auto", 1); setprop("/systems/pneumatic/bleed1", 0); setprop("/systems/pneumatic/bleed2", 0); setprop("/systems/pneumatic/bleedapu", 0); @@ -30,6 +29,7 @@ var pneu_init = func { setprop("/systems/pneumatic/eng1-starter", 0); setprop("/systems/pneumatic/eng2-starter", 0); setprop("/FMGC/internal/dep-arpt", ""); + var altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft"); setprop("/systems/pressurization/mode", "GN"); setprop("/systems/pressurization/vs", "0"); setprop("/systems/pressurization/targetvs", "0"); @@ -39,20 +39,23 @@ var pneu_init = func { setprop("/systems/pressurization/outflowpos", "0"); setprop("/systems/pressurization/deltap-norm", "0"); setprop("/systems/pressurization/outflowpos-norm", "0"); - var altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft"); + setprop("/systems/pressurization/outflowpos-man", "0.5"); + setprop("/systems/pressurization/outflowpos-man-sw", "0"); + setprop("/systems/pressurization/outflowpos-norm-cmd", "0"); setprop("/systems/pressurization/cabinalt", altitude); setprop("/systems/pressurization/targetalt", altitude); setprop("/systems/pressurization/diff-to-target", "0"); setprop("/systems/pressurization/ditchingpb", 0); setprop("/systems/pressurization/targetvs", "0"); + setprop("/systems/pressurization/ambientpsi", "0"); + setprop("/systems/pressurization/cabinpsi", "0"); + setprop("/systems/pressurization/manvs-cmd", "0"); setprop("/systems/ventilation/cabin/fans", 0); # aircon fans setprop("/systems/ventilation/avionics/fan", 0); setprop("/systems/ventilation/avionics/extractvalve", "0"); setprop("/systems/ventilation/avionics/inletvalve", "0"); setprop("/systems/ventilation/lavatory/extractfan", 0); setprop("/systems/ventilation/lavatory/extractvalve", "0"); - setprop("/systems/pressurization/ambientpsi", "0"); - setprop("/systems/pressurization/cabinpsi", "0"); setprop("/controls/deice/eng1-on", 0); setprop("/controls/deice/eng2-on", 0); pneu_timer.start(); @@ -217,6 +220,7 @@ var master_pneu = func { var altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft"); var airport_arr_elev_ft = getprop("autopilot/route-manager/destination/field-elevation-ft"); var vs = getprop("/systems/pressurization/vs-norm"); + var manvs = getprop("/systems/pressurization/manvs-cmd"); var ditch = getprop("/systems/pressurization/ditchingpb"); var outflowpos = getprop("/systems/pressurization/outflowpos"); var cabinalt = getprop("/systems/pressurization/cabinalt"); @@ -240,8 +244,10 @@ var master_pneu = func { setprop("/systems/pressurization/vs", targetvs); } - if (cabinalt != targetalt and !wowl and !wowr and !pause) { + if (cabinalt != targetalt and !wowl and !wowr and !pause and auto) { setprop("/systems/pressurization/cabinalt", cabinalt + ((vs / 60) / 10)); + } else if (!auto and !pause) { + setprop("/systems/pressurization/cabinalt", cabinalt + ((manvs / 60) / 10)); } if (ditch and auto) { diff --git a/Systems/libraries.xml b/Systems/libraries.xml index ab5104c7..b552a142 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -368,6 +368,32 @@ 1 + + Outflow logic + gain + 1 + 0.1 + + + + /systems/pressurization/auto + 0 + + + /systems/pressurization/outflowpos-man + + + + + /systems/pressurization/auto + 1 + + + /systems/pressurization/outflowpos-norm-cmd + + /systems/pressurization/outflowpos-norm + + Cabin VS noise-spike @@ -424,6 +450,26 @@ /systems/pressurization/targetvs-cmd + + VS-target-cmd-man + gain + 1 + 0.05 + + + + /systems/pressurization/outflowpos-man + 0-1000 + 0.50 + 12500 +
+
+ + /systems/pressurization/manvs-cmd +
+ + + VS-target gain