1
0
Fork 0

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.

This commit is contained in:
legoboyvdlp R 2020-11-26 17:20:34 +00:00
parent 2dc42e388c
commit 55e4dac6ac
5 changed files with 101 additions and 12 deletions

View file

@ -1284,6 +1284,7 @@
<fac2 type="bool">0</fac2>
<rtlu-1 type="bool">0</rtlu-1>
<rtlu-2 type="bool">0</rtlu-2>
<ths-jam type="bool">0</ths-jam>
<yaw-damper-1 type="bool">0</yaw-damper-1>
<yaw-damper-2 type="bool">0</yaw-damper-2>
</fctl>

View file

@ -144,6 +144,16 @@
<live>true</live>
</checkbox>
<checkbox>
<label>THS</label>
<halign>left</halign>
<property>/systems/failures/fctl/ths-jam</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Yaw Damper 1</label>
<halign>left</halign>

View file

@ -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);

View file

@ -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);

View file

@ -241,16 +241,42 @@
<switch name="hydraulics/elevator-l/pressure-switch-or">
<default value="0"/>
<test logic="OR" value="1">
/systems/hydraulic/green-psi ge 1500
/systems/hydraulic/blue-psi ge 1500
<test logic="AND">
<test logic="OR">
/systems/fctl/elac1 eq 1
/systems/fctl/sec1 eq 1
</test>
/systems/hydraulic/blue-psi ge 1500
</test>
<test logic="AND">
<test logic="OR">
/systems/fctl/elac2 eq 1
/systems/fctl/sec2 eq 1
</test>
/systems/hydraulic/green-psi ge 1500
</test>
</test>
</switch>
<switch name="hydraulics/elevator-l/switch">
<default value="hydraulics/elevator-droop"/>
<test logic="AND" value="0">
<test logic="OR">
/systems/hydraulic/blue-psi ge 1500
/systems/hydraulic/green-psi ge 1500
</test>
/systems/failures/elevator-left eq 0
<test logic="AND"> <!-- only pitch trim available -->
/systems/fctl/elac1 eq 0
/systems/fctl/sec1 eq 0
/systems/fctl/elac2 eq 0
/systems/fctl/sec2 eq 0
</test>
</test>
<test logic="AND" value="hydraulics/elevator-output-switch">
hydraulics/elevator-l/pressure-switch-or eq 1
/systems/failures/elevator-left eq 0
/it-fbw/law ne 3
</test>
<clipto>
<min>-1.0</min>
@ -281,16 +307,42 @@
<switch name="hydraulics/elevator-r/pressure-switch-or">
<default value="0"/>
<test logic="OR" value="1">
/systems/hydraulic/yellow-psi ge 1500
/systems/hydraulic/blue-psi ge 1500
<test logic="AND">
<test logic="OR">
/systems/fctl/elac1 eq 1
/systems/fctl/sec1 eq 1
</test>
/systems/hydraulic/blue-psi ge 1500
</test>
<test logic="AND">
<test logic="OR">
/systems/fctl/elac2 eq 1
/systems/fctl/sec2 eq 1
</test>
/systems/hydraulic/yellow-psi ge 1500
</test>
</test>
</switch>
<switch name="hydraulics/elevator-r/switch">
<default value="hydraulics/elevator-droop"/>
<test logic="AND" value="0">
<test logic="OR">
/systems/hydraulic/blue-psi ge 1500
/systems/hydraulic/yellow-psi ge 1500
</test>
/systems/failures/elevator-right eq 0
<test logic="AND"> <!-- only pitch trim available -->
/systems/fctl/elac1 eq 0
/systems/fctl/sec1 eq 0
/systems/fctl/elac2 eq 0
/systems/fctl/sec2 eq 0
</test>
</test>
<test logic="AND" value="hydraulics/elevator-output-switch">
hydraulics/elevator-r/pressure-switch-or eq 1
/systems/failures/elevator-right eq 0
/it-fbw/law ne 3
</test>
<clipto>
<min>-1.0</min>
@ -319,7 +371,10 @@
<channel name="Pitch Trim">
<switch name="hydraulics/elevator-trim/rate">
<default value="0.125"/>
<default value="0"/> <!-- only mechanical input to hyd actuator. So it does need hydraulic power -->
<test logic="OR" value="0">
/systems/failures/fctl/ths-jam eq 1
</test>
<test logic="OR" value="0.25">
/systems/hydraulic/yellow-psi ge 1500
/systems/hydraulic/green-psi ge 1500