1
0
Fork 0

FCTL / FUEL

This commit is contained in:
Jonathan Redpath 2022-04-21 20:48:44 +01:00
parent d55f4b34d3
commit 96a251eff2
2 changed files with 66 additions and 57 deletions

View file

@ -23,7 +23,7 @@ var canvas_lowerECAMPageFctl =
# init
obj.update_items = [
props.UpdateManager.FromHashList(["green","elac1","elac2","sec2"], nil, func(val) {
props.UpdateManager.FromHashList(["green","elac1","elac2","sec2"], 1, func(val) {
if (val.green >= 1450) {
if (val.elac2 or val.sec2) {
obj["elevLgreen"].setColor(0.0509,0.7529,0.2941);
@ -53,7 +53,7 @@ var canvas_lowerECAMPageFctl =
obj["spdbrkgreen"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["yellow","elac2","sec2"], nil, func(val) {
props.UpdateManager.FromHashList(["yellow","elac2","sec2"], 1, func(val) {
if (val.yellow >= 1450) {
if (val.elac2 or val.sec2) {
obj["elevRyellow"].setColor(0.0509,0.7529,0.2941);
@ -70,7 +70,7 @@ var canvas_lowerECAMPageFctl =
obj["spdbrkyellow"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["blue","elac1","elac2","sec1"], nil, func(val) {
props.UpdateManager.FromHashList(["blue","elac1","elac2","sec1"], 1, func(val) {
if (val.blue >= 1500) {
if (val.elac1) {
obj["ailLblue"].setColor(0.0509,0.7529,0.2941);
@ -106,7 +106,7 @@ var canvas_lowerECAMPageFctl =
props.UpdateManager.FromHashValue("fctlAilR", 0.001, func(val) {
obj["ailR"].setTranslation(0, val * -100);
}),
props.UpdateManager.FromHashList(["blue","green","elac1","elac2"], nil, func(val) {
props.UpdateManager.FromHashList(["blue","green","elac1","elac2"], 1, func(val) {
if ((val.blue < 1500 or !val.elac1) and (val.green < 1500 or !val.elac2)) {
obj["ailL"].setColor(0.7333,0.3803,0);
} else {
@ -124,7 +124,7 @@ var canvas_lowerECAMPageFctl =
props.UpdateManager.FromHashValue("fctlElevR", 0.001, func(val) {
obj["elevR"].setTranslation(0, val * 100);
}),
props.UpdateManager.FromHashList(["blue","green","yellow","elac1","elac2","sec1","sec2"], nil, func(val) {
props.UpdateManager.FromHashList(["blue","green","yellow","elac1","elac2","sec1","sec2"], 1, func(val) {
if ((val.blue < 1500 or (!val.elac1 and !val.sec1)) and (val.green < 1500 or (!val.elac2 and !val.sec2))) {
obj["elevL"].setColor(0.7333,0.3803,0);
} else {
@ -149,7 +149,7 @@ var canvas_lowerECAMPageFctl =
obj["PTupdn"].hide();
}
}),
props.UpdateManager.FromHashValue("elac1", nil, func(val) {
props.UpdateManager.FromHashValue("elac1", 1, func(val) {
if (val) {
obj["elac1"].setColor(0.0509,0.7529,0.2941);
obj["path4249"].setColor(0.0509,0.7529,0.2941);
@ -158,7 +158,7 @@ var canvas_lowerECAMPageFctl =
obj["path4249"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("elac2", nil, func(val) {
props.UpdateManager.FromHashValue("elac2", 1, func(val) {
if (val) {
obj["elac2"].setColor(0.0509,0.7529,0.2941);
obj["path4249-3"].setColor(0.0509,0.7529,0.2941);
@ -167,7 +167,7 @@ var canvas_lowerECAMPageFctl =
obj["path4249-3"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("sec1", nil, func(val) {
props.UpdateManager.FromHashValue("sec1", 1, func(val) {
if (val) {
obj["sec1"].setColor(0.0509,0.7529,0.2941);
obj["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941);
@ -176,7 +176,7 @@ var canvas_lowerECAMPageFctl =
obj["path4249-3-6-7"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("sec2", nil, func(val) {
props.UpdateManager.FromHashValue("sec2", 1, func(val) {
if (val) {
obj["sec2"].setColor(0.0509,0.7529,0.2941);
obj["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941);
@ -185,7 +185,7 @@ var canvas_lowerECAMPageFctl =
obj["path4249-3-6-7-5"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("sec3", nil, func(val) {
props.UpdateManager.FromHashValue("sec3", 1, func(val) {
if (val) {
obj["sec3"].setColor(0.0509,0.7529,0.2941);
obj["path4249-3-6"].setColor(0.0509,0.7529,0.2941);
@ -217,7 +217,7 @@ var canvas_lowerECAMPageFctl =
props.UpdateManager.FromHashValue("fctlRudderTrim", 0.01, func(val) {
obj["rudderTrimInd"].setRotation(val * -0.024);
}),
props.UpdateManager.FromHashValue("fctlTHSJam", nil, func(val) {
props.UpdateManager.FromHashValue("fctlTHSJam", 1, func(val) {
if (val) {
obj["pitchTrimStatus"].setColor(0.7333,0.3803,0);
} else {
@ -314,7 +314,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler5Rex"].show();
}
}),
props.UpdateManager.FromHashList(["spoilerL1Failure","spoilerL1","green"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerL1Failure","spoilerL1","green"], 1, func(val) {
if (val.spoilerL1Failure or val.green < 1500) {
obj["spoiler1Lex"].setColor(0.7333,0.3803,0);
obj["spoiler1Lrt"].setColor(0.7333,0.3803,0);
@ -329,7 +329,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler1Lf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerL2Failure","spoilerL2","yellow"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerL2Failure","spoilerL2","yellow"], 1, func(val) {
if (val.spoilerL2Failure or val.yellow < 1500) {
obj["spoiler2Lex"].setColor(0.7333,0.3803,0);
obj["spoiler2Lrt"].setColor(0.7333,0.3803,0);
@ -344,7 +344,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler2Lf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerL3Failure","spoilerL3","blue"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerL3Failure","spoilerL3","blue"], 1, func(val) {
if (val.spoilerL3Failure or val.blue < 1500) {
obj["spoiler3Lex"].setColor(0.7333,0.3803,0);
obj["spoiler3Lrt"].setColor(0.7333,0.3803,0);
@ -359,7 +359,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler3Lf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerL4Failure","spoilerL4","yellow"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerL4Failure","spoilerL4","yellow"], 1, func(val) {
if (val.spoilerL4Failure or val.yellow < 1500) {
obj["spoiler4Lex"].setColor(0.7333,0.3803,0);
obj["spoiler4Lrt"].setColor(0.7333,0.3803,0);
@ -374,7 +374,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler4Lf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerL5Failure","spoilerL5","green"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerL5Failure","spoilerL5","green"], 1, func(val) {
if (val.spoilerL5Failure or val.green < 1500) {
obj["spoiler5Lex"].setColor(0.7333,0.3803,0);
obj["spoiler5Lrt"].setColor(0.7333,0.3803,0);
@ -389,7 +389,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler5Lf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerR1Failure","spoilerR1","green"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerR1Failure","spoilerR1","green"], 1, func(val) {
if (val.spoilerR1Failure or val.green < 1500) {
obj["spoiler1Rex"].setColor(0.7333,0.3803,0);
obj["spoiler1Rrt"].setColor(0.7333,0.3803,0);
@ -404,7 +404,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler1Rf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerR2Failure","spoilerR2","yellow"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerR2Failure","spoilerR2","yellow"], 1, func(val) {
if (val.spoilerR2Failure or val.yellow < 1500) {
obj["spoiler2Rex"].setColor(0.7333,0.3803,0);
obj["spoiler2Rrt"].setColor(0.7333,0.3803,0);
@ -419,7 +419,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler2Rf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerR3Failure","spoilerR3","blue"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerR3Failure","spoilerR3","blue"], 1, func(val) {
if (val.spoilerR3Failure or val.blue < 1500) {
obj["spoiler3Rex"].setColor(0.7333,0.3803,0);
obj["spoiler3Rrt"].setColor(0.7333,0.3803,0);
@ -434,7 +434,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler3Rf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerR4Failure","spoilerR4","yellow"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerR4Failure","spoilerR4","yellow"], 1, func(val) {
if (val.spoilerR4Failure or val.yellow < 1500) {
obj["spoiler4Rex"].setColor(0.7333,0.3803,0);
obj["spoiler4Rrt"].setColor(0.7333,0.3803,0);
@ -449,7 +449,7 @@ var canvas_lowerECAMPageFctl =
obj["spoiler4Rf"].hide();
}
}),
props.UpdateManager.FromHashList(["spoilerR5Failure","spoilerR5","green"], nil, func(val) {
props.UpdateManager.FromHashList(["spoilerR5Failure","spoilerR5","green"], 1, func(val) {
if (val.spoilerR5Failure or val.green < 1500) {
obj["spoiler5Rex"].setColor(0.7333,0.3803,0);
obj["spoiler5Rrt"].setColor(0.7333,0.3803,0);

View file

@ -99,6 +99,13 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(val, 10)));
}
}),
props.UpdateManager.FromHashValue("fuelCenterQty", 0.25, func(val) {
if (obj.units) {
obj["FUEL-Center-quantity"].setText(sprintf("%s", math.round(val * LBS2KGS, 10)));
} else {
obj["FUEL-Center-quantity"].setText(sprintf("%s", math.round(val, 10)));
}
}),
props.UpdateManager.FromHashValue("fuelLeftInnerQty", 0.25, func(val) {
if (obj.units) {
obj["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(val * LBS2KGS, 10)));
@ -113,17 +120,11 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(val, 10)));
}
}),
props.UpdateManager.FromHashList(["fadecPower1","fadecPower2","fadecPowerStart","fuelflow_1","fuelflow_2"], nil, func(val) {
if (val.fadecPower1 or val.fadecPower2 or val.fadecPowerStart) {
obj["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
if (obj.units) {
obj["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((val.fuelflow_1 + val.fuelflow_2) * LBS2KGS) / 60, 10)));
} else {
obj["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((val.fuelflow_1 + val.fuelflow_2) / 60, 10)));
}
props.UpdateManager.FromHashList(["fuelflow_1","fuelflow_2"], nil, func(val) {
if (obj.units) {
obj.fuelFlowPerMinute = sprintf("%s", math.round(((val.fuelflow_1 + val.fuelflow_2) * LBS2KGS) / 60, 10));
} else {
obj["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0);
obj["FUEL-Flow-per-min"].setText("XX");
obj.fuelFlowPerMinute = sprintf("%s", math.round((val.fuelflow_1 + val.fuelflow_2) / 60, 10));
}
}),
props.UpdateManager.FromHashValue("N1_actual_1", 0.05, func(val) {
@ -144,7 +145,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-ENG-2-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("fuelLeftSwitch1", nil, func(val) {
props.UpdateManager.FromHashValue("fuelLeftSwitch1", 1, func(val) {
if (val) {
obj["FUEL-Pump-Left-1-Open"].show();
obj["FUEL-Pump-Left-1-Closed"].hide();
@ -163,7 +164,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Pump-Left-1-Closed"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("fuelLeftSwitch2", nil, func(val) {
props.UpdateManager.FromHashValue("fuelLeftSwitch2", 1, func(val) {
if (val) {
obj["FUEL-Pump-Left-2-Open"].show();
obj["FUEL-Pump-Left-2-Closed"].hide();
@ -182,7 +183,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Pump-Left-2-Closed"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("fuelCenterSwitch1", nil, func(val) {
props.UpdateManager.FromHashValue("fuelCenterSwitch1", 1, func(val) {
if (val) {
obj["FUEL-Pump-Center-1-Open"].show();
obj["FUEL-Pump-Center-1-Closed"].hide();
@ -201,7 +202,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Pump-Center-1-Closed"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("fuelCenterSwitch2", nil, func(val) {
props.UpdateManager.FromHashValue("fuelCenterSwitch2", 1, func(val) {
if (val) {
obj["FUEL-Pump-Center-2-Open"].show();
obj["FUEL-Pump-Center-2-Closed"].hide();
@ -220,7 +221,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Pump-Center-2-Closed"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("fuelRightSwitch1", nil, func(val) {
props.UpdateManager.FromHashValue("fuelRightSwitch1", 1, func(val) {
if (val) {
obj["FUEL-Pump-Right-1-Open"].show();
obj["FUEL-Pump-Right-1-Closed"].hide();
@ -239,7 +240,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Pump-Right-1-Closed"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("fuelRightSwitch2", nil, func(val) {
props.UpdateManager.FromHashValue("fuelRightSwitch2", 1, func(val) {
if (val) {
obj["FUEL-Pump-Right-2-Open"].show();
obj["FUEL-Pump-Right-2-Closed"].hide();
@ -258,15 +259,15 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Pump-Right-2-Closed"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["fuelCenterSwitch1","fuelCenterSwitch2"], nil, func(val) {
props.UpdateManager.FromHashList(["fuelCenterSwitch1","fuelCenterSwitch2"], 1, func(val) {
if (!val.fuelCenterSwitch1 and !val.fuelCenterSwitch2) {
obj["FUEL-Center-blocked"].show();
} else {
obj["FUEL-Center-blocked"].hide();
}
}),
props.UpdateManager.FromHashList(["fuelCrossfeedValve","fuelCrossfeedSwitch"], nil, func(val) {
if (val.fuelCrossfeedValve == 1) {
props.UpdateManager.FromHashList(["fuelCrossfeedValve","fuelCrossfeedSwitch"], 0.1, func(val) {
if (val.fuelCrossfeedValve >= 0.9) {
obj["FUEL-XFEED"].setRotation(0);
obj["FUEL-XFEED-pipes"].show();
if (val.fuelCrossfeedSwitch) {
@ -278,7 +279,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-XFEED"].setColorFill(0.7333,0.3803,0);
obj["FUEL-XFEED-Cross"].setColorFill(0.7333,0.3803,0);
}
} elsif (val.fuelCrossfeedValve == 0) {
} elsif (val.fuelCrossfeedValve <= 0.1) {
obj["FUEL-XFEED"].setRotation(90 * D2R);
obj["FUEL-XFEED-pipes"].hide();
if (!val.fuelCrossfeedSwitch) {
@ -298,9 +299,9 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-XFEED-Cross"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["fuelEngine1Valve","engineCutoff1"], nil, func(val) {
if (val.fuelEngine1Valve) {
if (val.fuelEngine1Valve == 1) {
props.UpdateManager.FromHashList(["fuelEngine1Valve","engineCutoff1"], 0.1, func(val) {
if (val.fuelEngine1Valve > 0.1) {
if (val.fuelEngine1Valve >= 0.9) {
obj["FUEL-ENG-Master-1"].setRotation(0);
} else {
obj["FUEL-ENG-Master-1"].setRotation(45 * D2R);
@ -327,9 +328,9 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-ENG-1-pipe"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["fuelEngine2Valve","engineCutoff2"], nil, func(val) {
if (val.fuelEngine2Valve) {
if (val.fuelEngine2Valve == 1) {
props.UpdateManager.FromHashList(["fuelEngine2Valve","engineCutoff2"], 0.1, func(val) {
if (val.fuelEngine2Valve > 0.1) {
if (val.fuelEngine1Valve >= 0.9) {
obj["FUEL-ENG-Master-2"].setRotation(0);
} else {
obj["FUEL-ENG-Master-2"].setRotation(45 * D2R);
@ -356,11 +357,11 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-ENG-2-pipe"].setColorFill(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("fuelTransferValve1", nil, func(val) {
if (val == 0) {
props.UpdateManager.FromHashValue("fuelTransferValve1", 0.1, func(val) {
if (val <= 0.1) {
obj["FUEL-Left-Transfer"].hide();
} else {
if (val == 1) {
if (val >= 0.9) {
obj["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941);
} else {
obj["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0);
@ -368,11 +369,11 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Left-Transfer"].show();
}
}),
props.UpdateManager.FromHashValue("fuelTransferValve2", nil, func(val) {
if (val == 0) {
props.UpdateManager.FromHashValue("fuelTransferValve2", 0.1, func(val) {
if (val <= 0.1) {
obj["FUEL-Right-Transfer"].hide();
} else {
if (val == 1) {
if (val >= 0.9) {
obj["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941);
} else {
obj["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0);
@ -387,7 +388,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-On-Board"].setText(sprintf("%s", math.round(val, 10)));
}
}),
props.UpdateManager.FromHashValue("fuelTempLeftOuter", 0.25, func(val) {
props.UpdateManager.FromHashValue("fuelTempLeftOuter", 0.5, func(val) {
obj["FUEL-Left-Outer-temp"].setText(sprintf("%s", math.round(val)));
if (val > 55 or val < -40) {
obj["FUEL-Left-Outer-temp"].setColor(0.7333,0.3803,0);
@ -395,7 +396,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Left-Outer-temp"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashValue("fuelTempLeftInner", 0.25, func(val) {
props.UpdateManager.FromHashValue("fuelTempLeftInner", 0.5, func(val) {
obj["FUEL-Left-Inner-temp"].setText(sprintf("%s", math.round(val)));
if (val > 45 or val < -40) {
obj["FUEL-Left-Inner-temp"].setColor(0.7333,0.3803,0);
@ -403,7 +404,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Left-Inner-temp"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashValue("fuelTempRightInner", 0.25, func(val) {
props.UpdateManager.FromHashValue("fuelTempRightInner", 0.5, func(val) {
obj["FUEL-Right-Inner-temp"].setText(sprintf("%s", math.round(val)));
if (val > 45 or val < -40) {
obj["FUEL-Right-Inner-temp"].setColor(0.7333,0.3803,0);
@ -411,7 +412,7 @@ var canvas_lowerECAMPageFuel =
obj["FUEL-Right-Inner-temp"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashValue("fuelTempRightOuter", 0.25, func(val) {
props.UpdateManager.FromHashValue("fuelTempRightOuter", 0.5, func(val) {
obj["FUEL-Right-Outer-temp"].setText(sprintf("%s", math.round(val)));
if (val > 55 or val < -40) {
obj["FUEL-Right-Outer-temp"].setColor(0.7333,0.3803,0);
@ -545,6 +546,14 @@ var canvas_lowerECAMPageFuel =
update_item.update(notification);
}
if (notification.fadecPower1 or notification.fadecPower2 or notification.fadecPowerStart) {
me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
me["FUEL-Flow-per-min"].setText(me.fuelFlowPerMinute);
} else {
me["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0);
me["FUEL-Flow-per-min"].setText("XX");
}
me.updateBottom(notification);
},
updatePower: func() {