From 20b4d4e767bf1df289fbb0d85f7a541ef6a1957a Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 24 Nov 2020 19:21:58 +0000 Subject: [PATCH 01/10] Fix MMO not showing on PFD --- A320-main.xml | 3 --- Models/Instruments/PFD/PFD.nas | 1 - Nasal/FMGC/FMGC.nas | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 5da13826..ef035108 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -753,9 +753,6 @@ 0 0 - - 350 - diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 3b2c7543..d8193e65 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -1278,7 +1278,6 @@ var canvas_PFD_1 = { } me["ASI_scale"].setTranslation(0, me.ASI * 6.6); - if (fbw.FBW.Computers.fac1.getValue() or fbw.FBW.Computers.fac2.getValue()) { me["ASI_max"].setTranslation(0, me.ASImax * -6.6); me["ASI_max"].show(); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 243affc8..6c2868ce 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -669,7 +669,7 @@ var masterFMGC = maketimer(0.2, func { } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { FMGCInternal.maxspeed = 284; } else { - FMGCInternal.maxspeed = getprop("/it-fbw/speeds/vmo-mmo"); + FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; } ############################ From c24f103d4765daa2109ce68cab6ef72cc20de8e7 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 24 Nov 2020 22:36:05 +0000 Subject: [PATCH 02/10] fix accidental property change --- Systems/pfd.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/pfd.xml b/Systems/pfd.xml index 9726073a..c3749535 100644 --- a/Systems/pfd.xml +++ b/Systems/pfd.xml @@ -136,7 +136,7 @@ /it-autoflight/internal/alt - /position/gear-agl-ft + /instrumentation/altimeter/indicated-altitude-ft /instrumentation/pfd/alt-diff From 2dc42e388cfe5c664d299e76ea8a5a7eb9585cc1 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 25 Nov 2020 21:39:16 +0000 Subject: [PATCH 03/10] Ailerons are controlled by ELACs. --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 33 +++++++++++++++----- Systems/a320-fcs.xml | 20 +++++++++--- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 9a3c40ae..6ff69ac3 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -1981,11 +1981,15 @@ var canvas_lowerECAM_fctl = { me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100); me["ailR"].setTranslation(0, aileron_ind_right.getValue() * (-100)); - if (blue_psi < 1500 and green_psi < 1500) { + if ((blue_psi < 1500 or !fbw.FBW.Computers.elac1.getValue()) and (green_psi < 1500 or !fbw.FBW.Computers.elac2.getValue())) { me["ailL"].setColor(0.7333,0.3803,0); - me["ailR"].setColor(0.7333,0.3803,0); } else { me["ailL"].setColor(0.0509,0.7529,0.2941); + } + + if ((green_psi < 1500 or !fbw.FBW.Computers.elac1.getValue()) and (blue_psi < 1500 or !fbw.FBW.Computers.elac2.getValue())) { + me["ailR"].setColor(0.7333,0.3803,0); + } else { me["ailR"].setColor(0.0509,0.7529,0.2941); } @@ -2279,14 +2283,21 @@ var canvas_lowerECAM_fctl = { # Hydraulic Indicators if (blue_psi >= 1500) { - me["ailLblue"].setColor(0.0509,0.7529,0.2941); - me["ailRblue"].setColor(0.0509,0.7529,0.2941); + if (fbw.FBW.Computers.elac1.getValue()) { + me["ailLblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailLblue"].setColor(0.7333,0.3803,0); + } + if (fbw.FBW.Computers.elac2.getValue()) { + me["ailRblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailRblue"].setColor(0.7333,0.3803,0); + } me["elevLblue"].setColor(0.0509,0.7529,0.2941); me["elevRblue"].setColor(0.0509,0.7529,0.2941); me["rudderblue"].setColor(0.0509,0.7529,0.2941); me["spdbrkblue"].setColor(0.0509,0.7529,0.2941); } else { - me["ailLblue"].setColor(0.7333,0.3803,0); me["ailRblue"].setColor(0.7333,0.3803,0); me["elevLblue"].setColor(0.7333,0.3803,0); me["elevRblue"].setColor(0.7333,0.3803,0); @@ -2295,8 +2306,16 @@ var canvas_lowerECAM_fctl = { } if (green_psi >= 1500) { - me["ailLgreen"].setColor(0.0509,0.7529,0.2941); - me["ailRgreen"].setColor(0.0509,0.7529,0.2941); + if (fbw.FBW.Computers.elac2.getValue()) { + me["ailLgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailLgreen"].setColor(0.7333,0.3803,0); + } + if (fbw.FBW.Computers.elac1.getValue()) { + me["ailRgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailRgreen"].setColor(0.7333,0.3803,0); + } me["elevLgreen"].setColor(0.0509,0.7529,0.2941); me["ruddergreen"].setColor(0.0509,0.7529,0.2941); me["PTgreen"].setColor(0.0509,0.7529,0.2941); diff --git a/Systems/a320-fcs.xml b/Systems/a320-fcs.xml index caece36a..9866be77 100644 --- a/Systems/a320-fcs.xml +++ b/Systems/a320-fcs.xml @@ -94,8 +94,14 @@ - /systems/hydraulic/green-psi ge 1500 - /systems/hydraulic/blue-psi ge 1500 + + /systems/fctl/elac1 eq 1 + /systems/hydraulic/blue-psi ge 1500 + + + /systems/fctl/elac2 eq 1 + /systems/hydraulic/green-psi ge 1500 + @@ -167,8 +173,14 @@ - /systems/hydraulic/green-psi ge 1500 - /systems/hydraulic/blue-psi ge 1500 + + /systems/fctl/elac1 eq 1 + /systems/hydraulic/green-psi ge 1500 + + + /systems/fctl/elac2 eq 1 + /systems/hydraulic/blue-psi ge 1500 + From 55e4dac6ac1e59b8737b5dd3835513fdeb91ba2c Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 26 Nov 2020 17:20:34 +0000 Subject: [PATCH 04/10] FBW: FCTL pitch axis rework. Add FBW dependency to ailerons (ELAC 1 / 2 / SEC 1 / SEC 2 required). Add THS JAM failure. Add hydraulic dependency to the stabalizer. --- A320-main.xml | 1 + AircraftConfig/fail.xml | 10 +++ Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 35 ++++++++--- Nasal/FBW/it-fbw.nas | 2 + Systems/a320-fcs.xml | 65 ++++++++++++++++++-- 5 files changed, 101 insertions(+), 12 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index ef035108..4a72d646 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1284,6 +1284,7 @@ 0 0 0 + 0 0 0 diff --git a/AircraftConfig/fail.xml b/AircraftConfig/fail.xml index 7ce0a7f3..cfbe5caa 100644 --- a/AircraftConfig/fail.xml +++ b/AircraftConfig/fail.xml @@ -144,6 +144,16 @@ true + + + left + /systems/failures/fctl/ths-jam + + dialog-apply + + true + + left diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 6ff69ac3..19a0e054 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -1951,7 +1951,7 @@ var canvas_lowerECAM_fctl = { return["TAT","SAT","GW","UTCh","UTCm","GW-weight-unit","ailL","ailR","elevL","elevR","PTcc","PT","PTupdn","elac1","elac2","sec1","sec2","sec3","ailLblue","ailRblue","elevLblue","elevRblue","rudderblue","ailLgreen","ailRgreen","elevLgreen","ruddergreen","PTgreen", "elevRyellow","rudderyellow","PTyellow","rudder","spdbrkblue","spdbrkgreen","spdbrkyellow","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex", "spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf", - "spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6"]; + "spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6","text4343"]; }, update: func() { blue_psi = systems.HYD.Psi.blue.getValue(); @@ -1976,6 +1976,12 @@ var canvas_lowerECAM_fctl = { me["PTupdn"].setColor(0.0509,0.7529,0.2941); me["PTcc"].setColor(0.0509,0.7529,0.2941); } + + if (fbw.FBW.Failures.ths.getBoolValue()) { + me["text4343"].setColor(0.7333,0.3803,0); + } else { + me["text4343"].setColor(0.8078,0.8039,0.8078); + } # Ailerons me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100); @@ -1997,13 +2003,13 @@ var canvas_lowerECAM_fctl = { me["elevL"].setTranslation(0, elevator_ind_left.getValue() * 100); me["elevR"].setTranslation(0, elevator_ind_right.getValue() * 100); - if (blue_psi < 1500 and green_psi < 1500) { + if ((blue_psi < 1500 or (!fbw.FBW.Computers.elac1.getValue() and !fbw.FBW.Computers.sec1.getValue())) and (green_psi < 1500 or (!fbw.FBW.Computers.elac2.getValue() and !fbw.FBW.Computers.sec2.getValue()))) { me["elevL"].setColor(0.7333,0.3803,0); } else { me["elevL"].setColor(0.0509,0.7529,0.2941); } - if (blue_psi < 1500 and yellow_psi < 1500) { + if ((blue_psi < 1500 or (!fbw.FBW.Computers.elac1.getValue() and !fbw.FBW.Computers.sec1.getValue())) and (yellow_psi < 1500 or (!fbw.FBW.Computers.elac2.getValue() and !fbw.FBW.Computers.sec2.getValue()))) { me["elevR"].setColor(0.7333,0.3803,0); } else { me["elevR"].setColor(0.0509,0.7529,0.2941); @@ -2288,16 +2294,22 @@ var canvas_lowerECAM_fctl = { } else { me["ailLblue"].setColor(0.7333,0.3803,0); } + if (fbw.FBW.Computers.elac1.getValue() or fbw.FBW.Computers.sec1.getValue()) { + me["elevLblue"].setColor(0.0509,0.7529,0.2941); + me["elevRblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevLblue"].setColor(0.7333,0.3803,0); + me["elevRblue"].setColor(0.7333,0.3803,0); + } if (fbw.FBW.Computers.elac2.getValue()) { me["ailRblue"].setColor(0.0509,0.7529,0.2941); } else { me["ailRblue"].setColor(0.7333,0.3803,0); } - me["elevLblue"].setColor(0.0509,0.7529,0.2941); - me["elevRblue"].setColor(0.0509,0.7529,0.2941); me["rudderblue"].setColor(0.0509,0.7529,0.2941); me["spdbrkblue"].setColor(0.0509,0.7529,0.2941); } else { + me["ailLblue"].setColor(0.7333,0.3803,0); me["ailRblue"].setColor(0.7333,0.3803,0); me["elevLblue"].setColor(0.7333,0.3803,0); me["elevRblue"].setColor(0.7333,0.3803,0); @@ -2306,6 +2318,12 @@ var canvas_lowerECAM_fctl = { } if (green_psi >= 1500) { + if (fbw.FBW.Computers.elac2.getValue() or fbw.FBW.Computers.sec2.getValue()) { + me["elevLgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevLgreen"].setColor(0.7333,0.3803,0); + } + if (fbw.FBW.Computers.elac2.getValue()) { me["ailLgreen"].setColor(0.0509,0.7529,0.2941); } else { @@ -2316,7 +2334,6 @@ var canvas_lowerECAM_fctl = { } else { me["ailRgreen"].setColor(0.7333,0.3803,0); } - me["elevLgreen"].setColor(0.0509,0.7529,0.2941); me["ruddergreen"].setColor(0.0509,0.7529,0.2941); me["PTgreen"].setColor(0.0509,0.7529,0.2941); me["spdbrkgreen"].setColor(0.0509,0.7529,0.2941); @@ -2330,7 +2347,11 @@ var canvas_lowerECAM_fctl = { } if (yellow_psi >= 1500) { - me["elevRyellow"].setColor(0.0509,0.7529,0.2941); + if (fbw.FBW.Computers.elac2.getValue() or fbw.FBW.Computers.sec2.getValue()) { + me["elevRyellow"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevRyellow"].setColor(0.7333,0.3803,0); + } me["rudderyellow"].setColor(0.0509,0.7529,0.2941); me["PTyellow"].setColor(0.0509,0.7529,0.2941); me["spdbrkyellow"].setColor(0.0509,0.7529,0.2941); diff --git a/Nasal/FBW/it-fbw.nas b/Nasal/FBW/it-fbw.nas index 0ae8347d..c150d965 100644 --- a/Nasal/FBW/it-fbw.nas +++ b/Nasal/FBW/it-fbw.nas @@ -64,6 +64,7 @@ var FBW = { sec3: props.globals.getNode("/systems/failures/fctl/sec3"), fac1: props.globals.getNode("/systems/failures/fctl/fac1"), fac2: props.globals.getNode("/systems/failures/fctl/fac2"), + ths: props.globals.getNode("/systems/failures/fctl/ths-jam"), spoilerl1: props.globals.getNode("/systems/failures/spoilers/spoiler-l1"), spoilerl2: props.globals.getNode("/systems/failures/spoilers/spoiler-l2"), spoilerl3: props.globals.getNode("/systems/failures/spoilers/spoiler-l3"), @@ -143,6 +144,7 @@ var FBW = { me.Failures.sec3.setBoolValue(0); me.Failures.fac1.setBoolValue(0); me.Failures.fac2.setBoolValue(0); + me.Failures.ths.setBoolValue(0); me.Failures.spoilerl1.setBoolValue(0); me.Failures.spoilerl2.setBoolValue(0); me.Failures.spoilerl3.setBoolValue(0); diff --git a/Systems/a320-fcs.xml b/Systems/a320-fcs.xml index 9866be77..76bd273b 100644 --- a/Systems/a320-fcs.xml +++ b/Systems/a320-fcs.xml @@ -241,16 +241,42 @@ - /systems/hydraulic/green-psi ge 1500 - /systems/hydraulic/blue-psi ge 1500 + + + /systems/fctl/elac1 eq 1 + /systems/fctl/sec1 eq 1 + + /systems/hydraulic/blue-psi ge 1500 + + + + /systems/fctl/elac2 eq 1 + /systems/fctl/sec2 eq 1 + + /systems/hydraulic/green-psi ge 1500 + + + + /systems/hydraulic/blue-psi ge 1500 + /systems/hydraulic/green-psi ge 1500 + + /systems/failures/elevator-left eq 0 + + /systems/fctl/elac1 eq 0 + /systems/fctl/sec1 eq 0 + /systems/fctl/elac2 eq 0 + /systems/fctl/sec2 eq 0 + + hydraulics/elevator-l/pressure-switch-or eq 1 /systems/failures/elevator-left eq 0 + /it-fbw/law ne 3 -1.0 @@ -281,16 +307,42 @@ - /systems/hydraulic/yellow-psi ge 1500 - /systems/hydraulic/blue-psi ge 1500 + + + /systems/fctl/elac1 eq 1 + /systems/fctl/sec1 eq 1 + + /systems/hydraulic/blue-psi ge 1500 + + + + /systems/fctl/elac2 eq 1 + /systems/fctl/sec2 eq 1 + + /systems/hydraulic/yellow-psi ge 1500 + + + + /systems/hydraulic/blue-psi ge 1500 + /systems/hydraulic/yellow-psi ge 1500 + + /systems/failures/elevator-right eq 0 + + /systems/fctl/elac1 eq 0 + /systems/fctl/sec1 eq 0 + /systems/fctl/elac2 eq 0 + /systems/fctl/sec2 eq 0 + + hydraulics/elevator-r/pressure-switch-or eq 1 /systems/failures/elevator-right eq 0 + /it-fbw/law ne 3 -1.0 @@ -319,7 +371,10 @@ - + + + /systems/failures/fctl/ths-jam eq 1 + /systems/hydraulic/yellow-psi ge 1500 /systems/hydraulic/green-psi ge 1500 From 2bb5ec6578459961a77a41df5ecdb3f4f4af2203 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 26 Nov 2020 17:49:21 +0000 Subject: [PATCH 05/10] MAN PITCH TRIM is controlled now by elevator fault. --- Models/Instruments/PFD/PFD.nas | 52 ++++++++++++++-------------------- Nasal/FBW/it-fbw.nas | 17 +++-------- 2 files changed, 26 insertions(+), 43 deletions(-) diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index d8193e65..24d86731 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -512,21 +512,19 @@ var canvas_PFD_base = { me["FMA_rollarm_box"].hide(); me["FMA_Middle1"].hide(); me["FMA_Middle2"].hide(); - if (wow1.getValue() == 0) { - if (fbw_curlaw == 2) { - me["FMA_ctr_msg"].setText("USE MAN PITCH TRIM"); - me["FMA_ctr_msg"].setColor(0.7333,0.3803,0); - me["FMA_ctr_msg"].show(); - } else if (fbw_curlaw == 3) { - me["FMA_ctr_msg"].setText("MAN PITCH TRIM ONLY"); - me["FMA_ctr_msg"].setColor(1,0,0); - me["FMA_ctr_msg"].show(); - } else { - me["FMA_ctr_msg"].hide(); - } + + if (fbw_curlaw == 2 and wow1.getValue() == 0) { + me["FMA_ctr_msg"].setText("USE MAN PITCH TRIM"); + me["FMA_ctr_msg"].setColor(0.7333,0.3803,0); + me["FMA_ctr_msg"].show(); + } else if (fbw_curlaw == 3) { + me["FMA_ctr_msg"].setText("MAN PITCH TRIM ONLY"); + me["FMA_ctr_msg"].setColor(1,0,0); + me["FMA_ctr_msg"].show(); } else { me["FMA_ctr_msg"].hide(); } + me["FMA_combined"].show(); if (pitch_box.getValue() == 1 and pitch_mode_act != " ") { me["FMA_combined_box"].show(); @@ -536,24 +534,18 @@ var canvas_PFD_base = { } else { me["FMA_combined"].hide(); me["FMA_combined_box"].hide(); - if (wow1.getValue() == 0) { - if (fbw_curlaw == 2) { - me["FMA_ctr_msg"].setText("USE MAN PITCH TRIM"); - me["FMA_ctr_msg"].setColor(0.7333,0.3803,0); - me["FMA_Middle1"].hide(); - me["FMA_Middle2"].show(); - me["FMA_ctr_msg"].show(); - } else if (fbw_curlaw == 3) { - me["FMA_ctr_msg"].setText("MAN PITCH TRIM ONLY"); - me["FMA_ctr_msg"].setColor(1,0,0); - me["FMA_Middle1"].hide(); - me["FMA_Middle2"].show(); - me["FMA_ctr_msg"].show(); - } else { - me["FMA_ctr_msg"].hide(); - me["FMA_Middle1"].show(); - me["FMA_Middle2"].hide(); - } + if (fbw_curlaw == 2 and wow1.getValue() == 0) { + me["FMA_ctr_msg"].setText("USE MAN PITCH TRIM"); + me["FMA_ctr_msg"].setColor(0.7333,0.3803,0); + me["FMA_Middle1"].hide(); + me["FMA_Middle2"].show(); + me["FMA_ctr_msg"].show(); + } else if (fbw_curlaw == 3) { + me["FMA_ctr_msg"].setText("MAN PITCH TRIM ONLY"); + me["FMA_ctr_msg"].setColor(1,0,0); + me["FMA_Middle1"].hide(); + me["FMA_Middle2"].show(); + me["FMA_ctr_msg"].show(); } else { me["FMA_ctr_msg"].hide(); me["FMA_Middle1"].show(); diff --git a/Nasal/FBW/it-fbw.nas b/Nasal/FBW/it-fbw.nas index c150d965..ab6fe620 100644 --- a/Nasal/FBW/it-fbw.nas +++ b/Nasal/FBW/it-fbw.nas @@ -193,7 +193,10 @@ var update_loop = func { tripleIRFail = !ir1 and !ir2 and !ir3; doubleIRFail = (!ir1 and !ir2 and ir3) or (ir1 and !ir2 and !ir3) or (!ir1 and ir2 and !ir3); - if (tripleADRFail or doubleADRFail or doubleIRFail or tripleIRFail or dualFACFault or !FBW.yawdamper.getValue() or greenYellowFail or blueGreenFail or dualELACFault or (!elac1 and elac2 and ((green < 1500 and yellow >= 1500) or (green >= 1500 and yellow < 1500))) or (!elac2 and elac1 and blue < 1500) or tripleSECFault or systems.ELEC.EmerElec.getBoolValue()) { + if (dualELACFault and !sec1 and !sec2) { + FBW.degradeLaw.setValue(3); + FBW.apOff = 1; + } elsif (tripleADRFail or doubleADRFail or doubleIRFail or tripleIRFail or dualFACFault or !FBW.yawdamper.getValue() or greenYellowFail or blueGreenFail or dualELACFault or (!elac1 and elac2 and ((green < 1500 and yellow >= 1500) or (green >= 1500 and yellow < 1500))) or (!elac2 and elac1 and blue < 1500) or tripleSECFault or systems.ELEC.EmerElec.getBoolValue()) { if (dualFACFault or !FBW.yawdamper.getValue() or greenYellowFail or (systems.ELEC.EmerElec.getBoolValue() and !fac1) or tripleIRFail) { if (lawyaw == 0 or lawyaw == 1) { FBW.degradeYawLaw.setValue(2); @@ -218,12 +221,6 @@ var update_loop = func { FBW.degradeLaw.setValue(0); FBW.apOff = 0; } - - if (dualELACFault and tripleSECFault and dualFACFault) { - FBW.degradeLaw.setValue(3); - FBW.apOff = 1; - } - # degrade loop runs faster; reset this variable law = FBW.activeLaw.getValue(); @@ -240,12 +237,6 @@ var update_loop = func { } } - # If they can, laws can go back to standard law - if (law == 3) { - if (!dualELACFault or !tripleSECFault or !dualFACFault) { - FBW.degradeLaw.setValue(2); - } - } cas = pts.Instrumentation.AirspeedIndicator.indicatedSpdKt.getValue(); mmoIAS = (cas / pts.Instrumentation.AirspeedIndicator.indicatedMach.getValue()) * 0.82; From d803796f6bcdc976b15c3aa328c0160c751751fd Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 26 Nov 2020 18:43:22 +0000 Subject: [PATCH 06/10] ELEV fault messages + separate ALTN and direct law warning --- Models/Instruments/PFD/PFD.nas | 4 +- Nasal/ECAM/ECAM-controller.nas | 6 ++ Nasal/ECAM/ECAM-logic.nas | 123 +++++++++++++++++++++++++++------ Nasal/ECAM/ECAM-messages.nas | 39 ++++++++--- Systems/a320-fwc.xml | 113 +++++++++++++++++++++++++++++- 5 files changed, 254 insertions(+), 31 deletions(-) diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 24d86731..4835a9f8 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -513,7 +513,7 @@ var canvas_PFD_base = { me["FMA_Middle1"].hide(); me["FMA_Middle2"].hide(); - if (fbw_curlaw == 2 and wow1.getValue() == 0) { + if (ecam.directLaw.active) { me["FMA_ctr_msg"].setText("USE MAN PITCH TRIM"); me["FMA_ctr_msg"].setColor(0.7333,0.3803,0); me["FMA_ctr_msg"].show(); @@ -534,7 +534,7 @@ var canvas_PFD_base = { } else { me["FMA_combined"].hide(); me["FMA_combined_box"].hide(); - if (fbw_curlaw == 2 and wow1.getValue() == 0) { + if (ecam.directLaw.active) { me["FMA_ctr_msg"].setText("USE MAN PITCH TRIM"); me["FMA_ctr_msg"].setColor(0.7333,0.3803,0); me["FMA_Middle1"].hide(); diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 85dadb04..6461b5e7 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -74,6 +74,8 @@ var warningNodes = { blueYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/blue-yellow-fuel-consumpt"), greenYellow: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-failure"), greenYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-fuel-consumpt"), + leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault"), + rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault"), }, Timers: { apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), @@ -94,6 +96,8 @@ var warningNodes = { eng1AiceNotOpen: props.globals.initNode("/ECAM/warnings/timer/eng-aice-1-closed-output"), eng2AiceNotOpen: props.globals.initNode("/ECAM/warnings/timer/eng-aice-2-closed-output"), LRElevFault: props.globals.initNode("/ECAM/warnings/fctl/lrElevFault-output"), + altnLaw: props.globals.initNode("/ECAM/warnings/fctl/altn-law-output"), + directLaw: props.globals.initNode("/ECAM/warnings/fctl/direct-law-output"), waiLhiPr: props.globals.initNode("/ECAM/warnings/timer/wing-hi-pr-left"), waiRhiPr: props.globals.initNode("/ECAM/warnings/timer/wing-hi-pr-right"), pack1Fault: props.globals.initNode("/ECAM/warnings/timer/pack-1-fault-2"), @@ -104,6 +108,8 @@ var warningNodes = { yawDamper1Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-1-fault"), yawDamper2Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-2-fault"), navTerrFault: props.globals.initNode("/ECAM/warnings/timer/nav-gpws-terr-fault"), + leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault-output"), + rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault-output"), }, Flipflops: { apuGenFault: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault"), diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 6c08e655..5a3ce8d8 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -875,23 +875,6 @@ var messages_priority_3 = func { ECAM_controller.warningReset(emerconfigVent); } - if (emerconfigAltn.clearFlag == 0) { - emerconfigAltn.active = 1; - } else { - ECAM_controller.warningReset(emerconfigAltn); - } - - if (emerconfigProt.clearFlag == 0) { - emerconfigProt.active = 1; - } else { - ECAM_controller.warningReset(emerconfigProt); - } - - if (emerconfigMaxSpeed.clearFlag == 0) { - emerconfigMaxSpeed.active = 1; - } else { - ECAM_controller.warningReset(emerconfigMaxSpeed); - } } else { ECAM_controller.warningReset(emerconfig); ECAM_controller.warningReset(emerconfigMinRat); @@ -909,9 +892,6 @@ var messages_priority_3 = func { ECAM_controller.warningReset(emerconfigBusTie2); ECAM_controller.warningReset(emerconfigAPU); ECAM_controller.warningReset(emerconfigVent); - ECAM_controller.warningReset(emerconfigAltn); - ECAM_controller.warningReset(emerconfigProt); - ECAM_controller.warningReset(emerconfigMaxSpeed); } if (hydBYloPr.clearFlag == 0 and phaseVar3 != 4 and phaseVar3 != 5 and warningNodes.Logic.blueYellow.getValue()) { @@ -1290,6 +1270,109 @@ var messages_priority_2 = func { ECAM_controller.warningReset(apuGenfaultGen3); } + if (lElevFault.clearFlag == 0 and warningNodes.Timers.leftElevFail.getValue() and phaseVar2 != 4 and phaseVar2 != 5) { + lElevFault.active = 1; + if (lElevFaultCare.clearFlag == 0) { + lElevFaultCare.active = 1; + } else { + ECAM_controller.warningReset(lElevFaultCare); + } + if (lElevFaultPitch.clearFlag == 0) { + lElevFaultPitch.active = 1; + } else { + ECAM_controller.warningReset(lElevFaultPitch); + } + } else { + ECAM_controller.warningReset(lElevFault); + ECAM_controller.warningReset(lElevFaultCare); + ECAM_controller.warningReset(lElevFaultPitch); + } + + if (rElevFault.clearFlag == 0 and warningNodes.Timers.rightElevFail.getValue() and phaseVar2 != 4 and phaseVar2 != 5) { + rElevFault.active = 1; + if (rElevFaultCare.clearFlag == 0) { + rElevFaultCare.active = 1; + } else { + ECAM_controller.warningReset(rElevFaultCare); + } + if (rElevFaultPitch.clearFlag == 0) { + rElevFaultPitch.active = 1; + } else { + ECAM_controller.warningReset(rElevFaultPitch); + } + } else { + ECAM_controller.warningReset(rElevFault); + ECAM_controller.warningReset(rElevFaultCare); + ECAM_controller.warningReset(rElevFaultPitch); + } + + if (directLaw.clearFlag == 0 and warningNodes.Timers.directLaw.getValue() and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) { + directLaw.active = 1; + directLawProt.active = 1; + if (directLawMaxSpeed.clearFlag == 0 and !fbw.tripleADRFail and pts.Gear.position[1].getValue() == 1) { + directLawMaxSpeed.active = 1; + } else { + ECAM_controller.warningReset(directLawMaxSpeed); + } + if (directLawTrim.clearFlag == 0 and (systems.HYD.Psi.green.getValue() >= 1500 or systems.HYD.Psi.yellow.getValue() >= 1500) and !fbw.FBW.Failures.ths.getValue()) { + directLawTrim.active = 1; + } else { + ECAM_controller.warningReset(directLawTrim); + } + if (directLawCare.clearFlag == 0 and (fbw.tripleADRFail or pts.Gear.position[1].getValue() == 1)) { + directLawCare.active = 1; + } else { + ECAM_controller.warningReset(directLawCare); + } + if (directLawSpdBrk.clearFlag == 0 and !fbw.tripleADRFail and pts.Gear.position[1].getValue() == 1) { + directLawSpdBrk.active = 1; + } else { + ECAM_controller.warningReset(directLawSpdBrk); + } + if (directLawSpdBrk2.clearFlag == 0 and fbw.tripleADRFail) { + directLawSpdBrk2.active = 1; + } else { + ECAM_controller.warningReset(directLawSpdBrk2); + } + } else { + ECAM_controller.warningReset(directLaw); + ECAM_controller.warningReset(directLawProt); + ECAM_controller.warningReset(directLawMaxSpeed); + ECAM_controller.warningReset(directLawTrim); + ECAM_controller.warningReset(directLawCare); + ECAM_controller.warningReset(directLawSpdBrk); + ECAM_controller.warningReset(directLawSpdBrk2); + } + + if (altnLaw.clearFlag == 0 and warningNodes.Timers.altnLaw.getValue() and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) { + altnLaw.active = 1; + altnLawProt.active = 1; + if (altnLawMaxSpeed.clearFlag == 0 and altnLawMaxSpeed2.clearFlag == 0 and !fbw.tripleADRFail) { + if (!(getprop("/ECAM/warnings/hyd/green-abnorm-lo-pr") and (getprop("/ECAM/warnings/hyd/blue-abnorm-lo-pr") or getprop("/ECAM/warnings/hyd/yellow-abnorm-lo-pr")))) { + altnLawMaxSpeed.active = 1; + ECAM_controller.warningReset(altnLawMaxSpeed2); + } else { + altnLawMaxSpeed2.active = 1; + ECAM_controller.warningReset(altnLawMaxSpeed); + } + } else { + ECAM_controller.warningReset(altnLawMaxSpeed); + ECAM_controller.warningReset(altnLawMaxSpeed2); + } + + if (altnLawMaxSpdBrk.clearFlag == 0 and (fbw.tripleADRFail or warningNodes.Logic.leftElevFail.getValue() or warningNodes.Logic.rightElevFail.getValue())) { + altnLawMaxSpdBrk.active = 1; + } else { + ECAM_controller.warningReset(altnLawMaxSpdBrk); + } + } else { + ECAM_controller.warningReset(altnLaw); + ECAM_controller.warningReset(altnLawProt); + ECAM_controller.warningReset(altnLawMaxSpeed); + ECAM_controller.warningReset(altnLawMaxSpeed2); + ECAM_controller.warningReset(altnLawMaxSpdBrk); + } + if ((athr_offw.clearFlag == 0) and athrWarn.getValue() == 2 and phaseVar2 != 4 and phaseVar2 != 8 and phaseVar2 != 10) { athr_offw.active = 1; athr_offw_1.active = 1; diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 7edc9e76..5354529c 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -155,9 +155,6 @@ var warnings = std.Vector.new([ var emerconfigBusTie2 = warning.new(msg: " -BUS TIE...........AUTO", colour: "c"), var emerconfigAPU = warning.new(msg: " -APU (IF AVAIL)...START", colour: "c"), var emerconfigVent = warning.new(msg: " -BLOWER + EXTRACT..OVRD", colour: "c"), - var emerconfigAltn = warning.new(msg: "F/CTL ALTN LAW", colour: "a"), - var emerconfigProt = warning.new(msg: " (PROT LOST)", colour: "a"), - var emerconfigMaxSpeed = warning.new(msg: " MAX SPEED........320 KT", colour: "c"), # B + Y LO PR var hydBYloPr = warning.new(msg: "HYD B+Y SYS LO PR", colour: "r", aural: 0, light: 0, isMainMsg: 1), @@ -260,10 +257,36 @@ var warnings = std.Vector.new([ var gen2faultGen3 = warning.new(msg: "-GEN 2..............OFF", colour: "c"), # APU GEN FAULT - var apuGenfault = warning.new(msg: "ELEC APU GEN FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var apuGenfaultGen = warning.new(msg: "-APU GEN....OFF THEN ON", colour: "c"), - var apuGenfaultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), - var apuGenfaultGen3 = warning.new(msg: "-APU GEN............OFF", colour: "c"), + var apuGenfault = warning.new(msg: "ELEC APU GEN FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var apuGenfaultGen = warning.new(msg: "-APU GEN....OFF THEN ON", colour: "c"), + var apuGenfaultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), + var apuGenfaultGen3 = warning.new(msg: "-APU GEN............OFF", colour: "c"), + + # L ELEV FAULT + var lElevFault = warning.new(msg: "F/CTL L ELEV FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var lElevFaultCare = warning.new(msg: " MANEUVER WITH CARE", colour: "c"), + var lElevFaultPitch = warning.new(msg: " FOR GA:MAX PITCH 15 DEG", colour: "c"), + + # R ELEV FAULT + var rElevFault = warning.new(msg: "F/CTL R ELEV FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var rElevFaultCare = warning.new(msg: " MANEUVER WITH CARE", colour: "c"), + var rElevFaultPitch = warning.new(msg: " FOR GA:MAX PITCH 15 DEG", colour: "c"), + + # DIRECT LAW + var directLaw = warning.new(msg: "F/CTL DIRECT LAW", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var directLawProt = warning.new(msg: " (PROT LOST)", colour: "a"), + var directLawMaxSpeed = warning.new(msg: " MAX SPEED........320/.77", colour: "c"), + var directLawTrim = warning.new(msg: " -MAN PITCH TRIM.....USE", colour: "c"), + var directLawCare = warning.new(msg: " MANEUVER WITH CARE", colour: "c"), + var directLawSpdBrk = warning.new(msg: " USE SPD BRK WITH CARE", colour: "c"), + var directLawSpdBrk2 = warning.new(msg: " SPD BRK.......DO NOT USE", colour: "c"), + + # ALTN LAW + var altnLaw = warning.new(msg: "F/CTL ALTN LAW", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var altnLawProt = warning.new(msg: " (PROT LOST)", colour: "a"), + var altnLawMaxSpeed = warning.new(msg: " MAX SPEED........320 KT", colour: "c"), + var altnLawMaxSpeed2 = warning.new(msg: " MAX SPEED........320/.77", colour: "c"), + var altnLawMaxSpdBrk = warning.new(msg: " SPD BRK.......DO NOT USE", colour: "c"), # Autothrust var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", colour: "a", aural: 1, light: 1, isMainMsg: 1), @@ -275,7 +298,7 @@ var warnings = std.Vector.new([ # TCAS FAULT var tcasFault = warning.new(msg: "NAV TCAS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var tcasStby = warning.new(msg: "NAV TCAS STBY", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var tcasStby = warning.new(msg: "NAV TCAS STBY", colour: "a", aural: 1, light: 1, isMainMsg: 1), var gpwsFault = warning.new(msg: "NAV GPWS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), var gpwsFaultOff = warning.new(msg: "-GPWS...............OFF", colour: "c"), var gpwsTerrFault = warning.new(msg: "NAV GPWS TERR DET FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index c2282eaa..c56a936b 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2025,7 +2025,7 @@ - + @@ -2048,6 +2048,117 @@ 3.33333333333 + + + + + + /systems/fctl/elac1 eq 0 + /systems/fctl/sec1 eq 0 + + /systems/hydraulic/blue-psi lt 1500 + + + + /systems/fctl/elac2 eq 0 + /systems/fctl/sec2 eq 0 + + /systems/hydraulic/green-psi lt 1500 + + + + + + + + /systems/hydraulic/blue-psi ge 1500 + /systems/hydraulic/green-psi ge 1500 + /systems/electrical/bus/dc-2 ge 25 + /ECAM/warnings/fctl/lrElevFault ne 1 + + /controls/fctl/switches/elac1 eq 1 + /controls/fctl/switches/elac2 eq 1 + /controls/fctl/switches/sec1 eq 1 + /controls/fctl/switches/sec2 eq 1 + + /ECAM/warnings/fctl/leftElevFault-cond eq 1 + + + + + /ECAM/warnings/fctl/leftElevFault + 120 + 3.33333333333 + + + + + + + + /systems/fctl/elac1 eq 0 + /systems/fctl/sec1 eq 0 + + /systems/hydraulic/blue-psi lt 1500 + + + + /systems/fctl/elac2 eq 0 + /systems/fctl/sec2 eq 0 + + /systems/hydraulic/yellow-psi lt 1500 + + + + + + + + /systems/hydraulic/blue-psi ge 1500 + /systems/hydraulic/yellow-psi ge 1500 + /systems/electrical/bus/dc-2 ge 25 + /ECAM/warnings/fctl/lrElevFault ne 1 + + /controls/fctl/switches/elac1 eq 1 + /controls/fctl/switches/elac2 eq 1 + /controls/fctl/switches/sec1 eq 1 + /controls/fctl/switches/sec2 eq 1 + + /ECAM/warnings/fctl/rightElevFault-cond eq 1 + + + + + /ECAM/warnings/fctl/rightElevFault + 120 + 3.33333333333 + + + + + + /ECAM/warning-phase ne 1 + /ECAM/warning-phase ne 10 + /it-fbw/law eq 1 + + + + + /ECAM/warnings/fctl/altn-law + 120 + 3.33333333333 + + + + + + + /ECAM/warning-phase ne 1 + /ECAM/warning-phase ne 10 + /it-fbw/law eq 2 + + + From b75fbce2a1499efe1312565e6fa43402e1188fcc Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 26 Nov 2020 19:24:42 +0000 Subject: [PATCH 07/10] Optimization --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 46 ++++++++++++-------- Nasal/ECAM/ECAM-phases.nas | 32 ++++++++------ Nasal/emesary/exec.nas | 18 +------- 3 files changed, 46 insertions(+), 50 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 19a0e054..889ca75c 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -36,6 +36,10 @@ var tr2_v = 0; var tr2_a = 0; var essTramps = 0; var essTrvolts = 0; +var elac1Node = 0; +var elac2Node = 0; +var sec1Node = 0; +var sec2Node = 0; # Conversion factor pounds to kilogram LBS2KGS = 0.4535924; @@ -1957,6 +1961,10 @@ var canvas_lowerECAM_fctl = { blue_psi = systems.HYD.Psi.blue.getValue(); green_psi = systems.HYD.Psi.green.getValue(); yellow_psi = systems.HYD.Psi.yellow.getValue(); + elac1Node = fbw.FBW.Computers.elac1.getValue(); + elac2Node = fbw.FBW.Computers.elac2.getValue(); + sec1Node = fbw.FBW.Computers.sec1.getValue(); + sec2Node = fbw.FBW.Computers.sec2.getValue(); # Pitch Trim me["PT"].setText(sprintf("%2.1f", math.round(elevator_trim_deg.getValue(), 0.1))); @@ -1987,13 +1995,13 @@ var canvas_lowerECAM_fctl = { me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100); me["ailR"].setTranslation(0, aileron_ind_right.getValue() * (-100)); - if ((blue_psi < 1500 or !fbw.FBW.Computers.elac1.getValue()) and (green_psi < 1500 or !fbw.FBW.Computers.elac2.getValue())) { + if ((blue_psi < 1500 or !elac1Node) and (green_psi < 1500 or !elac2Node)) { me["ailL"].setColor(0.7333,0.3803,0); } else { me["ailL"].setColor(0.0509,0.7529,0.2941); } - if ((green_psi < 1500 or !fbw.FBW.Computers.elac1.getValue()) and (blue_psi < 1500 or !fbw.FBW.Computers.elac2.getValue())) { + if ((green_psi < 1500 or !elac1Node) and (blue_psi < 1500 or !elac2Node)) { me["ailR"].setColor(0.7333,0.3803,0); } else { me["ailR"].setColor(0.0509,0.7529,0.2941); @@ -2003,13 +2011,13 @@ var canvas_lowerECAM_fctl = { me["elevL"].setTranslation(0, elevator_ind_left.getValue() * 100); me["elevR"].setTranslation(0, elevator_ind_right.getValue() * 100); - if ((blue_psi < 1500 or (!fbw.FBW.Computers.elac1.getValue() and !fbw.FBW.Computers.sec1.getValue())) and (green_psi < 1500 or (!fbw.FBW.Computers.elac2.getValue() and !fbw.FBW.Computers.sec2.getValue()))) { + if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (green_psi < 1500 or (!elac2Node and !sec2Node))) { me["elevL"].setColor(0.7333,0.3803,0); } else { me["elevL"].setColor(0.0509,0.7529,0.2941); } - if ((blue_psi < 1500 or (!fbw.FBW.Computers.elac1.getValue() and !fbw.FBW.Computers.sec1.getValue())) and (yellow_psi < 1500 or (!fbw.FBW.Computers.elac2.getValue() and !fbw.FBW.Computers.sec2.getValue()))) { + if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (yellow_psi < 1500 or (!elac2Node and !sec2Node))) { me["elevR"].setColor(0.7333,0.3803,0); } else { me["elevR"].setColor(0.0509,0.7529,0.2941); @@ -2247,34 +2255,34 @@ var canvas_lowerECAM_fctl = { } # Flight Computers - if (fbw.FBW.Computers.elac1.getValue()) { + if (elac1Node) { me["elac1"].setColor(0.0509,0.7529,0.2941); me["path4249"].setColor(0.0509,0.7529,0.2941); - } else if (!fbw.FBW.Computers.elac1.getValue() or fbw.FBW.Failures.elac1.getValue()) { + } else if (!elac1Node or fbw.FBW.Failures.elac1.getValue()) { me["elac1"].setColor(0.7333,0.3803,0); me["path4249"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.elac2.getValue()) { + if (elac2Node) { me["elac2"].setColor(0.0509,0.7529,0.2941); me["path4249-3"].setColor(0.0509,0.7529,0.2941); - } else if (!fbw.FBW.Computers.elac2.getValue() or fbw.FBW.Failures.elac2.getValue()) { + } else if (!elac2Node or fbw.FBW.Failures.elac2.getValue()) { me["elac2"].setColor(0.7333,0.3803,0); me["path4249-3"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.sec1.getValue()) { + if (sec1Node) { me["sec1"].setColor(0.0509,0.7529,0.2941); me["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941); - } else if (!fbw.FBW.Computers.sec1.getValue() or fbw.FBW.Failures.sec1.getValue()) { + } else if (!sec1Node or fbw.FBW.Failures.sec1.getValue()) { me["sec1"].setColor(0.7333,0.3803,0); me["path4249-3-6-7"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.sec2.getValue()) { + if (sec2Node) { me["sec2"].setColor(0.0509,0.7529,0.2941); me["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941); - } else if (!fbw.FBW.Computers.sec2.getValue() or fbw.FBW.Failures.sec2.getValue()) { + } else if (!sec2Node or fbw.FBW.Failures.sec2.getValue()) { me["sec2"].setColor(0.7333,0.3803,0); me["path4249-3-6-7-5"].setColor(0.7333,0.3803,0); } @@ -2289,19 +2297,19 @@ var canvas_lowerECAM_fctl = { # Hydraulic Indicators if (blue_psi >= 1500) { - if (fbw.FBW.Computers.elac1.getValue()) { + if (elac1Node) { me["ailLblue"].setColor(0.0509,0.7529,0.2941); } else { me["ailLblue"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.elac1.getValue() or fbw.FBW.Computers.sec1.getValue()) { + if (elac1Node or sec1Node) { me["elevLblue"].setColor(0.0509,0.7529,0.2941); me["elevRblue"].setColor(0.0509,0.7529,0.2941); } else { me["elevLblue"].setColor(0.7333,0.3803,0); me["elevRblue"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.elac2.getValue()) { + if (elac2Node) { me["ailRblue"].setColor(0.0509,0.7529,0.2941); } else { me["ailRblue"].setColor(0.7333,0.3803,0); @@ -2318,18 +2326,18 @@ var canvas_lowerECAM_fctl = { } if (green_psi >= 1500) { - if (fbw.FBW.Computers.elac2.getValue() or fbw.FBW.Computers.sec2.getValue()) { + if (elac2Node or sec2Node) { me["elevLgreen"].setColor(0.0509,0.7529,0.2941); } else { me["elevLgreen"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.elac2.getValue()) { + if (elac2Node) { me["ailLgreen"].setColor(0.0509,0.7529,0.2941); } else { me["ailLgreen"].setColor(0.7333,0.3803,0); } - if (fbw.FBW.Computers.elac1.getValue()) { + if (elac1Node) { me["ailRgreen"].setColor(0.0509,0.7529,0.2941); } else { me["ailRgreen"].setColor(0.7333,0.3803,0); @@ -2347,7 +2355,7 @@ var canvas_lowerECAM_fctl = { } if (yellow_psi >= 1500) { - if (fbw.FBW.Computers.elac2.getValue() or fbw.FBW.Computers.sec2.getValue()) { + if (elac2Node or sec2Node) { me["elevRyellow"].setColor(0.0509,0.7529,0.2941); } else { me["elevRyellow"].setColor(0.7333,0.3803,0); diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index 1c909150..edccc4c4 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -72,6 +72,9 @@ var FWC = { altChg: props.globals.getNode("/it-autoflight/input/alt-is-changing", 1), }; +var gnd = nil; +var gndTimer = nil; + var phaseLoop = func() { if ((systems.ELEC.Bus.acEss.getValue() < 110 and systems.ELEC.Bus.ac2.getValue() < 110) or pts.Acconfig.running.getBoolValue()) { return; } if (pts.Sim.Replay.replayActive.getBoolValue()) { return; } @@ -84,7 +87,8 @@ var phaseLoop = func() { eng2n1 = pts.Engines.Engine.n1Actual[1].getValue(); master1 = pts.Controls.Engines.Engine.cutoffSw[0].getBoolValue(); master2 = pts.Controls.Engines.Engine.cutoffSw[1].getBoolValue(); - + gnd = FWC.Logic.gnd.getBoolValue(); + gndTimer = FWC.Timer.gnd.getValue(); FWC.Flipflop.recallReset.setValue(0); # Various things @@ -102,13 +106,13 @@ var phaseLoop = func() { FWC.Flipflop.phase10Set.setBoolValue(0); } - if (FWC.Timer.gnd.getValue() == 1 and pts.Controls.Engines.Engine.firePb[0].getBoolValue()) { + if (gndTimer == 1 and pts.Controls.Engines.Engine.firePb[0].getBoolValue()) { FWC.Flipflop.phase10Reset.setBoolValue(1); } else { FWC.Flipflop.phase10Reset.setBoolValue(0); } - if ((FWC.Logic.gnd.getBoolValue() and FWC.Timer.eng1and2Off.getValue() and myPhase == 9) and FWC.Flipflop.phase10Output.getBoolValue()) { + if ((gnd and FWC.Timer.eng1and2Off.getValue() and myPhase == 9) and FWC.Flipflop.phase10Output.getBoolValue()) { FWC.Monostable.phase1.setBoolValue(1); # true for 300 sec then false } else { FWC.Monostable.phase1.setBoolValue(0); @@ -121,7 +125,7 @@ var phaseLoop = func() { FWC.Flipflop.phase2Set.setBoolValue(0); } - if (!FWC.Monostable.m80kt.getBoolValue() and myPhase != 9 and ((!FWC.Monostable.phase9Output.getBoolValue() and FWC.Timer.gnd.getValue() == 1) or (!FWC.Monostable.toPowerOutput.getBoolValue() and FWC.Timer.gnd.getValue() == 1))) { + if (!FWC.Monostable.m80kt.getBoolValue() and myPhase != 9 and ((!FWC.Monostable.phase9Output.getBoolValue() and gndTimer == 1) or (!FWC.Monostable.toPowerOutput.getBoolValue() and gndTimer == 1))) { FWC.Flipflop.phase2Reset.setBoolValue(1); } else { FWC.Flipflop.phase2Reset.setBoolValue(0); @@ -130,33 +134,33 @@ var phaseLoop = func() { gear_agl_cur = pts.Position.gearAglFt.getValue(); # Phase 5 monostable - if (FWC.toPower.getBoolValue() and (!FWC.Logic.feet1500.getBoolValue() and !FWC.Logic.gnd.getBoolValue() and FWC.Timer.gnd2Sec.getValue() != 1)) { + if (FWC.toPower.getBoolValue() and (!FWC.Logic.feet1500.getBoolValue() and !gnd and FWC.Timer.gnd2Sec.getValue() != 1)) { FWC.Monostable.phase5.setBoolValue(1); } else { FWC.Monostable.phase5.setBoolValue(0); } # Phase 7 monostable - if (!FWC.toPower.getBoolValue() and !FWC.Logic.feet1500.getBoolValue() and !FWC.Logic.feet800.getBoolValue() and !FWC.Logic.gnd.getBoolValue() and FWC.Timer.gnd2Sec.getValue() != 1) { + if (!FWC.toPower.getBoolValue() and !FWC.Logic.feet1500.getBoolValue() and !FWC.Logic.feet800.getBoolValue() and !gnd and FWC.Timer.gnd2Sec.getValue() != 1) { FWC.Monostable.phase7.setBoolValue(1); } else { FWC.Monostable.phase7.setBoolValue(0); } # Actual Phases - if ((FWC.Logic.gnd.getBoolValue() and FWC.Timer.eng1and2Off.getValue() and myPhase != 9) and !FWC.Monostable.phase1Output.getBoolValue()) { + if ((gnd and FWC.Timer.eng1and2Off.getValue() and myPhase != 9) and !FWC.Monostable.phase1Output.getBoolValue()) { setPhase(1); } - if (FWC.Timer.eng1or2Output.getBoolValue() and (FWC.Logic.gnd.getBoolValue() and !FWC.toPower.getBoolValue() and !FWC.speed80.getBoolValue()) and !FWC.Flipflop.phase2Output.getBoolValue()) { + if (FWC.Timer.eng1or2Output.getBoolValue() and (gnd and !FWC.toPower.getBoolValue() and !FWC.speed80.getBoolValue()) and !FWC.Flipflop.phase2Output.getBoolValue()) { setPhase(2); } - if (FWC.Timer.eng1or2Output.getBoolValue() and (FWC.Timer.gnd.getValue() == 1 and FWC.toPower.getBoolValue()) and !FWC.speed80.getBoolValue()) { + if (FWC.Timer.eng1or2Output.getBoolValue() and (gndTimer == 1 and FWC.toPower.getBoolValue()) and !FWC.speed80.getBoolValue()) { setPhase(3); } - if ((FWC.Timer.gnd.getValue() == 1 and FWC.toPower.getBoolValue()) and FWC.speed80.getBoolValue()) { + if ((gndTimer == 1 and FWC.toPower.getBoolValue()) and FWC.speed80.getBoolValue()) { setPhase(4); } @@ -164,7 +168,7 @@ var phaseLoop = func() { setPhase(5); } - if (!FWC.Logic.gnd.getValue() and FWC.Timer.gnd2SecHalf.getValue() != 1 and (!FWC.Monostable.phase5.getBoolValue() or !FWC.Monostable.phase5Output.getBoolValue()) and (!FWC.Monostable.phase7.getBoolValue() or !FWC.Monostable.phase7Output.getBoolValue())) { + if (!gnd and FWC.Timer.gnd2SecHalf.getValue() != 1 and (!FWC.Monostable.phase5.getBoolValue() or !FWC.Monostable.phase5Output.getBoolValue()) and (!FWC.Monostable.phase7.getBoolValue() or !FWC.Monostable.phase7Output.getBoolValue())) { setPhase(6); } @@ -172,15 +176,15 @@ var phaseLoop = func() { setPhase(7); } - if (!FWC.toPower.getBoolValue() and FWC.speed80.getBoolValue() and (FWC.Logic.gnd.getBoolValue() or FWC.Timer.gnd2Sec.getValue == 1)) { + if (!FWC.toPower.getBoolValue() and FWC.speed80.getBoolValue() and (gnd or FWC.Timer.gnd2Sec.getValue == 1)) { setPhase(8); } - if (FWC.Flipflop.phase2Output.getBoolValue() and (FWC.Logic.gnd.getBoolValue() and !FWC.toPower.getBoolValue() and !FWC.speed80.getBoolValue()) and FWC.Timer.eng1or2.getBoolValue()) { + if (FWC.Flipflop.phase2Output.getBoolValue() and (gnd and !FWC.toPower.getBoolValue() and !FWC.speed80.getBoolValue()) and FWC.Timer.eng1or2.getBoolValue()) { setPhase(9); } - if ((FWC.Logic.gnd.getBoolValue() and FWC.Timer.eng1and2Off.getValue() and myPhase == 9) and FWC.Monostable.phase1Output.getBoolValue()) { + if ((gnd and FWC.Timer.eng1and2Off.getValue() and myPhase == 9) and FWC.Monostable.phase1Output.getBoolValue()) { setPhase(10); } diff --git a/Nasal/emesary/exec.nas b/Nasal/emesary/exec.nas index 1e4ca7fd..3ea20548 100644 --- a/Nasal/emesary/exec.nas +++ b/Nasal/emesary/exec.nas @@ -30,23 +30,7 @@ var execLoop = func emesary.GlobalTransmitter.NotifyAll(notifications.frameNotification); notifications.frameNotification.FrameCount = notifications.frameNotification.FrameCount + 1; - - if (notifications.frameNotification.frame_rate < 5) { - frame_inc = 0.25;#4 Hz - } elsif (notifications.frameNotification.frame_rate < 10) { - frame_inc = 0.125;#8 Hz - } elsif (notifications.frameNotification.frame_rate < 15) { - frame_inc = 0.10;#10 Hz - } elsif (notifications.frameNotification.frame_rate < 20) { - frame_inc = 0.075;#13.3 Hz - } elsif (notifications.frameNotification.frame_rate < 25) { - frame_inc = 0.05;#20 Hz - } elsif (notifications.frameNotification.frame_rate < 40) { - frame_inc = 0.0333;#30 Hz - } else { - frame_inc = 0.02;#50 Hz - } - + frame_inc = 0.0333; #30 Hz if (frame_inc != cur_frame_inc) { cur_frame_inc = frame_inc; } From 8ff4d1d662ccf4060a756726de16dc0ecb6d6e74 Mon Sep 17 00:00:00 2001 From: vezza Date: Thu, 26 Nov 2020 23:49:10 +0100 Subject: [PATCH 08/10] Hydraulic and brake system improvements - fix parking brake gauge indication; - fix accumulator pressure; - accumulators now provides 7 full brakings to get depressurized. --- Models/FlightDeck/a320.flightdeck.xml | 60 +++++++++++++++++++-------- Nasal/Systems/hydraulics.nas | 42 +++++++------------ 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 2848a11b..2d6e31c2 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -367,10 +367,26 @@ systems/hydraulic/brakes/pressure-left-psi -0.03 - - systems/hydraulic/brakes/mode - 2 - + + + systems/hydraulic/brakes/mode + 0 + + + + systems/hydraulic/brakes/mode + 1 + + + systems/hydraulic/brakes/pressure-left-psi + 0 + + + + systems/hydraulic/brakes/mode + 2 + + brakes_lb_psi.axis @@ -383,10 +399,26 @@ systems/hydraulic/brakes/pressure-right-psi 0.03 - - systems/hydraulic/brakes/mode - 2 - + + + systems/hydraulic/brakes/mode + 0 + + + + systems/hydraulic/brakes/mode + 1 + + + systems/hydraulic/brakes/pressure-right-psi + 0 + + + + systems/hydraulic/brakes/mode + 2 + + brakes_rb_psi.axis @@ -399,16 +431,10 @@ systems/hydraulic/brakes/accumulator-pressure-psi 00 - 700-66 - 2000-78 - 3000-90 + 700-20 + 2000-44 + 3000-66 - - - systems/hydraulic/brakes/mode - 2 - - brakes_accum_psi.axis diff --git a/Nasal/Systems/hydraulics.nas b/Nasal/Systems/hydraulics.nas index 0d6ec5ce..5d40f9fc 100644 --- a/Nasal/Systems/hydraulics.nas +++ b/Nasal/Systems/hydraulics.nas @@ -14,8 +14,6 @@ var HYD = { mode: props.globals.initNode("/systems/hydraulic/brakes/mode", 0, "INT"), leftbrake: props.globals.getNode("/controls/gear/brake-left"), rightbrake: props.globals.getNode("/controls/gear/brake-right"), - lbrake: props.globals.initNode("/systems/hydraulic/brakes/lbrake", 0, "INT"), - rbrake: props.globals.initNode("/systems/hydraulic/brakes/rbrake", 0, "INT"), noserubber: props.globals.initNode("/systems/hydraulic/brakes/nose-rubber", 0, "INT"), }, Fail: { @@ -88,34 +86,22 @@ var HYD = { me.Fail.yellowLeak.setBoolValue(0); }, loop: func() { - if (me.Brakes.leftbrake.getValue() == 1) { - me.Brakes.lbrake.setValue(1); - } else { - me.Brakes.lbrake.setValue(0); - } - if (me.Brakes.rightbrake.getValue() == 1) { - me.Brakes.rbrake.setValue(1); - } else { - me.Brakes.rbrake.setValue(0); - } if (props.globals.getValue("/controls/gear/nws-switch") == 1) { me.Brakes.askidSw.setBoolValue(1); #true } else { me.Brakes.askidSw.setBoolValue(0); #false } - if (me.Brakes.mode.getValue() == 2) { - if (me.Psi.yellow.getValue() > 2500 and me.Brakes.accumPressPsi.getValue() < 700) { + if (me.Psi.yellow.getValue() > 0 and me.Brakes.accumPressPsi.getValue() < 3000 and me.Psi.yellow.getValue() > me.Brakes.accumPressPsi.getValue()) { me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() + 50); - } } # Decrease accumPressPsi when green and yellow hydraulic's aren't pressurized - if (me.Brakes.leftbrake.getValue() > 0) { + if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { lcont = lcont + 1; } else { lcont = 0; } - if (me.Brakes.rightbrake.getValue() > 0) { + if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { rcont = rcont + 1; } else { rcont = 0; @@ -123,11 +109,11 @@ var HYD = { if ((me.Psi.green.getValue() == 0) and (me.Psi.yellow.getValue() == 0) and (me.Brakes.accumPressPsi.getValue()) > 0) { if (lcont == 1) { #me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - (35 * me.Brakes.leftbrake.getValue())); - me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - 35); + me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - 200); } if (rcont == 1) { #me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - (35 * me.Brakes.leftbrake.getValue())); - me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - 35); + me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - 200); } if (me.Brakes.accumPressPsi.getValue() < 0) { me.Brakes.accumPressPsi.setValue(0); @@ -137,26 +123,26 @@ var HYD = { # Braking Pressure if (me.Brakes.mode.getValue() == 1 or (me.Brakes.mode.getValue() == 2 and me.Psi.green.getValue() >= 2500)) { # Normal braking - Green OK - if (me.Brakes.lbrake.getValue() > 0) { + if (me.Brakes.leftbrake.getValue() > 0) { me.Brakes.leftPressPsi.setValue(props.globals.getValue("/systems/hydraulic/green-psi-ptu")); } else { me.Brakes.leftPressPsi.setValue(0); } - if (me.Brakes.rbrake.getValue() > 0) { + if (me.Brakes.rightbrake.getValue() > 0) { me.Brakes.rightPressPsi.setValue(props.globals.getValue("/systems/hydraulic/green-psi-ptu")); } else { me.Brakes.rightPressPsi.setValue(0); } } else { - if (me.Brakes.mode.getValue() == 2 and me.Psi.green.getValue() < 2500) { + if ((me.Brakes.mode.getValue() == 2 and me.Psi.green.getValue() < 2500) or me.Brakes.mode.getValue() == 0) { # Alternate Braking (Yellow OK + Antiskid ON + electric OK) - missing condition: BSCU OK-KO if (me.Psi.yellow.getValue() >= 2500 and me.Brakes.askidSw.getValue() and props.globals.getValue("/systems/electrical/serviceable")) { - if (me.Brakes.lbrake.getValue() > 0) { + if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { me.Brakes.leftPressPsi.setValue(props.globals.getValue("/systems/hydraulic/yellow-psi-ptu")); } else { me.Brakes.leftPressPsi.setValue(0); } - if (me.Brakes.rbrake.getValue() > 0) { + if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { me.Brakes.rightPressPsi.setValue(props.globals.getValue("/systems/hydraulic/yellow-psi-ptu")); } else { me.Brakes.rightPressPsi.setValue(0); @@ -164,12 +150,12 @@ var HYD = { } else { # Alternate Braking (Yellow OK + Antiskid OFF + electric OK) - missing condition: BSCU OK-KO if (me.Psi.yellow.getValue() >= 2500 and !me.Brakes.askidSw.getValue() and props.globals.getValue("/systems/electrical/serviceable")) { - if (me.Brakes.lbrake.getValue() > 0) { + if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { me.Brakes.leftPressPsi.setValue(1000); } else { me.Brakes.leftPressPsi.setValue(0); } - if (me.Brakes.rbrake.getValue() > 0) { + if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { me.Brakes.rightPressPsi.setValue(1000); } else { me.Brakes.rightPressPsi.setValue(0); @@ -177,12 +163,12 @@ var HYD = { } else { # Alternate Braking (Yellow KO or Antiskid KO or electric KO) - missing condition: BSCU OK-KO if (me.Psi.yellow.getValue() < 2500 or !me.Brakes.askidSw.getValue() or !props.globals.getValue("/systems/electrical/serviceable")) { - if (me.Brakes.lbrake.getValue() > 0) { + if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { me.Brakes.leftPressPsi.setValue(me.Brakes.accumPressPsi.getValue()); } else { me.Brakes.leftPressPsi.setValue(0); } - if (me.Brakes.rbrake.getValue() > 0) { + if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) { me.Brakes.rightPressPsi.setValue(me.Brakes.accumPressPsi.getValue()); } else { me.Brakes.rightPressPsi.setValue(0); From 8e780c69d3c68011af5092cc22ab258ae3e1e3f8 Mon Sep 17 00:00:00 2001 From: fly Date: Fri, 27 Nov 2020 23:31:26 +1100 Subject: [PATCH 09/10] Fix tyepo, thanks MiSKLaCH Signed-off-by: fly --- A320-main.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 4a72d646..afdebf6b 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1570,8 +1570,8 @@ 0 - 0 - 0 + 0 + 0 29.92 true 0 From fe1cd02937c519d144e8b41767f7532c0764e86a Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 27 Nov 2020 16:23:29 +0000 Subject: [PATCH 10/10] Optimization of the BLEED Lower ECAM page, fix menubar help item --- A320-main.xml | 12 +++ Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 91 ++++++++++---------- 2 files changed, 58 insertions(+), 45 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index afdebf6b..489f2d47 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -278,6 +278,18 @@ + + + ? + + + nasal + + + + false diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 889ca75c..100b3f89 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -40,6 +40,11 @@ var elac1Node = 0; var elac2Node = 0; var sec1Node = 0; var sec2Node = 0; +var eng_valve_state = 0; +var bleed_valve_cur = 0; +var hp_valve_state = 0; +var xbleedcmdstate = 0; +var ramAirState = 0; # Conversion factor pounds to kilogram LBS2KGS = 0.4535924; @@ -96,6 +101,8 @@ var precooler1_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht- var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-2", 1); var bmc1working = props.globals.getNode("/systems/pneumatics/indicating/bmc1-working", 1); var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1); +var bmc1 = 0; +var bmc2 = 0; var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1); var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 1); var pack1_bypass = props.globals.getNode("/systems/pneumatics/pack-1-bypass", 1); @@ -654,14 +661,15 @@ var canvas_lowerECAM_bleed = { update: func() { # X BLEED xbleedstate = xbleed.getValue(); - if (xbleedcmd.getBoolValue() != xbleedstate) { + xbleedcmdstate = xbleedcmd.getBoolValue(); + if (xbleedcmdstate != xbleedstate) { me["BLEED-XFEED"].setColor(0.7333,0.3803,0); } else { me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); } - if (xbleedcmd.getBoolValue() == xbleedstate) { - if (xbleedcmd.getBoolValue()) { + if (xbleedcmdstate == xbleedstate) { + if (xbleedcmdstate) { me["BLEED-XFEED"].setRotation(0); } else { me["BLEED-XFEED"].setRotation(90 * D2R); @@ -679,7 +687,7 @@ var canvas_lowerECAM_bleed = { } # HP valve 1 - var hp_valve_state = hp_valve1_state.getValue(); + hp_valve_state = hp_valve1_state.getValue(); if (hp_valve_state == 1) { me["BLEED-HP-Valve-1"].setRotation(90 * D2R); @@ -696,8 +704,8 @@ var canvas_lowerECAM_bleed = { } # HP valve 2 - var hp_valve_state = hp_valve2_state.getValue(); - + hp_valve_state = hp_valve2_state.getValue(); + if (hp_valve_state == 1) { me["BLEED-HP-Valve-2"].setRotation(90 * D2R); me["BLEED-HP-2-connection"].show(); @@ -713,15 +721,16 @@ var canvas_lowerECAM_bleed = { } # ENG BLEED valve 1 - var eng_valve_state = systems.PNEU.Switch.bleed1.getValue(); + eng_valve_state = systems.PNEU.Switch.bleed1.getValue(); + bleed_valve_cur = eng_valve1.getValue(); - if (eng_valve1.getValue() == 0) { + if (bleed_valve_cur == 0) { me["BLEED-ENG-1"].setRotation(0); } else { me["BLEED-ENG-1"].setRotation(90 * D2R); } - if (eng_valve_state == eng_valve1.getValue()) { + if (eng_valve_state == bleed_valve_cur) { me["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941); } else { me["BLEED-ENG-1"].setColor(0.7333,0.3803,0); @@ -762,21 +771,25 @@ var canvas_lowerECAM_bleed = { # ENG BLEED valve 2 eng_valve_state = systems.PNEU.Switch.bleed2.getValue(); - - if (eng_valve2.getValue() == 0) { + bleed_valve_cur = eng_valve2.getValue(); + + if (bleed_valve_cur == 0) { me["BLEED-ENG-2"].setRotation(0); } else { me["BLEED-ENG-2"].setRotation(90 * D2R); } - if (eng_valve_state == eng_valve1.getValue()) { + if (eng_valve_state == bleed_valve_cur) { me["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941); } else { me["BLEED-ENG-2"].setColor(0.7333,0.3803,0); } # Precooler inlet 1 - if (bmc1working.getValue()) { + bmc1 = bmc1working.getValue(); + bmc2 = bmc2working.getValue(); + + if (bmc1) { var precooler_psi = precooler1_psi.getValue(); me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); if (precooler_psi < 4 or precooler_psi > 57) { @@ -790,7 +803,7 @@ var canvas_lowerECAM_bleed = { } # Precooler inlet 2 - if (bmc2working.getValue()) { + if (bmc2) { var precooler_psi = precooler2_psi.getValue(); me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); if (precooler_psi < 4 or precooler_psi > 57) { @@ -804,7 +817,7 @@ var canvas_lowerECAM_bleed = { } # Precooler outlet 1 - if (bmc1working.getValue()) { + if (bmc1) { var precooler_temp = precooler1_temp.getValue(); me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); if (systems.PNEU.Switch.bleed1.getValue() and (precooler_temp < 150 or precooler1_ovht.getValue())) { @@ -818,7 +831,7 @@ var canvas_lowerECAM_bleed = { } # Precooler outlet 2 - if (bmc2working.getValue()) { + if (bmc2) { var precooler_temp = precooler2_temp.getValue(); me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); if (systems.PNEU.Switch.bleed2.getValue() and (precooler_temp < 150 or precooler2_ovht.getValue())) { @@ -862,6 +875,7 @@ var canvas_lowerECAM_bleed = { } # PACK 1 ----------------------------------------- + packValveState = systems.PNEU.Valves.pack1.getValue(); me["BLEED-Pack-1-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutTemp.getValue(), 5))); me["BLEED-Pack-1-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutletTemp.getValue(), 5))); @@ -871,9 +885,8 @@ var canvas_lowerECAM_bleed = { me["BLEED-Pack-1-Out-Temp"].setColor(0.0509,0.7529,0.2941); } - var bypass_pos = pack1_bypass.getValue() - 50; # `-50` cause the middel position from where we move the needle is at 50 - bypass_pos = bypass_pos * D2R; - me["BLEED-Pack-1-Bypass-needle"].setRotation(bypass_pos); + # `-50` cause the middel position from where we move the needle is at 50 + me["BLEED-Pack-1-Bypass-needle"].setRotation((pack1_bypass.getValue() - 50) * D2R); if (systems.PNEU.Packs.pack1OutletTemp.getValue() > 230) { me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.7333,0.3803,0); @@ -881,29 +894,24 @@ var canvas_lowerECAM_bleed = { me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); } - var flow_pos = systems.PNEU.Packs.packFlow1.getValue() * D2R; - me["BLEED-Pack-1-Packflow-needle"].setRotation(flow_pos); + me["BLEED-Pack-1-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow1.getValue() * D2R); - if (systems.PNEU.Valves.pack1.getValue() == 0) { + if (packValveState == 0) { me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.7333,0.3803,0); + me["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R); } else { me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); - } - - var pack_state = systems.PNEU.Valves.pack1.getValue(); - if (pack_state == 1) { me["BLEED-Pack-1-Flow-Valve"].setRotation(0); - } else { - me["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R); } - if (pack_state == systems.PNEU.Switch.pack1.getValue()) { + if (packValveState == systems.PNEU.Switch.pack1.getValue()) { me["BLEED-Pack-1-Flow-Valve"].setColor(0.0509,0.7529,0.2941); } else { me["BLEED-Pack-1-Flow-Valve"].setColor(0.7333,0.3803,0); } # PACK 2 ----------------------------------------- + packValveState = systems.PNEU.Valves.pack2.getValue(); me["BLEED-Pack-2-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutTemp.getValue(), 5))); me["BLEED-Pack-2-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutletTemp.getValue(), 5))); @@ -913,9 +921,7 @@ var canvas_lowerECAM_bleed = { me["BLEED-Pack-2-Out-Temp"].setColor(0.0509,0.7529,0.2941); } - var bypass_pos = pack2_bypass.getValue() - 50; # `-50` cause the middel position from where we move the needle is at 50 - bypass_pos = bypass_pos * D2R; - me["BLEED-Pack-2-Bypass-needle"].setRotation(bypass_pos); + me["BLEED-Pack-2-Bypass-needle"].setRotation((pack2_bypass.getValue() - 50) * D2R); if (systems.PNEU.Packs.pack2OutletTemp.getValue() > 230) { me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.7333,0.3803,0); @@ -923,35 +929,30 @@ var canvas_lowerECAM_bleed = { me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); } - flow_pos = systems.PNEU.Packs.packFlow2.getValue() * D2R; - me["BLEED-Pack-2-Packflow-needle"].setRotation(flow_pos); + me["BLEED-Pack-2-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow2.getValue() * D2R); - if (systems.PNEU.Valves.pack2.getValue() == 0) { + if (packValveState == 0) { me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.7333,0.3803,0); + me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R); } else { me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); - } - - var pack_state = systems.PNEU.Valves.pack2.getValue(); - if (pack_state == 1) { me["BLEED-Pack-2-Flow-Valve"].setRotation(0); - } else { - me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R); } - if (pack_state == systems.PNEU.Switch.pack2.getValue()) { + if (packValveState == systems.PNEU.Switch.pack2.getValue()) { me["BLEED-Pack-2-Flow-Valve"].setColor(0.0509,0.7529,0.2941); } else { me["BLEED-Pack-2-Flow-Valve"].setColor(0.7333,0.3803,0); } # Ram Air - if (systems.PNEU.Valves.ramAir.getValue() == 0) { + ramAirState = systems.PNEU.Valves.ramAir.getValue(); + if (ramAirState == 0) { me["BLEED-Ram-Air"].setRotation(90 * D2R); me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); me["BLEED-Ram-Air-connection"].hide(); - } elsif (systems.PNEU.Valves.ramAir.getValue()) { + } elsif (ramAirState) { me["BLEED-Ram-Air"].setRotation(0); if (pts.Gear.wow[1].getValue()) { me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); @@ -970,7 +971,7 @@ var canvas_lowerECAM_bleed = { # Triangles if (systems.PNEU.Valves.pack1.getValue() == 0 and systems.PNEU.Valves.pack2.getValue() == 0) { - if (pts.Gear.wow[1].getValue() or systems.PNEU.Valves.ramAir.getValue() != 1) { + if (pts.Gear.wow[1].getValue() or ramAirState != 1) { me["BLEED-cond-1"].setColor(0.7333,0.3803,0); me["BLEED-cond-2"].setColor(0.7333,0.3803,0); me["BLEED-cond-3"].setColor(0.7333,0.3803,0);