Implement functional fuel prediction page (mostly done)
This commit is contained in:
parent
1055c950a0
commit
74d6e59784
5 changed files with 399 additions and 50 deletions
|
@ -1913,6 +1913,7 @@
|
|||
<file>Aircraft/A320-family/Nasal/MCDU/MCDU.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/INITA.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/INITB.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/FUELPRED.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/PERFAPPR.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/PERFCLB.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/PERFCRZ.nas</file>
|
||||
|
|
|
@ -119,14 +119,8 @@ var managedSpeed = props.globals.getNode("it-autoflight/input/spd-managed", 1);
|
|||
|
||||
# INT-A variables
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# PREF
|
||||
|
||||
|
||||
|
||||
# Fetch nodes into vectors
|
||||
var pageProp = [props.globals.getNode("MCDU[0]/page", 1), props.globals.getNode("MCDU[1]/page", 1)];
|
||||
var active = [props.globals.getNode("MCDU[0]/active", 1), props.globals.getNode("MCDU[1]/active", 1)];
|
||||
|
@ -197,8 +191,8 @@ var canvas_MCDU_base = {
|
|||
return ["Simple","Simple_Center","Scratchpad","Simple_Title","Simple_PageNum","ArrowLeft","ArrowRight","Simple_L1","Simple_L2","Simple_L3","Simple_L4","Simple_L5","Simple_L6","Simple_L0S","Simple_L1S","Simple_L2S","Simple_L3S","Simple_L4S","Simple_L5S","Simple_L6S",
|
||||
"Simple_L1_Arrow","Simple_L2_Arrow","Simple_L3_Arrow","Simple_L4_Arrow","Simple_L5_Arrow","Simple_L6_Arrow","Simple_R1","Simple_R2","Simple_R3","Simple_R4","Simple_R5","Simple_R6","Simple_R1S","Simple_R2S","Simple_R3S","Simple_R4S","Simple_R5S",
|
||||
"Simple_R6S","Simple_R1_Arrow","Simple_R2_Arrow","Simple_R3_Arrow","Simple_R4_Arrow","Simple_R5_Arrow","Simple_R6_Arrow","Simple_C1","Simple_C2","Simple_C3","Simple_C4","Simple_C5","Simple_C6","Simple_C1S","Simple_C2S","Simple_C3S","Simple_C4S",
|
||||
"Simple_C5S","Simple_C6S","INITA","INITA_CoRoute","INITA_FltNbr","INITA_CostIndex","INITA_CruiseFLTemp","INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFW_S","INITB_Block","PERFTO","PERFTO_V1","PERFTO_VR",
|
||||
"PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR","PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE"];
|
||||
"Simple_C5S","Simple_C6S","INITA","INITA_CoRoute","INITA_FltNbr","INITA_CostIndex","INITA_CruiseFLTemp","INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFW_S","INITB_Block","FUELPRED","FUELPRED_ZFW","FUELPRED_ZFWCG","FUELPRED_ZFW_S",
|
||||
"PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR","PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE"];
|
||||
},
|
||||
update: func() {
|
||||
if (ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) {
|
||||
|
@ -222,6 +216,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].hide();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -306,6 +301,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].hide();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -390,6 +386,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].hide();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -472,6 +469,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].hide();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -559,6 +557,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -658,6 +657,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].hide();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -799,6 +799,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].hide();
|
||||
me["INITA"].show();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -950,6 +951,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].show();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -1043,7 +1045,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R5"].setText(trip_wind.getValue());
|
||||
me["Simple_R6S"].setText("EXTRA/TIME");
|
||||
|
||||
if (blockSet.getValue() == 1) {
|
||||
if (blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
|
@ -1054,8 +1056,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
|
||||
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
|
||||
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
|
||||
me["Simple_R2"].show();
|
||||
me["Simple_R3S"].hide();
|
||||
me["Simple_R3S"].hide();
|
||||
me["Simple_R3"].hide();
|
||||
me["Simple_R3_Arrow"].hide();
|
||||
me["Simple_C4"].hide();
|
||||
|
@ -1063,7 +1064,6 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
|
||||
|
||||
me["Simple_Title"].setText("INIT FUEL PREDICTION ");
|
||||
me["INITB_Block"].hide();
|
||||
|
||||
me.colorLeft("ack", "grn", "blu", "blu", "blu", "blu");
|
||||
me.colorRight("ack", "ack", "ack", "grn", "ack", "grn");
|
||||
|
@ -1073,7 +1073,6 @@ var canvas_MCDU_base = {
|
|||
me["Simple_L4"].setText("---.-/----");
|
||||
me["Simple_L5"].setText("---.-/----");
|
||||
me["Simple_L6"].setText("---.-");
|
||||
me["Simple_R2"].hide();
|
||||
me["Simple_R3S"].show();
|
||||
me["Simple_R3"].show();
|
||||
me["Simple_R3_Arrow"].show();
|
||||
|
@ -1087,7 +1086,6 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R6"].setText("---.-/----");
|
||||
|
||||
me["Simple_Title"].setText("INIT");
|
||||
me["INITB_Block"].show();
|
||||
}
|
||||
|
||||
me["Simple_R1S"].setText("ZFWCG/ ZFW");
|
||||
|
@ -1112,12 +1110,21 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R1"].hide();
|
||||
}
|
||||
|
||||
if (blockSet.getValue() == 1) {
|
||||
me["Simple_R2"].show();
|
||||
me["INITB_Block"].hide();
|
||||
} else {
|
||||
me["Simple_R2"].hide();
|
||||
me["INITB_Block"].show();
|
||||
}
|
||||
|
||||
} else if (page == "FUELPRED") {
|
||||
if (!pageSwitch[i].getBoolValue()) {
|
||||
me["Simple"].show();
|
||||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].show();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -1148,7 +1155,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_L6_Arrow"].hide();
|
||||
me["Simple_C1"].show();
|
||||
me["Simple_C2"].show();
|
||||
me["Simple_C3"].hide();
|
||||
me["Simple_C3"].show();
|
||||
me["Simple_C4"].hide();
|
||||
me["Simple_C5"].hide();
|
||||
me["Simple_C6"].hide();
|
||||
|
@ -1160,16 +1167,16 @@ var canvas_MCDU_base = {
|
|||
me["Simple_C6S"].hide();
|
||||
me["Simple_R1"].show();
|
||||
me["Simple_R2"].show();
|
||||
me["Simple_R3"].show();
|
||||
me["Simple_R3"].hide();
|
||||
me["Simple_R4"].show();
|
||||
me["Simple_R5"].hide();
|
||||
me["Simple_R6"].hide();
|
||||
me["Simple_R5"].show();
|
||||
me["Simple_R6"].show();
|
||||
me["Simple_R1S"].show();
|
||||
me["Simple_R2S"].hide();
|
||||
me["Simple_R3S"].show();
|
||||
me["Simple_R4S"].show();
|
||||
me["Simple_R5S"].hide();
|
||||
me["Simple_R6S"].hide();
|
||||
me["Simple_R5S"].show();
|
||||
me["Simple_R6S"].show();
|
||||
me["Simple_R1_Arrow"].hide();
|
||||
me["Simple_R2_Arrow"].hide();
|
||||
me["Simple_R3_Arrow"].hide();
|
||||
|
@ -1182,15 +1189,15 @@ var canvas_MCDU_base = {
|
|||
me.fontRight(default, default, default, default, default, default);
|
||||
me.fontRightS(default, default, default, default, default, default);
|
||||
|
||||
me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
|
||||
me.fontSizeRight(normal, normal, normal, normal, normal, normal);
|
||||
me.fontSizeLeft(normal, normal, small, small, small, small);
|
||||
me.fontSizeRight(normal, normal, small, small, small, small);
|
||||
|
||||
me.colorLeft("grn", "grn", "blu", "blu", "blu", "grn");
|
||||
me.colorLeft("grn", "grn", "wht", "wht", "wht", "wht");
|
||||
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorCenter("grn", "grn", "wht", "wht", "wht", "wht");
|
||||
me.colorCenter("grn", "grn", "blu", "wht", "wht", "wht");
|
||||
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorRight("grn", "grn", "blu", "blu", "wht", "wht");
|
||||
me.colorRight("grn", "grn", "blu", "wht", "wht", "wht");
|
||||
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
|
||||
|
@ -1202,18 +1209,14 @@ var canvas_MCDU_base = {
|
|||
} else {
|
||||
me["Simple_L1"].setText(arrArpt.getValue());
|
||||
}
|
||||
|
||||
me["Simple_L2"].setText("----");
|
||||
me["Simple_L3"].setText("--.-/--.-");
|
||||
me["Simple_L4"].setText("-.-/-.-");
|
||||
me["Simple_L5"].setText("--.-/----");
|
||||
me["Simple_L6"].setText("--.-/----");
|
||||
|
||||
me["Simple_L1S"].setText("AT");
|
||||
me["Simple_L2S"].setText("X");
|
||||
me["Simple_L3S"].setText("GW/CG");
|
||||
me["Simple_L4S"].setText("RTE RSV/");
|
||||
me["Simple_L3S"].setText("RTE RSV/PCT");
|
||||
me["Simple_L4S"].setText("ALTN/TIME");
|
||||
me["Simple_L5S"].setText("FINAL/TIME");
|
||||
me["Simple_L6S"].setText("EXTRA/TIME");
|
||||
me["Simple_L6S"].setText("MIN DEST FOB");
|
||||
|
||||
me["Simple_C1S"].setText("UTC");
|
||||
me["Simple_C1"].setText("----");
|
||||
|
@ -1221,17 +1224,69 @@ var canvas_MCDU_base = {
|
|||
|
||||
me["Simple_R1"].setText("-.-");
|
||||
me["Simple_R2"].setText("-.-");
|
||||
me["Simple_R3"].setText("-.-/--+--");
|
||||
me["Simple_R4"].setText("----*/36090");
|
||||
me["Simple_R1S"].setText("EFOB");
|
||||
me["Simple_R3S"].setText("FOB");
|
||||
me["Simple_R4S"].setText("CRZTEMP/TROPO");
|
||||
me["Simple_R2S"].setText("X");
|
||||
me["Simple_R4S"].setText("FOB ");
|
||||
me["Simple_R5S"].setText(" GW/ CG");
|
||||
me["Simple_R6S"].setText("EXTRA/TIME");
|
||||
|
||||
if (blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
|
||||
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
|
||||
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
|
||||
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
|
||||
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
|
||||
|
||||
me["Simple_R4"].setText(sprintf("%4.1f/FF+FQ", 0.0));
|
||||
me["Simple_R5"].setText(sprintf("%4.1f/", 0.0) ~ sprintf("%4.1f", 0.0));
|
||||
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
|
||||
|
||||
me.colorLeft("ack", "ack", "blu", "blu", "blu", "blu");
|
||||
me.colorRight("ack", "ack", "blu", "grn", "grn", "grn");
|
||||
} else {
|
||||
me["Simple_L3"].setText("---.-/---.-");
|
||||
me["Simple_L4"].setText("---.-/----");
|
||||
me["Simple_L5"].setText("---.-/----");
|
||||
me["Simple_L6"].setText("---.-");
|
||||
|
||||
me["Simple_R4"].setText("---.-/FF+FQ");
|
||||
me["Simple_R5"].setText("---.-/---.-");
|
||||
me["Simple_R6"].setText("---.-/----");
|
||||
}
|
||||
|
||||
me["Simple_R3S"].setText("ZFWCG/ZFW");
|
||||
me["Simple_R3"].setText(sprintf("%3.1f", zfw.getValue()));
|
||||
if (zfwcgSet.getValue() == 1) {
|
||||
me["Simple_C3"].setFontSize(normal);
|
||||
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
|
||||
me["FUELPRED_ZFWCG"].hide();
|
||||
} else {
|
||||
me["Simple_C3"].setFontSize(small);
|
||||
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
|
||||
me["FUELPRED_ZFWCG"].hide();
|
||||
}
|
||||
|
||||
if (zfwSet.getValue() == 1) {
|
||||
me["FUELPRED_ZFW"].hide();
|
||||
me["FUELPRED_ZFW_S"].show();
|
||||
me["Simple_R3"].show();
|
||||
} else {
|
||||
me["FUELPRED_ZFW"].show();
|
||||
me["FUELPRED_ZFW_S"].hide();
|
||||
me["Simple_R3"].hide();
|
||||
}
|
||||
|
||||
} else if (page == "TO") {
|
||||
if (!pageSwitch[i].getBoolValue()) {
|
||||
me["Simple"].show();
|
||||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].show();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -1416,6 +1471,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].show();
|
||||
me["PERFGA"].hide();
|
||||
|
@ -1554,6 +1610,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].show();
|
||||
|
@ -1683,6 +1740,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Center"].show();
|
||||
me["INITA"].hide();
|
||||
me["INITB"].hide();
|
||||
me["FUELPRED"].hide();
|
||||
me["PERFTO"].hide();
|
||||
me["PERFAPPR"].hide();
|
||||
me["PERFGA"].hide();
|
||||
|
|
|
@ -37,17 +37,17 @@
|
|||
guidetolerance="20"
|
||||
inkscape:pageopacity="1"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1035"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="730"
|
||||
id="namedview371"
|
||||
showgrid="true"
|
||||
inkscape:zoom="0.5"
|
||||
inkscape:cx="997.98642"
|
||||
inkscape:cy="772.65269"
|
||||
inkscape:zoom="0.55334531"
|
||||
inkscape:cx="846.30776"
|
||||
inkscape:cy="468.14561"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="23"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Simple"
|
||||
inkscape:current-layer="FUELPRED"
|
||||
showguides="false"
|
||||
inkscape:snap-global="false"
|
||||
units="px"
|
||||
|
@ -1404,6 +1404,123 @@
|
|||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="FUELPRED"
|
||||
inkscape:label="FUELPRED">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="818.74951"
|
||||
y="421.89355"
|
||||
id="FUELPRED_ZFW_S"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1051"
|
||||
x="818.74951"
|
||||
y="421.89355"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">/</tspan></text>
|
||||
<g
|
||||
id="FUELPRED_ZFW"
|
||||
inkscape:label="#g3600"
|
||||
transform="translate(0,236.8)">
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
id="text1056"
|
||||
y="187.10254"
|
||||
x="980.0838"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1"
|
||||
y="187.10254"
|
||||
x="980.0838"
|
||||
id="tspan1054"
|
||||
sodipodi:role="line">.</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
id="text1060"
|
||||
y="187.10254"
|
||||
x="818.74951"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1"
|
||||
y="187.10254"
|
||||
x="818.74951"
|
||||
id="tspan1058"
|
||||
sodipodi:role="line">/</tspan></text>
|
||||
<g
|
||||
transform="translate(0,44.720803)"
|
||||
id="g1068">
|
||||
<rect
|
||||
y="100.6336"
|
||||
x="968.38361"
|
||||
height="41.350403"
|
||||
width="39.4547"
|
||||
id="rect1062"
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#bb6100;stroke-width:4.03199;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
<rect
|
||||
y="100.6336"
|
||||
x="889.46741"
|
||||
height="41.350403"
|
||||
width="39.4547"
|
||||
id="rect1064"
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#bb6100;stroke-width:4.03199;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#bb6100;stroke-width:4.03199;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect1066"
|
||||
width="39.4547"
|
||||
height="41.350403"
|
||||
x="850.01111"
|
||||
y="100.6336" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="FUELPRED_ZFWCG"
|
||||
inkscape:label="#g3610"
|
||||
transform="translate(-34.71127,236.52639)">
|
||||
<g
|
||||
transform="translate(0,44.720803)"
|
||||
id="g1077">
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#bb6100;stroke-width:4.03199;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect1071"
|
||||
width="39.4547"
|
||||
height="41.350403"
|
||||
x="759.62421"
|
||||
y="100.6336" />
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#bb6100;stroke-width:4.03199;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect1073"
|
||||
width="39.4547"
|
||||
height="41.350403"
|
||||
x="680.70801"
|
||||
y="100.6336" />
|
||||
<rect
|
||||
y="100.6336"
|
||||
x="641.25171"
|
||||
height="41.350403"
|
||||
width="39.4547"
|
||||
id="rect1075"
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#bb6100;stroke-width:4.03199;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="769.53815"
|
||||
y="187.10254"
|
||||
id="text1081"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1079"
|
||||
x="769.53815"
|
||||
y="187.10254"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1">.</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="PERFTO"
|
||||
|
@ -1610,7 +1727,7 @@
|
|||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||
y="187.10254"
|
||||
x="399.48752"
|
||||
id="tspan1079"
|
||||
id="tspan1115"
|
||||
sodipodi:role="line">F</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
|
@ -1693,7 +1810,7 @@
|
|||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||
y="187.10254"
|
||||
x="399.48752"
|
||||
id="tspan1079"
|
||||
id="tspan1129"
|
||||
sodipodi:role="line">F</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
|
@ -1704,7 +1821,7 @@
|
|||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1082"
|
||||
id="tspan1132"
|
||||
x="398.21817"
|
||||
y="304.35275"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">S</tspan></text>
|
||||
|
@ -1719,7 +1836,7 @@
|
|||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||
y="422.15305"
|
||||
x="398.21817"
|
||||
id="tspan1085"
|
||||
id="tspan1135"
|
||||
sodipodi:role="line">O</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
|
@ -1730,7 +1847,7 @@
|
|||
transform="scale(0.90642126,1.1032398)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1088"
|
||||
id="tspan1138"
|
||||
x="478.87796"
|
||||
y="171.04486"
|
||||
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">=</tspan></text>
|
||||
|
@ -1745,7 +1862,7 @@
|
|||
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||
y="278.32764"
|
||||
x="478.87796"
|
||||
id="tspan1091"
|
||||
id="tspan1141"
|
||||
sodipodi:role="line">=</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
|
@ -1756,7 +1873,7 @@
|
|||
transform="scale(0.90642126,1.1032398)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1094"
|
||||
id="tspan1144"
|
||||
x="478.87796"
|
||||
y="385.6102"
|
||||
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">=</tspan></text>
|
||||
|
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 101 KiB |
165
Nasal/MCDU/FUELPRED.nas
Normal file
165
Nasal/MCDU/FUELPRED.nas
Normal file
|
@ -0,0 +1,165 @@
|
|||
# A3XX mCDU by Joshua Davidson (Octal450) and Jonathan Redpath
|
||||
|
||||
# Copyright (c) 2020 Matthew Maring (hayden2000)
|
||||
|
||||
# From INIT-B
|
||||
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);
|
||||
var zfwcgSet = props.globals.getNode("FMGC/internal/zfwcg-set", 1);
|
||||
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
|
||||
var zfwSet = props.globals.getNode("FMGC/internal/zfw-set", 1);
|
||||
var block = props.globals.getNode("FMGC/internal/block", 1);
|
||||
var blockSet = props.globals.getNode("FMGC/internal/block-set", 1);
|
||||
var taxi_fuel = props.globals.getNode("FMGC/internal/taxi-fuel", 1);
|
||||
var trip_fuel = props.globals.getNode("FMGC/internal/trip-fuel", 1);
|
||||
var trip_time = props.globals.getNode("FMGC/internal/trip-time", 1);
|
||||
var rte_rsv = props.globals.getNode("FMGC/internal/rte-rsv", 1);
|
||||
var rte_percent = props.globals.getNode("FMGC/internal/rte-percent", 1);
|
||||
var alt_fuel = props.globals.getNode("FMGC/internal/alt-fuel", 1);
|
||||
var alt_time = props.globals.getNode("FMGC/internal/alt-time", 1);
|
||||
var final_fuel = props.globals.getNode("FMGC/internal/final-fuel", 1);
|
||||
var final_time = props.globals.getNode("FMGC/internal/final-time", 1);
|
||||
var min_dest_fob = props.globals.getNode("FMGC/internal/min-dest-fob", 1);
|
||||
var tow = props.globals.getNode("FMGC/internal/tow", 1);
|
||||
var lw = props.globals.getNode("FMGC/internal/lw", 1);
|
||||
var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
|
||||
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
|
||||
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
||||
|
||||
# FUELPRED Specials
|
||||
var alt_airport = props.globals.getNode("FMGC/internal/alt-airport", 1);
|
||||
var pri_utc = props.globals.getNode("FMGC/internal/pri-utc", 1);
|
||||
var alt_utc = props.globals.getNode("FMGC/internal/alt-utc", 1);
|
||||
var pri_efob = props.globals.getNode("FMGC/internal/pri-efob", 1);
|
||||
var alt_efob = props.globals.getNode("FMGC/internal/alt-efob", 1);
|
||||
|
||||
var fob = props.globals.getNode("FMGC/internal/fob", 1);
|
||||
var gw = props.globals.getNode("FMGC/internal/gw", 1);
|
||||
var gc = props.globals.getNode("FMGC/internal/gc", 1);
|
||||
|
||||
|
||||
var fuelPredInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
|
||||
var perc = split("/", scratchpad)[1];
|
||||
if (perc >= 0.0 and perc <= 100.0) {
|
||||
setprop("FMGC/internal/rte-rsv", num(perc) / 100 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", perc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= trip_fuel.getValue()) {
|
||||
setprop("FMGC/internal/rte-rsv", scratchpad);
|
||||
setprop("FMGC/internal/rte-percent", scratchpad / num(trip_fuel.getValue()) * 100);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/alt-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/final-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw = getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) {
|
||||
var zfwi = split("/", scratchpad);
|
||||
var zfwcg = size(zfwi[0]);
|
||||
var zfw = size(zfwi[1]);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
if (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
if ((zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) or (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9)) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -170,6 +170,8 @@ var lskbutton = func(btn, i) {
|
|||
initInputA("L3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("L3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
fuelPredInput("L3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||
|
@ -190,6 +192,8 @@ var lskbutton = func(btn, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/page", "STATUS");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("L4",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
fuelPredInput("L4",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L4",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||
|
@ -206,6 +210,8 @@ var lskbutton = func(btn, i) {
|
|||
initInputA("L5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("L5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
fuelPredInput("L5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||
|
@ -286,6 +292,8 @@ var rskbutton = func(btn, i) {
|
|||
} else if (btn == "3") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
fuelPredInput("R3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("R3",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||
|
|
Loading…
Add table
Reference in a new issue