From cfde3e334b3ee5a10082293bceb816b573a09596 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Tue, 3 Jan 2017 16:53:43 +0000 Subject: [PATCH] Revert "Revert: Nasal error, failure not required at this time" This reverts commit 266e6c001990ecf2d936016c133de0d8baf97e86. Conflicts: Nasal/LGCIU.nas --- Nasal/LGCIU.nas | 53 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/Nasal/LGCIU.nas b/Nasal/LGCIU.nas index 7edd97a0..39223a97 100644 --- a/Nasal/LGCIU.nas +++ b/Nasal/LGCIU.nas @@ -51,8 +51,12 @@ var lgciu_two_init = func { setprop("/controls/lgciu[1]/hasbeenret",0); #has the gear been retracted with LGCIU2? setprop("/controls/lgciu[1]/fail",0); #0 = no 1 = yes setprop("/controls/lgciu[1]/emermanext",0); #0 = no 1 = extended can only be retracted if green hyd is available +<<<<<<< HEAD setprop("/controls/lgciu[0]/init",1); #these two properties say that 'everything is ready now' setprop("/controls/lgciu[1]/init",1); +======= + +>>>>>>> parent of 266e6c0... Revert: Nasal error, failure not required at this time } @@ -169,10 +173,16 @@ if ((inuse1 == 1) and (isgearupordown == 0) and (hydsupp == 1)) { setprop("/controls/lgciu[0]/hasbeenret",1); #we have put gear up on lgciu no 1 setprop("/controls/lgciu[0]/inuse",1); #we want to keep active LGCIU on no 1 setprop("/controls/lgciu[0]/gearlever",0); #0 = retracted, 1 = extended +<<<<<<< HEAD +======= +setprop("/controls/lgciu[1]/gearlever",0); #0 = retracted, 1 = extended + +>>>>>>> parent of 266e6c0... Revert: Nasal error, failure not required at this time } else { if ((inuse2 == 1) and (isgearupordown == 0) and (hydsupp == 1)) { setprop("/controls/lgciu[1]/hasbeenret",1); #we have put gear up on lgciu no 2 setprop("/controls/lgciu[1]/inuse",1); #we want to keep active LGCIU on no 2 +setprop("/controls/lgciu[0]/gearlever",0); #0 = retracted, 1 = extended setprop("/controls/lgciu[1]/gearlever",0); #0 = retracted, 1 = extended } } @@ -186,17 +196,33 @@ var hasbeen1 = getprop("/controls/lgciu[0]/hasbeenret"); var hasbeen2 = getprop("/controls/lgciu[1]/hasbeenret"); var isgearupordown = getprop("/controls/gear/gear-down"); var hydsupp = getprop("/controls/lgciu[0]/hyd/greensupply"); +var no1fail = getprop("/controls/lgciu[0]/fail"); +var no2fail = getprop("/controls/lgciu[1]/fail"); if ((inuse1 == 1) and (isgearupordown == 1) and (hasbeen1 == 1) and (hydsupp == 1)) { setprop("/controls/lgciu[0]/hasbeenret",0); #reset retraction sensor setprop("/controls/lgciu[0]/inuse",0); #we want to switch to no 2 after putting the gear down setprop("/controls/lgciu[1]/inuse",1); setprop("/controls/lgciu[0]/gearlever",1); #0 = retracted, 1 = extended -} else { -if ((inuse2 == 1) and (isgearupordown == 1) and (hasbeen2 == 1) and (hydsupp == 1)) { +setprop("/controls/lgciu[1]/gearlever",1); #0 = retracted, 1 = extended +} else if ((inuse2 == 1) and (isgearupordown == 1) and (hasbeen2 == 1) and (hydsupp == 1)) { setprop("/controls/lgciu[1]/hasbeenret",0); #reset retraction sensor setprop("/controls/lgciu[0]/inuse",1); #we want to switch to no 1 after putting the gear down setprop("/controls/lgciu[1]/inuse",0); +setprop("/controls/lgciu[0]/gearlever",1); #0 = retracted, 1 = extended setprop("/controls/lgciu[1]/gearlever",1); #0 = retracted, 1 = extended +} else if ((inuse1 == 1) and isgearupordown == 1) and (hasbeen1 == 1) and (hydsupp ==1) and (no2fail == 1) { +setprop("/controls/lgciu[0]/hasbeenret",0); #reset retraction sensor +setprop("/controls/lgciu[0]/inuse",1); #we want to switch to no 2 after putting the gear down but we cant because it is failed +setprop("/controls/lgciu[1]/inuse",0); +setprop("/controls/lgciu[0]/gearlever",1); #0 = retracted, 1 = extended +setprop("/controls/lgciu[1]/gearlever",1); #0 = retracted, 1 = extended +} else if ((inuse1 == 2) and isgearupordown == 1) and (hasbeen2 == 1) and (hydsupp ==1) and (no1fail == 1) { +setprop("/controls/lgciu[0]/hasbeenret",0); #reset retraction sensor +setprop("/controls/lgciu[1]/inuse",1); #we want to switch to no 1 after putting the gear down but we cant because it is failed +setprop("/controls/lgciu[0]/inuse",0); +setprop("/controls/lgciu[0]/gearlever",1); #0 = retracted, 1 = extended +setprop("/controls/lgciu[1]/gearlever",1); #0 = retracted, 1 = extended +<<<<<<< HEAD } else if ((inuse1 == 1) and (isgearupordown == 1) and (hasbeen1 == 1) and (hydsupp ==1) and (no2fail == 1)) { setprop("/controls/lgciu[0]/hasbeenret",0); #reset retraction sensor setprop("/controls/lgciu[0]/inuse",1); #we want to switch to no 2 after putting the gear down but we cant because it is failed @@ -233,6 +259,29 @@ setprop("/controls/lgciu[0]/inuse",1); print("LGCIU No 2... Failed!"); } else { print("LGCIU No 2... Serviceable!"); +======= } }); +# No 1 failed +setlistener("/controls/lgciu[0]/fail", func { +var no1fail = getprop("/controls/lgciu[0]/fail"); +if (no1fail == 1) { +setprop("/controls/lgciu[0]/inuse",0); +setprop("/controls/lgciu[1]/inuse",1); +} else { +print("LGCIU No 1... Serviceable!"); +>>>>>>> parent of 266e6c0... Revert: Nasal error, failure not required at this time +} +}); + +# No 2 failed +setlistener("/controls/lgciu[1]/fail", func { +var no2fail = getprop("/controls/lgciu[1]/fail"); +if (no2fail == 1) { +setprop("/controls/lgciu[1]/inuse",0); +setprop("/controls/lgciu[0]/inuse",1); +} else { +print("LGCIU No 2... Serviceable!"); +} +});