Merge branch 'FMGC' of github.com:it0uchpods/IDG-A32X into FMGC
This commit is contained in:
commit
f7c455edd4
13 changed files with 1120 additions and 479 deletions
Models/Instruments
MCDU
ND/canvas
Nasal
Systems
|
@ -11,8 +11,7 @@ var symbol = "helvetica_medium.txf";
|
|||
var normal = 70;
|
||||
var small = 56;
|
||||
var page = "";
|
||||
var flightNum = props.globals.initNode("/MCDUC/flight-num", "", "STRING");
|
||||
var flightNumSet = props.globals.initNode("/MCDUC/flight-num-set", 0, "BOOL");
|
||||
var fplnLineSize = 0;
|
||||
var fplnl1 = "";
|
||||
var fplnl1s = "";
|
||||
var fplnl2 = "";
|
||||
|
@ -41,6 +40,12 @@ setprop("/MCDUC/colors/yel/r", 0.9333);
|
|||
setprop("/MCDUC/colors/yel/g", 0.9333);
|
||||
setprop("/MCDUC/colors/yel/b", 0.0000);
|
||||
|
||||
var WHITE = [1.0000,1.0000,1.0000];
|
||||
var GREEN = [0.0509,0.7529,0.2941];
|
||||
var BLUE = [0.0901,0.6039,0.7176];
|
||||
var AMBER = [0.7333,0.3803,0.0000];
|
||||
var YELLOW = [0.9333,0.9333,0.0000];
|
||||
|
||||
# Fetch nodes:
|
||||
var ac1 = props.globals.getNode("/systems/electrical/bus/ac1", 1);
|
||||
var ac2 = props.globals.getNode("/systems/electrical/bus/ac2", 1);
|
||||
|
@ -106,33 +111,15 @@ var engOutAcc = props.globals.getNode("/FMGC/internal/eng-out-reduc", 1);
|
|||
var engOutAccSet = props.globals.getNode("/MCDUC/reducacc-set", 1);
|
||||
var transAlt = props.globals.getNode("/FMGC/internal/trans-alt", 1);
|
||||
var managedSpeed = props.globals.getNode("/it-autoflight/input/spd-managed", 1);
|
||||
var TMPYActive = [props.globals.getNode("/FMGC/internal/tmpy-active[0]"), props.globals.getNode("/FMGC/internal/tmpy-active[1]")];
|
||||
|
||||
# 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)];
|
||||
var scratchpad = [props.globals.getNode("/MCDU[0]/scratchpad", 1), props.globals.getNode("/MCDU[1]/scratchpad", 1)];
|
||||
var fplnL1 = [props.globals.getNode("/MCDU[0]/F-PLN/left-1", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-1", 1)];
|
||||
var fplnL2 = [props.globals.getNode("/MCDU[0]/F-PLN/left-2", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-2", 1)];
|
||||
var fplnL3 = [props.globals.getNode("/MCDU[0]/F-PLN/left-3", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-3", 1)];
|
||||
var fplnL4 = [props.globals.getNode("/MCDU[0]/F-PLN/left-4", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-4", 1)];
|
||||
var fplnL5 = [props.globals.getNode("/MCDU[0]/F-PLN/left-5", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-5", 1)];
|
||||
var fplnL6 = [props.globals.getNode("/MCDU[0]/F-PLN/left-6", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-6", 1)];
|
||||
var fplnL1s = [props.globals.getNode("/MCDU[0]/F-PLN/left-1s", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-1s", 1)];
|
||||
var fplnL2s = [props.globals.getNode("/MCDU[0]/F-PLN/left-2s", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-2s", 1)];
|
||||
var fplnL3s = [props.globals.getNode("/MCDU[0]/F-PLN/left-3s", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-3s", 1)];
|
||||
var fplnL4s = [props.globals.getNode("/MCDU[0]/F-PLN/left-4s", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-4s", 1)];
|
||||
var fplnL5s = [props.globals.getNode("/MCDU[0]/F-PLN/left-5s", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-5s", 1)];
|
||||
var fplnL6s = [props.globals.getNode("/MCDU[0]/F-PLN/left-6s", 1), props.globals.getNode("/MCDU[1]/F-PLN/left-6s", 1)];
|
||||
var fpln1c = [props.globals.getNode("/MCDU[0]/F-PLN/line-1c", 1), props.globals.getNode("/MCDU[1]/F-PLN/line-1c", 1)];
|
||||
var fpln2c = [props.globals.getNode("/MCDU[0]/F-PLN/line-2c", 1), props.globals.getNode("/MCDU[1]/F-PLN/line-2c", 1)];
|
||||
var fpln3c = [props.globals.getNode("/MCDU[0]/F-PLN/line-3c", 1), props.globals.getNode("/MCDU[1]/F-PLN/line-3c", 1)];
|
||||
var fpln4c = [props.globals.getNode("/MCDU[0]/F-PLN/line-4c", 1), props.globals.getNode("/MCDU[1]/F-PLN/line-4c", 1)];
|
||||
var fpln5c = [props.globals.getNode("/MCDU[0]/F-PLN/line-5c", 1), props.globals.getNode("/MCDU[1]/F-PLN/line-5c", 1)];
|
||||
var fpln6c = [props.globals.getNode("/MCDU[0]/F-PLN/line-6c", 1), props.globals.getNode("/MCDU[1]/F-PLN/line-6c", 1)];
|
||||
|
||||
# Create Nodes:
|
||||
var pageSwitch = [props.globals.initNode("/MCDU[0]/internal/switch", 0, "BOOL"), props.globals.initNode("/MCDU[1]/internal/switch", 0, "BOOL")];
|
||||
var fplnCSwitch = [props.globals.initNode("/MCDU[0]/internal/fpln-c-switch", 0, "BOOL"), props.globals.initNode("/MCDU[1]/internal/fpln-c-switch", 0, "BOOL")];
|
||||
|
||||
var canvas_MCDU_base = {
|
||||
init: func(canvas_group, file) {
|
||||
|
@ -183,7 +170,7 @@ var canvas_MCDU_base = {
|
|||
"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","FPLN","FPLN_From","FPLN_Callsign","FPLN_L1","FPLN_L2","FPLN_L3","FPLN_L4","FPLN_L5","FPLN_L6","FPLN_L1S","FPLN_L2S","FPLN_L3S","FPLN_L4S","FPLN_L5S","FPLN_L6S"];
|
||||
"PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","FPLN","FPLN_From","FPLN_TMPY_group","FPLN_Callsign","FPLN_L1","FPLN_L2","FPLN_L3","FPLN_L4","FPLN_L5","FPLN_L6","FPLN_L1S","FPLN_L2S","FPLN_L3S","FPLN_L4S","FPLN_L5S","FPLN_L6S","FPLN_6_group"];
|
||||
},
|
||||
update: func() {
|
||||
if (ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) {
|
||||
|
@ -212,116 +199,157 @@ var canvas_MCDU_base = {
|
|||
me["Simple_PageNum"].hide();
|
||||
me["ArrowLeft"].show();
|
||||
me["ArrowRight"].show();
|
||||
|
||||
|
||||
pageSwitch[i].setBoolValue(1);
|
||||
}
|
||||
|
||||
|
||||
if (flightNumSet.getValue()) {
|
||||
me["FPLN_Callsign"].setText(flightNum.getValue());
|
||||
me["FPLN_Callsign"].show();
|
||||
} else {
|
||||
me["FPLN_Callsign"].hide();
|
||||
}
|
||||
|
||||
fplnl1 = fplnL1[i].getValue();
|
||||
if (fplnl1 != "") {
|
||||
me["FPLN_L1"].setText(fplnl1);
|
||||
me["FPLN_L1"].show();
|
||||
|
||||
fplnLineSize = size(mcdu.FPLNLines[i].output);
|
||||
|
||||
if (fplnLineSize >= 1) {
|
||||
fplnl1 = mcdu.FPLNLines[i].output[0].getText();
|
||||
if (fplnl1 != "") {
|
||||
me["FPLN_L1"].setColor(mcdu.FPLNLines[i].output[0].getColor(i));
|
||||
me["FPLN_L1"].setText(fplnl1);
|
||||
me["FPLN_L1"].show();
|
||||
} else {
|
||||
me["FPLN_L1"].hide();
|
||||
}
|
||||
fplnl1s = mcdu.FPLNLines[i].output[0].getSubText(i);
|
||||
if (fplnl1s != "") {
|
||||
me["FPLN_L1S"].setText(fplnl1s);
|
||||
me["FPLN_L1S"].show();
|
||||
} else {
|
||||
me["FPLN_L1S"].hide();
|
||||
}
|
||||
} else {
|
||||
me["FPLN_L1"].hide();
|
||||
}
|
||||
|
||||
fplnl2 = fplnL2[i].getValue();
|
||||
if (fplnl2 != "") {
|
||||
me["FPLN_L2"].setText(fplnl2);
|
||||
me["FPLN_L2"].show();
|
||||
} else {
|
||||
me["FPLN_L2"].hide();
|
||||
}
|
||||
|
||||
fplnl3 = fplnL3[i].getValue();
|
||||
if (fplnl3 != "") {
|
||||
me["FPLN_L3"].setText(fplnl3);
|
||||
me["FPLN_L3"].show();
|
||||
} else {
|
||||
me["FPLN_L3"].hide();
|
||||
}
|
||||
|
||||
fplnl4 = fplnL4[i].getValue();
|
||||
if (fplnl4 != "") {
|
||||
me["FPLN_L4"].setText(fplnl4);
|
||||
me["FPLN_L4"].show();
|
||||
} else {
|
||||
me["FPLN_L4"].hide();
|
||||
}
|
||||
|
||||
fplnl5 = fplnL5[i].getValue();
|
||||
if (fplnl5 != "") {
|
||||
me["FPLN_L5"].setText(fplnl5);
|
||||
me["FPLN_L5"].show();
|
||||
} else {
|
||||
me["FPLN_L5"].hide();
|
||||
}
|
||||
|
||||
fplnl6 = fplnL6[i].getValue();
|
||||
if (fplnl6 != "") {
|
||||
me["FPLN_L6"].setText(fplnl6);
|
||||
me["FPLN_L6"].show();
|
||||
} else {
|
||||
me["FPLN_L6"].hide();
|
||||
}
|
||||
|
||||
fplnl1s = fplnL1s[i].getValue();
|
||||
if (fplnl1s != "") {
|
||||
me["FPLN_L1S"].setText(fplnl1s);
|
||||
me["FPLN_L1S"].show();
|
||||
} else {
|
||||
me["FPLN_L1S"].hide();
|
||||
}
|
||||
|
||||
fplnl2s = fplnL2s[i].getValue();
|
||||
if (fplnl2s != "") {
|
||||
me["FPLN_L2S"].setText(fplnl2s);
|
||||
me["FPLN_L2S"].show();
|
||||
|
||||
if (fplnLineSize >= 2) {
|
||||
fplnl2 = mcdu.FPLNLines[i].output[1].getText();
|
||||
if (fplnl2 != "") {
|
||||
me["FPLN_L2"].setColor(mcdu.FPLNLines[i].output[1].getColor(i));
|
||||
me["FPLN_L2"].setText(fplnl2);
|
||||
me["FPLN_L2"].show();
|
||||
} else {
|
||||
me["FPLN_L2"].hide();
|
||||
}
|
||||
fplnl2s = mcdu.FPLNLines[i].output[1].getSubText(i);
|
||||
if (fplnl2s != "") {
|
||||
me["FPLN_L2S"].setText(fplnl2s);
|
||||
me["FPLN_L2S"].show();
|
||||
} else {
|
||||
me["FPLN_L2S"].hide();
|
||||
}
|
||||
} else {
|
||||
me["FPLN_L2"].hide();
|
||||
me["FPLN_L2S"].hide();
|
||||
}
|
||||
|
||||
fplnl3s = fplnL3s[i].getValue();
|
||||
if (fplnl3s != "") {
|
||||
me["FPLN_L3S"].setText(fplnl3s);
|
||||
me["FPLN_L3S"].show();
|
||||
|
||||
if (fplnLineSize >= 3) {
|
||||
fplnl3 = mcdu.FPLNLines[i].output[2].getText();
|
||||
if (fplnl3 != "") {
|
||||
me["FPLN_L3"].setColor(mcdu.FPLNLines[i].output[2].getColor(i));
|
||||
me["FPLN_L3"].setText(fplnl3);
|
||||
me["FPLN_L3"].show();
|
||||
} else {
|
||||
me["FPLN_L3"].hide();
|
||||
}
|
||||
fplnl3s = mcdu.FPLNLines[i].output[2].getSubText(i);
|
||||
if (fplnl3s != "") {
|
||||
me["FPLN_L3S"].setText(fplnl3s);
|
||||
me["FPLN_L3S"].show();
|
||||
} else {
|
||||
me["FPLN_L3S"].hide();
|
||||
}
|
||||
} else {
|
||||
me["FPLN_L3"].hide();
|
||||
me["FPLN_L3S"].hide();
|
||||
}
|
||||
|
||||
fplnl4s = fplnL4s[i].getValue();
|
||||
if (fplnl4s != "") {
|
||||
me["FPLN_L4S"].setText(fplnl4s);
|
||||
me["FPLN_L4S"].show();
|
||||
|
||||
if (fplnLineSize >= 4) {
|
||||
fplnl4 = mcdu.FPLNLines[i].output[3].getText();
|
||||
if (fplnl4 != "") {
|
||||
me["FPLN_L4"].setColor(mcdu.FPLNLines[i].output[3].getColor(i));
|
||||
me["FPLN_L4"].setText(fplnl4);
|
||||
me["FPLN_L4"].show();
|
||||
} else {
|
||||
me["FPLN_L4"].hide();
|
||||
}
|
||||
fplnl4s = mcdu.FPLNLines[i].output[3].getSubText(i);
|
||||
if (fplnl4s != "") {
|
||||
me["FPLN_L4S"].setText(fplnl4s);
|
||||
me["FPLN_L4S"].show();
|
||||
} else {
|
||||
me["FPLN_L4S"].hide();
|
||||
}
|
||||
} else {
|
||||
me["FPLN_L4"].hide();
|
||||
me["FPLN_L4S"].hide();
|
||||
}
|
||||
|
||||
fplnl5s = fplnL5s[i].getValue();
|
||||
if (fplnl5s != "") {
|
||||
me["FPLN_L5S"].setText(fplnl5s);
|
||||
me["FPLN_L5S"].show();
|
||||
|
||||
if (fplnLineSize >= 5) {
|
||||
fplnl5 = mcdu.FPLNLines[i].output[4].getText();
|
||||
if (fplnl5 != "") {
|
||||
me["FPLN_L5"].setColor(mcdu.FPLNLines[i].output[4].getColor(i));
|
||||
me["FPLN_L5"].setText(fplnl5);
|
||||
me["FPLN_L5"].show();
|
||||
} else {
|
||||
me["FPLN_L5"].hide();
|
||||
}
|
||||
fplnl5s = mcdu.FPLNLines[i].output[4].getSubText(i);
|
||||
if (fplnl5s != "") {
|
||||
me["FPLN_L5S"].setText(fplnl5s);
|
||||
me["FPLN_L5S"].show();
|
||||
} else {
|
||||
me["FPLN_L5S"].hide();
|
||||
}
|
||||
} else {
|
||||
me["FPLN_L5"].hide();
|
||||
me["FPLN_L5S"].hide();
|
||||
}
|
||||
|
||||
fplnl6s = fplnL6s[i].getValue();
|
||||
if (fplnl6s != "") {
|
||||
me["FPLN_L6S"].setText(fplnl6s);
|
||||
me["FPLN_L6S"].show();
|
||||
|
||||
if (fplnLineSize >= 6) {
|
||||
fplnl6 = mcdu.FPLNLines[i].output[5].getText();
|
||||
if (fplnl6 != "") {
|
||||
me["FPLN_L6"].setColor(mcdu.FPLNLines[i].output[5].getColor(i));
|
||||
me["FPLN_L6"].setText(fplnl6);
|
||||
me["FPLN_L6"].show();
|
||||
} else {
|
||||
me["FPLN_L6"].hide();
|
||||
}
|
||||
fplnl6s = mcdu.FPLNLines[i].output[5].getSubText(i);
|
||||
if (fplnl6s != "") {
|
||||
me["FPLN_L6S"].setText(fplnl6s);
|
||||
me["FPLN_L6S"].show();
|
||||
} else {
|
||||
me["FPLN_L6S"].hide();
|
||||
}
|
||||
} else {
|
||||
me["FPLN_L6"].hide();
|
||||
me["FPLN_L6S"].hide();
|
||||
}
|
||||
|
||||
if (fplnCSwitch[i].getBoolValue() != 1) {
|
||||
me.FPLNcolor(fpln1c[i].getValue(), fpln2c[i].getValue(), fpln3c[i].getValue(), fpln4c[i].getValue(), fpln5c[i].getValue(), fpln6c[i].getValue());
|
||||
fplnCSwitch[i].setBoolValue(1);
|
||||
|
||||
if (mcdu.FPLNLines[i].index == 0) {
|
||||
me["FPLN_From"].show();
|
||||
} else {
|
||||
me["FPLN_From"].hide();
|
||||
}
|
||||
|
||||
if (TMPYActive[i].getBoolValue()) {
|
||||
me["FPLN_TMPY_group"].show();
|
||||
me["FPLN_6_group"].hide();
|
||||
} else {
|
||||
me["FPLN_TMPY_group"].hide();
|
||||
me["FPLN_6_group"].show();
|
||||
}
|
||||
} else if (page == "MCDU") {
|
||||
if (!pageSwitch[i].getBoolValue()) {
|
||||
|
@ -1741,20 +1769,6 @@ var canvas_MCDU_base = {
|
|||
me["Simple_C6S"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
FPLNcolor: func(a, b, c, d, e, f) {
|
||||
me["FPLN_L1"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["FPLN_L1S"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["FPLN_L2"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["FPLN_L2S"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["FPLN_L3"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["FPLN_L3S"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["FPLN_L4"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["FPLN_L4S"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["FPLN_L5"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["FPLN_L5S"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["FPLN_L6"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["FPLN_L6S"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
},
|
||||
# 0 = ignore
|
||||
fontLeft: func (a, b, c, d, e, f) {
|
||||
if (a != 0) {
|
||||
|
@ -1960,82 +1974,8 @@ var showMCDU2 = func {
|
|||
|
||||
setlistener("/MCDU[0]/page", func {
|
||||
pageSwitch[0].setBoolValue(0);
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/page", func {
|
||||
pageSwitch[1].setBoolValue(0);
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[0]/F-PLN/line-1c", func {
|
||||
if (pageProp[0].getValue() == "F-PLNA" or pageProp[0].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[0]/F-PLN/line-2c", func {
|
||||
if (pageProp[0].getValue() == "F-PLNA" or pageProp[0].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[0]/F-PLN/line-3c", func {
|
||||
if (pageProp[0].getValue() == "F-PLNA" or pageProp[0].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[0]/F-PLN/line-4c", func {
|
||||
if (pageProp[0].getValue() == "F-PLNA" or pageProp[0].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[0]/F-PLN/line-5c", func {
|
||||
if (pageProp[0].getValue() == "F-PLNA" or pageProp[0].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[0]/F-PLN/line-6c", func {
|
||||
if (pageProp[0].getValue() == "F-PLNA" or pageProp[0].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[0].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/F-PLN/line-1c", func {
|
||||
if (pageProp[1].getValue() == "F-PLNA" or pageProp[1].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/F-PLN/line-2c", func {
|
||||
if (pageProp[1].getValue() == "F-PLNA" or pageProp[1].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/F-PLN/line-3c", func {
|
||||
if (pageProp[1].getValue() == "F-PLNA" or pageProp[1].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/F-PLN/line-4c", func {
|
||||
if (pageProp[1].getValue() == "F-PLNA" or pageProp[1].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/F-PLN/line-5c", func {
|
||||
if (pageProp[1].getValue() == "F-PLNA" or pageProp[1].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/F-PLN/line-6c", func {
|
||||
if (pageProp[1].getValue() == "F-PLNA" or pageProp[1].getValue() == "F-PLNB") {
|
||||
fplnCSwitch[1].setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
|
|
@ -23,14 +23,14 @@
|
|||
guidetolerance="20"
|
||||
inkscape:pageopacity="1"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1027"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="847"
|
||||
id="namedview371"
|
||||
showgrid="true"
|
||||
inkscape:zoom="0.70710678"
|
||||
inkscape:cx="649.67612"
|
||||
inkscape:cy="554.49798"
|
||||
inkscape:window-x="1592"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="131.34947"
|
||||
inkscape:cy="381.42045"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2"
|
||||
|
@ -49,7 +49,7 @@
|
|||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
|
@ -750,16 +750,16 @@
|
|||
</g>
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
transform="scale(0.99151709,1.0085555)"
|
||||
sodipodi:linespacing="125%"
|
||||
id="Simple_R5"
|
||||
y="656.51971"
|
||||
x="1022.194"
|
||||
y="656.52045"
|
||||
x="1022.1934"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;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;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1"
|
||||
y="656.51971"
|
||||
x="1022.194"
|
||||
y="656.52045"
|
||||
x="1022.1934"
|
||||
id="tspan4313"
|
||||
sodipodi:role="line">TEXT</tspan></text>
|
||||
<g
|
||||
|
@ -783,16 +783,16 @@
|
|||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="1022.194"
|
||||
y="773.87396"
|
||||
x="1022.1934"
|
||||
y="773.87482"
|
||||
id="Simple_R6"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
transform="scale(0.99151709,1.0085555)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4323"
|
||||
x="1022.194"
|
||||
y="773.87396"
|
||||
x="1022.1934"
|
||||
y="773.87482"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1">TEXT</tspan></text>
|
||||
<g
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
|
@ -1735,20 +1735,6 @@
|
|||
x="20.138426"
|
||||
id="tspan4432"
|
||||
sodipodi:role="line">TEXT</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="20.138426"
|
||||
y="773.87396"
|
||||
id="FPLN_L6"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4436"
|
||||
x="20.138426"
|
||||
y="773.87396"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">TEXT</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
|
@ -1819,19 +1805,172 @@
|
|||
x="63.546234"
|
||||
y="599.80499"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">TEXT</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
sodipodi:linespacing="125%"
|
||||
id="FPLN_L6S"
|
||||
y="717.159"
|
||||
x="63.546234"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;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:56px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||
y="717.159"
|
||||
<g
|
||||
id="FPLN_6_group"
|
||||
inkscape:label="#g3626">
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
sodipodi:linespacing="125%"
|
||||
id="FPLN_L6"
|
||||
y="773.87396"
|
||||
x="20.138426"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;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;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||
y="773.87396"
|
||||
x="20.138426"
|
||||
id="tspan4436"
|
||||
sodipodi:role="line">TEXT</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="63.546234"
|
||||
id="tspan5000"
|
||||
sodipodi:role="line">TEXT</tspan></text>
|
||||
y="717.159"
|
||||
id="FPLN_L6S"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5000"
|
||||
x="63.546234"
|
||||
y="717.159"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">TEXT</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="FPLN_TMPY_group"
|
||||
inkscape:label="#g3767">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
|
||||
x="350.9628"
|
||||
y="69.238258"
|
||||
id="FPLN_TMPY"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3617"
|
||||
x="350.9628"
|
||||
y="69.238258"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffff00;fill-opacity:1;">TMPY</tspan></text>
|
||||
<g
|
||||
inkscape:label="#g3715"
|
||||
id="FPLN_TMPY_ERASE">
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
sodipodi:linespacing="125%"
|
||||
id="text3623"
|
||||
y="773.87396"
|
||||
x="63.16515"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;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;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1"
|
||||
y="773.87396"
|
||||
x="63.16515"
|
||||
id="tspan3625"
|
||||
sodipodi:role="line">ERASE</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;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="70.001091"
|
||||
y="717.159"
|
||||
id="text3627"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3629"
|
||||
x="70.001091"
|
||||
y="717.159"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1">TMPY</tspan></text>
|
||||
<g
|
||||
style="stroke:#bb6100;stroke-opacity:1"
|
||||
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,710.38932)"
|
||||
inkscape:label="#g4241"
|
||||
id="g4241">
|
||||
<path
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 952.4036,47.432743 -28.52965,0"
|
||||
id="path4480-4"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4482-0"
|
||||
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||
id="path4484-0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:label="#g3746"
|
||||
id="FPLN_TMPY_INSERT">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;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="970.52771"
|
||||
y="717.15857"
|
||||
id="text3729"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.9915153,1.0085573)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3731"
|
||||
x="970.52771"
|
||||
y="717.15857"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1">TMPY</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.99151523,1.0085574)"
|
||||
sodipodi:linespacing="125%"
|
||||
id="text3725"
|
||||
y="773.87335"
|
||||
x="972.33221"
|
||||
style="font-style:normal;font-weight:normal;font-size:71.89044189px;line-height:125%;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;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1"
|
||||
y="773.87335"
|
||||
x="972.33221"
|
||||
id="tspan3727"
|
||||
sodipodi:role="line">INSERT</tspan></text>
|
||||
<g
|
||||
transform="matrix(1.0807108,0,0,1.0807111,-76.371959,450.13459)"
|
||||
inkscape:label="#g4324"
|
||||
id="g4324">
|
||||
<path
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 998.71909,284.70793 -28.52965,0"
|
||||
id="path4490-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4318-2"
|
||||
d="m 994.54102,294.79468 -20.17351,-20.1735"
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 984.45427,298.97275 -10e-6,-28.52964"
|
||||
id="path4320-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4322-2"
|
||||
d="m 974.36752,294.79468 20.17349,-20.1735"
|
||||
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before (image error) Size: 99 KiB After (image error) Size: 106 KiB |
|
@ -16,7 +16,7 @@ var A3XXRouteDriver = {
|
|||
me.update();
|
||||
},
|
||||
update: func(){
|
||||
me.flightplan = fmgc.fp[1];
|
||||
me.flightplan = fmgc.fp[2];
|
||||
},
|
||||
getNumberOfFlightPlans: func(){1},
|
||||
getFlightPlanType: func(fpNum){"current"},
|
||||
|
|
|
@ -233,7 +233,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
|
|||
#print("navdisplay.mfd:ND layer setup completed");
|
||||
|
||||
# TODO: move this to RTE.lcontroller ?
|
||||
me.listen("/FMGC/flightplan[1]/current-wp", func(activeWp) {
|
||||
me.listen("/FMGC/flightplan[2]/current-wp", func(activeWp) {
|
||||
canvas.updatewp( activeWp.getValue() );
|
||||
});
|
||||
|
||||
|
@ -304,12 +304,12 @@ canvas.NavDisplay.update_sub = func(){
|
|||
pos.lat = wp.wp_lat;
|
||||
pos.lon = wp.wp_lon;
|
||||
} else {
|
||||
pos.lat = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
pos.lat = getprop("/FMGC/flightplan[2]/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan[2]/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
}
|
||||
} else {
|
||||
pos.lat = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
pos.lat = getprop("/FMGC/flightplan[2]/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan[2]/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
}
|
||||
} else {
|
||||
pos.lat = userLat;
|
||||
|
|
|
@ -12,9 +12,9 @@ SymbolLayer.add(name, {
|
|||
type: name, # Symbol type
|
||||
df_controller: __self__, # controller to use by default -- this one
|
||||
df_options: { # default configuration options
|
||||
active_node: "/FMGC/flightplan[1]/active",
|
||||
current_wp_node: "/FMGC/flightplan[1]/current-wp",
|
||||
wp_num: "/FMGC/flightplan[1]/num",
|
||||
active_node: "/FMGC/flightplan[2]/active",
|
||||
current_wp_node: "/FMGC/flightplan[2]/current-wp",
|
||||
wp_num: "/FMGC/flightplan[2]/num",
|
||||
display_inactive_rte: 0
|
||||
}
|
||||
});
|
||||
|
|
|
@ -46,12 +46,12 @@ canvas.NDStyles["Airbus"] = {
|
|||
# that the lateral flight mode is managed.
|
||||
# You can easily override these options before creating the ND, example:
|
||||
# canvas.NDStyles["Airbus"].options.defaults.fplan_active = "my/autpilot/f-plan/active"
|
||||
fplan_active: "/FMGC/flightplan[1]/active",
|
||||
fplan_active: "/FMGC/flightplan[2]/active",
|
||||
lat_ctrl: "/it-autoflight/output/lat",
|
||||
managed_val: 1,
|
||||
ver_ctrl: "/it-autoflight/output/vert",
|
||||
spd_ctrl: "/flight-management/control/spd-ctrl",
|
||||
current_wp: "/FMGC/flightplan[1]/current-wp",
|
||||
current_wp: "/FMGC/flightplan[2]/current-wp",
|
||||
ap1: "/it-autoflight/output/ap1",
|
||||
ap2: "/it-autoflight/output/ap2",
|
||||
nav1_frq: "/instrumentation/nav[0]/frequencies/selected-mhz",
|
||||
|
@ -740,11 +740,11 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveId",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg") != nil and
|
||||
getprop("FMGC/flightplan[1]/active") and
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
|
||||
getprop("FMGC/flightplan[2]/active") and
|
||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[1]/current-leg"));
|
||||
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[2]/current-leg"));
|
||||
nd.symbols.wpActiveId.show();
|
||||
},
|
||||
is_false: func(nd) nd.symbols.wpActiveId.hide(),
|
||||
|
@ -754,15 +754,15 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveCrs",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg") != nil and
|
||||
getprop("FMGC/flightplan[1]/active") and
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
|
||||
getprop("FMGC/flightplan[2]/active") and
|
||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
#var cur_wp = getprop("autopilot/route-manager/current-wp");
|
||||
if (nd.get_switch("toggle_true_north")) {
|
||||
var deg = math.round(getprop("/FMGC/flightplan[1]/current-leg-course"));
|
||||
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course"));
|
||||
} else {
|
||||
var deg = math.round(getprop("/FMGC/flightplan[1]/current-leg-course-mag"));
|
||||
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course-mag"));
|
||||
}
|
||||
nd.symbols.wpActiveCrs.setText((deg or "")~"°");
|
||||
nd.symbols.wpActiveCrs.show();
|
||||
|
@ -774,11 +774,11 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveDist",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg-dist") != nil and
|
||||
getprop("FMGC/flightplan[1]/active") and
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and
|
||||
getprop("FMGC/flightplan[2]/active") and
|
||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
var dst = getprop("/FMGC/flightplan[1]/current-leg-dist");
|
||||
var dst = getprop("/FMGC/flightplan[2]/current-leg-dist");
|
||||
nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst));
|
||||
nd.symbols.wpActiveDist.show();
|
||||
},
|
||||
|
@ -789,10 +789,10 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveDistLbl",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg-dist") != nil and getprop("FMGC/flightplan[1]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and getprop("FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
nd.symbols.wpActiveDistLbl.show();
|
||||
if(getprop("/FMGC/flightplan[1]/current-leg-dist") > 1000)
|
||||
if(getprop("/FMGC/flightplan[2]/current-leg-dist") > 1000)
|
||||
nd.symbols.wpActiveDistLbl.setText(" NM");
|
||||
},
|
||||
is_false: func(nd) nd.symbols.wpActiveDistLbl.hide(),
|
||||
|
@ -802,7 +802,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "eta",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("FMGC/flightplan[1]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
var etaSec = getprop("/sim/time/utc/day-seconds")+
|
||||
getprop("autopilot/route-manager/wp/eta-seconds");
|
||||
|
@ -1683,7 +1683,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var active = getprop("FMGC/flightplan[2]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1712,7 +1712,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var active = getprop("FMGC/flightplan[2]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1741,7 +1741,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var active = getprop("FMGC/flightplan[2]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1770,7 +1770,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var active = getprop("FMGC/flightplan[2]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1799,7 +1799,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["MAP", "PLAN"])),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var active = getprop("FMGC/flightplan[2]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
|
|
@ -338,7 +338,7 @@ var lateral = func {
|
|||
setprop("/it-autoflight/mode/lat", "HDG");
|
||||
setprop("/it-autoflight/mode/arm", " ");
|
||||
} else if (latset == 1) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
make_lnav_active();
|
||||
} else {
|
||||
if (getprop("/it-autoflight/output/lat") != 1) {
|
||||
|
@ -396,7 +396,7 @@ var lat_arm = func {
|
|||
setprop("/it-autoflight/mode/arm", " ");
|
||||
setprop("/it-autoflight/custom/show-hdg", 1);
|
||||
} else if (latset == 1) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1) {
|
||||
setprop("/it-autoflight/input/lat-arm", 1);
|
||||
setprop("/it-autoflight/mode/arm", "LNV");
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ var vertical = func {
|
|||
setprop("/it-autoflight/internal/alt", altinput);
|
||||
thrustmodet.start();
|
||||
} else if (vertset == 8) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/it-autoflight/internal/alt-const") >= 100) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and getprop("/it-autoflight/internal/alt-const") >= 100) {
|
||||
alandt.stop();
|
||||
alandt1.stop();
|
||||
setprop("/it-autoflight/output/appr-armed", 0);
|
||||
|
@ -668,19 +668,19 @@ var ap_various = func {
|
|||
setprop("/it-autoflight/internal/bank-limit", 25);
|
||||
}
|
||||
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
if ((getprop("/FMGC/flightplan[1]/current-wp") + 1) < getprop("/FMGC/flightplan[1]/num")) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1) {
|
||||
if ((getprop("/FMGC/flightplan[2]/current-wp") + 1) < getprop("/FMGC/flightplan[2]/num")) {
|
||||
gnds_mps = getprop("/velocities/groundspeed-kt") * 0.5144444444444;
|
||||
wp_fly_from = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
wp_fly_from = getprop("/FMGC/flightplan[2]/current-wp");
|
||||
if (wp_fly_from < 0) {
|
||||
wp_fly_from = 0;
|
||||
}
|
||||
current_course = getprop("/FMGC/flightplan[1]/wp[" ~ wp_fly_from ~ "]/course");
|
||||
wp_fly_to = getprop("/FMGC/flightplan[1]/current-wp") + 1;
|
||||
current_course = getprop("/FMGC/flightplan[2]/wp[" ~ wp_fly_from ~ "]/course");
|
||||
wp_fly_to = getprop("/FMGC/flightplan[2]/current-wp") + 1;
|
||||
if (wp_fly_to < 0) {
|
||||
wp_fly_to = 0;
|
||||
}
|
||||
next_course = getprop("/FMGC/flightplan[1]/wp[" ~ wp_fly_to ~ "]/course");
|
||||
next_course = getprop("/FMGC/flightplan[2]/wp[" ~ wp_fly_to ~ "]/course");
|
||||
max_bank_limit = getprop("/it-autoflight/internal/bank-limit");
|
||||
|
||||
delta_angle = math.abs(geo.normdeg180(current_course - next_course));
|
||||
|
@ -702,8 +702,12 @@ var ap_various = func {
|
|||
}
|
||||
setprop("/it-autoflight/internal/lnav-advance-nm", turn_dist);
|
||||
|
||||
if (getprop("/FMGC/flightplan[1]/current-leg-dist") <= turn_dist) {
|
||||
r1_currentWP = r1_currentWP + 1;
|
||||
if (getprop("/FMGC/flightplan[2]/current-leg-dist") <= turn_dist) {
|
||||
if (currentWP[2] < 1) {
|
||||
currentWP[2] = 1;
|
||||
} else if (num_out[2].getValue() > 2) { # The Airbus doesn't display anything past the previous waypoint after advancing
|
||||
flightplan.advanceDelete(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -920,7 +924,7 @@ var check_arms = func {
|
|||
}
|
||||
|
||||
var update_arms = func {
|
||||
if (getprop("/it-autoflight/input/lat-arm") == 1 and getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
if (getprop("/it-autoflight/input/lat-arm") == 1 and getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
make_lnav_active();
|
||||
}
|
||||
if (getprop("/instrumentation/nav[0]/in-range") == 1) {
|
||||
|
@ -1020,10 +1024,10 @@ var aland1 = func {
|
|||
|
||||
# Managed Climb/Descent
|
||||
var mng_main = func {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1) {
|
||||
altinput = getprop("/it-autoflight/input/alt");
|
||||
setprop("/it-autoflight/internal/alt", altinput);
|
||||
var wp_curr = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
var wp_curr = getprop("/FMGC/flightplan[2]/current-wp");
|
||||
var mng_alt_wp = getprop("/autopilot/route-manager/route/wp", wp_curr, "altitude-ft");
|
||||
if (getprop("/it-autoflight/internal/alt-const") == mng_alt_wp) {
|
||||
# Do nothing
|
||||
|
@ -1062,7 +1066,7 @@ setlistener("/it-autoflight/internal/alt-const", func {
|
|||
}
|
||||
});
|
||||
|
||||
setlistener("/FMGC/flightplan[1]/current-wp", func {
|
||||
setlistener("/FMGC/flightplan[2]/current-wp", func {
|
||||
if (getprop("/it-autoflight/output/vert") == 8) {
|
||||
mng_alt_selector();
|
||||
mng_run();
|
||||
|
@ -1070,11 +1074,11 @@ setlistener("/FMGC/flightplan[1]/current-wp", func {
|
|||
});
|
||||
|
||||
var mng_run = func {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
var wptnum = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan[2]/current-wp");
|
||||
var wptnum = getprop("/FMGC/flightplan[2]/current-wp");
|
||||
var mng_alt_wp = getprop("/autopilot/route-manager/route/wp",wp_curr,"altitude-ft");
|
||||
if ((wptnum - 1) < getprop("/FMGC/flightplan[1]/num")) {
|
||||
if ((wptnum - 1) < getprop("/FMGC/flightplan[2]/num")) {
|
||||
var mng_alt_wp_prev = getprop("/autopilot/route-manager/route/wp",wp_curr - 1,"altitude-ft");
|
||||
var altcurr = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
if (mng_alt_wp_prev >= 100) {
|
||||
|
@ -1140,11 +1144,11 @@ var mng_run = func {
|
|||
|
||||
# Managed Top of Descent
|
||||
var mng_des_tod = func {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan[2]/current-wp");
|
||||
var mng_alt_wp = getprop("/autopilot/route-manager/route/wp",wp_curr,"altitude-ft");
|
||||
var alt_curr = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
var dist = getprop("/FMGC/flightplan[1]/current-leg-dist");
|
||||
var dist = getprop("/FMGC/flightplan[2]/current-leg-dist");
|
||||
var vdist = dist + 1;
|
||||
var alttl = abs(alt_curr - mng_alt_wp);
|
||||
setprop("/it-autoflight/internal/top-of-des-nm", (alttl / 1000) * 3);
|
||||
|
@ -1186,7 +1190,7 @@ var mng_alt_selector = func {
|
|||
setprop("/it-autoflight/internal/mng-alt", getprop("/it-autoflight/internal/alt-const"));
|
||||
}
|
||||
} else if (getprop("/it-autoflight/internal/mng-mode") == "DES") {
|
||||
var dist = getprop("/FMGC/flightplan[1]/current-leg-dist");
|
||||
var dist = getprop("/FMGC/flightplan[2]/current-leg-dist");
|
||||
var vdist = dist - 1;
|
||||
if (vdist < getprop("/it-autoflight/internal/top-of-des-nm")) {
|
||||
if (sdif <= vdif) {
|
||||
|
@ -1237,7 +1241,7 @@ var mng_des_pth = func {
|
|||
mng_altcaptt.start();
|
||||
}
|
||||
var mng_des_fpm = func {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1) {
|
||||
var gndspd = getprop("/velocities/groundspeed-kt");
|
||||
var desfpm = ((gndspd * 0.5) * 10);
|
||||
setprop("/it-autoflight/internal/mng-fpm", desfpm);
|
||||
|
|
|
@ -230,7 +230,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
setprop("/FMGC/status/phase", "5");
|
||||
}
|
||||
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/FMGC/flightplan[1]/arrival-leg-dist") <= 15) {
|
||||
if (getprop("/FMGC/flightplan[2]/num") > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and getprop("/FMGC/flightplan[2]/arrival-leg-dist") <= 15) {
|
||||
setprop("/FMGC/internal/decel", 1);
|
||||
} else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) {
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
|
|
|
@ -1,74 +1,514 @@
|
|||
# A3XX mCDU by Joshua Davidson (it0uchpods) and Jonathan Redpath
|
||||
# Airbus A3XX FMGC MCDU Bridge
|
||||
|
||||
# Copyright (c) 2019 Joshua Davidson (it0uchpods)
|
||||
# Copyright (c) 2019 Joshua Davidson (it0uchpods) and Nikolai V. Chr. (Necolatis)
|
||||
|
||||
# wht = white, grn = green, blu = blue, amb = amber, yel = yellow
|
||||
setprop("/MCDU[0]/F-PLN/left-1", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-1s", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-2", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-2s", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-3", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-3s", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-4", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-4s", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-5", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-5s", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-6", "");
|
||||
setprop("/MCDU[0]/F-PLN/left-6s", "");
|
||||
setprop("/MCDU[0]/F-PLN/line-1c", "wht");
|
||||
setprop("/MCDU[0]/F-PLN/line-2c", "wht");
|
||||
setprop("/MCDU[0]/F-PLN/line-3c", "wht");
|
||||
setprop("/MCDU[0]/F-PLN/line-4c", "wht");
|
||||
setprop("/MCDU[0]/F-PLN/line-5c", "wht");
|
||||
setprop("/MCDU[0]/F-PLN/line-6c", "wht");
|
||||
# Lowercase "g" is a degree symbol in the MCDU font.
|
||||
|
||||
setprop("/MCDU[1]/F-PLN/left-1", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-1s", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-2", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-2s", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-3", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-3s", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-4", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-4s", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-5", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-5s", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-6", "");
|
||||
setprop("/MCDU[1]/F-PLN/left-6s", "");
|
||||
setprop("/MCDU[1]/F-PLN/line-1c", "wht");
|
||||
setprop("/MCDU[1]/F-PLN/line-2c", "wht");
|
||||
setprop("/MCDU[1]/F-PLN/line-3c", "wht");
|
||||
setprop("/MCDU[1]/F-PLN/line-4c", "wht");
|
||||
setprop("/MCDU[1]/F-PLN/line-5c", "wht");
|
||||
setprop("/MCDU[1]/F-PLN/line-6c", "wht");
|
||||
var TMPY = 5;
|
||||
var MAIN = 6;
|
||||
var debug = 0; # Set to 1 to check inner functionality
|
||||
var insertReturn = nil;
|
||||
var active_out = [nil, nil, props.globals.getNode("/FMGC/flightplan[2]/active")];
|
||||
var num_out = [props.globals.getNode("/FMGC/flightplan[0]/num"), props.globals.getNode("/FMGC/flightplan[1]/num"), props.globals.getNode("/FMGC/flightplan[2]/num")];
|
||||
var TMPYActive = [props.globals.getNode("/FMGC/internal/tmpy-active[0]"), props.globals.getNode("/FMGC/internal/tmpy-active[1]")];
|
||||
|
||||
var discontinuity = "---F-PLN DISCONTINUITY--";
|
||||
var fpln_end = "------END OF F-PLN------";
|
||||
var altn_fpln_end = "----END OF ALTN F-PLN---";
|
||||
var no_altn_fpln_end = "------NO ALTN F-PLN-----";
|
||||
var clearFPLNComputer = func {
|
||||
FPLNLines[0].clear();
|
||||
FPLNLines[1].clear();
|
||||
}
|
||||
|
||||
var r1_active_out = props.globals.getNode("/FMGC/flightplan[1]/active");
|
||||
var StaticText = {
|
||||
new: func(computer, type) {
|
||||
var in = {parents:[StaticText]};
|
||||
in.type = type;
|
||||
in.computer = computer;
|
||||
return in;
|
||||
},
|
||||
getText: func() {
|
||||
if (me.type == "discontinuity") {
|
||||
return "---F-PLN DISCONTINUITY--";
|
||||
} else if (me.type == "fplnEnd") {
|
||||
return "------END OF F-PLN------";
|
||||
} else if (me.type == "altnFplnEnd") {
|
||||
return "----END OF ALTN F-PLN---";
|
||||
} else if (me.type == "noAltnFpln") {
|
||||
return "------NO ALTN F-PLN-----";
|
||||
} else if (me.type == "empty") {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
getColor: func() {
|
||||
return canvas_mcdu.WHITE;
|
||||
},
|
||||
getSubText: func() {
|
||||
return "";
|
||||
},
|
||||
type: nil,
|
||||
pushButtonLeft: func() {
|
||||
notAllowed(me.computer.mcdu);
|
||||
},
|
||||
pushButtonRight: func() {
|
||||
notAllowed(me.computer.mcdu);
|
||||
},
|
||||
};
|
||||
|
||||
var updateFPLN = func(i) {
|
||||
if (r1_active_out.getBoolValue()) {
|
||||
var FPLNText = {
|
||||
new: func(computer, wp, dest, fp, wpIndex) {
|
||||
var in = {parents:[FPLNText]};
|
||||
in.wp = wp;
|
||||
in.dest = dest;
|
||||
in.fp = fp;
|
||||
in.index = wpIndex;
|
||||
in.computer = computer;
|
||||
return in;
|
||||
},
|
||||
getText: func() {
|
||||
return me.wp.wp_name;
|
||||
},
|
||||
getColor: func(i) {
|
||||
if (TMPYActive[i].getBoolValue()) {
|
||||
if (me.dest) {
|
||||
return canvas_mcdu.WHITE;
|
||||
} else {
|
||||
return canvas_mcdu.YELLOW;
|
||||
}
|
||||
} else {
|
||||
if (me.dest) {
|
||||
return canvas_mcdu.WHITE;
|
||||
} else {
|
||||
return canvas_mcdu.GREEN;
|
||||
}
|
||||
}
|
||||
},
|
||||
getSubText: func(i) {
|
||||
if (me.index == 0) {
|
||||
return "";
|
||||
} else if (TMPYActive[i].getBoolValue()) {
|
||||
if (fmgc.arrivalAirportI[i] == me.index) {
|
||||
return "DEST";
|
||||
} else {
|
||||
return "C" ~ sprintf("%03d", fmgc.wpCoursePrev[me.fp][me.index].getValue()) ~ "g";
|
||||
}
|
||||
} else {
|
||||
if (fmgc.arrivalAirportI[2] == me.index) {
|
||||
return "DEST";
|
||||
} else {
|
||||
return "C" ~ sprintf("%03d", fmgc.wpCoursePrev[me.fp][me.index].getValue()) ~ "g";
|
||||
}
|
||||
}
|
||||
},
|
||||
wp: nil,
|
||||
pushButtonLeft: func() {
|
||||
if (me.computer.lines == MAIN) {
|
||||
fmgc.flightplan.initTempFP(me.computer.mcdu, 2);
|
||||
}
|
||||
var scratchpad = getprop("/MCDU[" ~ me.computer.mcdu ~ "]/scratchpad");
|
||||
if (scratchpad == "CLR") {
|
||||
if (fmgc.flightplan.deleteWP(me.index, me.computer.mcdu, 0) != 0) {
|
||||
notAllowed(me.computer.mcdu);
|
||||
} else {
|
||||
setprop("/MCDU[" ~ me.computer.mcdu ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ me.computer.mcdu ~ "]/scratchpad", "");
|
||||
}
|
||||
} else {
|
||||
if (size(scratchpad) == 5) {
|
||||
var insertReturn = fmgc.flightplan.insertFix(scratchpad, me.index, me.computer.mcdu);
|
||||
if (insertReturn == 2) {
|
||||
notAllowed(me.computer.mcdu);
|
||||
} else if (insertReturn == 1) {
|
||||
notInDataBase(me.computer.mcdu);
|
||||
} else {
|
||||
setprop("/MCDU[" ~ me.computer.mcdu ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (size(scratchpad) == 4) {
|
||||
var insertReturn = fmgc.flightplan.insertArpt(scratchpad, me.index, me.computer.mcdu);
|
||||
if (insertReturn == 2) {
|
||||
notAllowed(me.computer.mcdu);
|
||||
} else if (insertReturn == 1) {
|
||||
notInDataBase(me.computer.mcdu);
|
||||
} else {
|
||||
setprop("/MCDU[" ~ me.computer.mcdu ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (size(scratchpad) == 3) {
|
||||
var insertReturn = fmgc.flightplan.insertNavaid(scratchpad, me.index, me.computer.mcdu);
|
||||
if (insertReturn == 2) {
|
||||
notAllowed(me.computer.mcdu);
|
||||
} else if (insertReturn == 1) {
|
||||
notInDataBase(me.computer.mcdu);
|
||||
} else {
|
||||
setprop("/MCDU[" ~ me.computer.mcdu ~ "]/scratchpad", "");
|
||||
}
|
||||
} else {
|
||||
formatError(me.computer.mcdu);
|
||||
}
|
||||
}
|
||||
},
|
||||
pushButtonRight: func() {
|
||||
notAllowed(me.computer.mcdu);
|
||||
},
|
||||
};
|
||||
|
||||
var FPLNLineComputer = {
|
||||
new: func(mcdu) {
|
||||
var in = {parents:[FPLNLineComputer]};
|
||||
in.mcdu = mcdu;
|
||||
in.planEnd = StaticText.new(in, "fplnEnd");
|
||||
in.planNoAlt = StaticText.new(in, "noAltnFpln");
|
||||
if (debug == 1) printf("%d: Line computer created.", in.mcdu);
|
||||
return in;
|
||||
},
|
||||
index: 0,
|
||||
planList: [],
|
||||
destination: nil,
|
||||
destIndex: nil,
|
||||
planEnd: nil,
|
||||
planNoAlt: nil,
|
||||
lines: nil,
|
||||
output: [],
|
||||
mcdu: nil,
|
||||
fplnID: nil,
|
||||
enableScroll: 0,
|
||||
clear: func() {
|
||||
me.planList = [];
|
||||
me.destIndex = -1;
|
||||
me.destination = nil;
|
||||
me.index = 0;
|
||||
me.output = [];
|
||||
me.enableScroll = 0;
|
||||
if (me.lines == nil) {
|
||||
me.lines = MAIN;
|
||||
}
|
||||
me.updateScroll();
|
||||
},
|
||||
replacePlan: func(fplnID, lines, firstLineIndex) {
|
||||
# Here you set another plan, do this when changing plan on display or when destination changes
|
||||
if (debug == 1) printf("%d: replacePlan called for %d lines and firstLine %d", me.mcdu, lines, firstLineIndex);
|
||||
var fpln = nil;
|
||||
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-1", discontinuity);
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-1s", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-2", fpln_end);
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-2s", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-3", no_altn_fpln_end);
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-3s", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-4", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-4s", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-5", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-5s", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-6", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/left-6s", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/line-1c", "wht");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/line-2c", "wht");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/line-3c", "wht");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/line-4c", "wht");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/line-5c", "wht");
|
||||
setprop("/MCDU[" ~ i ~ "]/F-PLN/line-6c", "wht");
|
||||
me.planList = [];
|
||||
|
||||
if (!fmgc.active_out[2].getBoolValue()) {
|
||||
me.destIndex = -1;
|
||||
me.destination = nil;
|
||||
} else {
|
||||
fpln = fmgc.fp[fplnID]; # Get the Nasal Flightplan
|
||||
me.destIndex = fmgc.arrivalAirportI[fplnID];
|
||||
me.destination = FPLNText.new(me, fpln.getWP(me.destIndex), 1, fplnID, me.destIndex);
|
||||
for (var j = 0; j < fpln.getPlanSize(); j += 1) {
|
||||
me.dest = 0;
|
||||
if (j == me.destIndex) {
|
||||
me.dest = 1;
|
||||
}
|
||||
append(me.planList, FPLNText.new(me, fpln.getWP(j), me.dest, fplnID, j));
|
||||
}
|
||||
if (debug == 1) printf("%d: dest is: %s", me.mcdu, fpln.getWP(me.destIndex).wp_name);
|
||||
}
|
||||
me.index = firstLineIndex;
|
||||
me.lines = lines;
|
||||
me.initScroll();
|
||||
},
|
||||
initScroll: func() {
|
||||
me.maxItems = size(me.planList) + 2; # + 2 is for end of plan line and altn end of plan.
|
||||
me.enableScroll = me.lines < me.maxItems;
|
||||
me.checkIndex();
|
||||
if (debug == 1) printf("%d: scroll is %d. Size of plan is %d", me.mcdu, me.enableScroll, size(me.planList));
|
||||
me.updateScroll();
|
||||
},
|
||||
checkIndex: func() {
|
||||
if (!me.enableScroll) {
|
||||
me.index = 0;
|
||||
if (debug == 1) printf("%d: index forced to 0",me.mcdu);
|
||||
} elsif (me.index > size(me.planList) + 2 - me.lines) {
|
||||
me.index = size(me.planList) + 2 - me.lines;
|
||||
if (debug == 1) printf("%d: index forced to %d",me.mcdu,me.index);
|
||||
}
|
||||
},
|
||||
scrollDown: func() { # Scroll Up in Thales Manual
|
||||
if (debug == 1) printf("%d: scroll down", me.mcdu);
|
||||
me.extra = 1;
|
||||
if (!me.enableScroll) {
|
||||
me.index = 0;
|
||||
} else {
|
||||
me.index += 1;
|
||||
if (me.index > size(me.planList) + 2 - me.lines) {
|
||||
me.index = 0;
|
||||
}
|
||||
}
|
||||
me.updateScroll();
|
||||
},
|
||||
scrollUp: func() { # Scroll Down in Thales Manual
|
||||
if (debug == 1) printf("%d: scroll up", me.mcdu);
|
||||
me.extra = 1;
|
||||
if (!me.enableScroll) {
|
||||
me.index = 0;
|
||||
} else {
|
||||
me.index -= 1;
|
||||
if (me.index < 0) {
|
||||
me.index = size(me.planList) + 2 - me.lines;
|
||||
}
|
||||
}
|
||||
me.updateScroll();
|
||||
},
|
||||
updateScroll: func() {
|
||||
me.output = [];
|
||||
if (me.index <= size(me.planList) + 1) {
|
||||
var i = 0;
|
||||
me.realIndex = me.index - 1;
|
||||
if (debug == 1) printf("%d: updating display from index %d", me.mcdu, me.realIndex);
|
||||
for (i = me.index; i < math.min(size(me.planList), me.index + 5); i += 1) {
|
||||
append(me.output, me.planList[i]);
|
||||
me.realIndex = i;
|
||||
}
|
||||
if (debug == 1) printf("%d: populated until wp index %d", me.mcdu,me.realIndex);
|
||||
if (me.realIndex < me.destIndex and me.lines == MAIN) {
|
||||
# Destination has not been shown yet, now its time (if we show 6 lines)
|
||||
append(me.output, me.destination);
|
||||
if (debug == 1) printf("%d: added dest at bottom for total of %d lines", me.mcdu, size(me.output));
|
||||
return;
|
||||
} else if (size(me.output) < me.lines) {
|
||||
for (i = me.realIndex + 1; size(me.output) < me.lines and i < size(me.planList); i += 1) {
|
||||
append(me.output, me.planList[i]);
|
||||
me.realIndex = i;
|
||||
}
|
||||
if (debug == 1) printf("%d: populated after until wp index %d", me.mcdu,me.realIndex);
|
||||
if (size(me.output) < me.lines) {
|
||||
if (me.realIndex == size(me.planList)-1) {
|
||||
# Show the end of plan
|
||||
append(me.output, me.planEnd);
|
||||
me.realIndex += 1;
|
||||
if (debug == 1) printf("%d: added end, wp index=%d", me.mcdu, me.realIndex);
|
||||
}
|
||||
if (size(me.output) < me.lines and (me.realIndex == size(me.planList))) {
|
||||
append(me.output, me.planNoAlt);
|
||||
me.realIndex += 1;
|
||||
if (debug == 1) printf("%d: added no-alt, wp index=%d", me.mcdu,me.realIndex);
|
||||
if (me.enableScroll and size(me.output) < me.lines) {
|
||||
# We start wrapping
|
||||
for (var j = 0; size(me.output) < me.lines; j += 1) {
|
||||
append(me.output, me.planList[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (size(me.output) < me.lines) {
|
||||
append(me.output, StaticText.new(me, "empty"));
|
||||
}
|
||||
if (debug == 1) printf("%d: %d lines", me.mcdu, size(me.output));
|
||||
},
|
||||
};
|
||||
|
||||
var FPLNLines = [FPLNLineComputer.new(0), FPLNLineComputer.new(1)];
|
||||
clearFPLNComputer(); # Just in case, we have it in the clear state.
|
||||
|
||||
var slewFPLN = func(d, i) { # Scrolling function. d is -1 or 1 for direction, and i is instance.
|
||||
if (d == 1) {
|
||||
FPLNLines[i].scrollDown(); # Scroll Up in Thales Manual
|
||||
} else if (d == -1) {
|
||||
FPLNLines[i].scrollUp(); # Scroll Down in Thales Manual
|
||||
}
|
||||
}
|
||||
|
||||
# Button and Inputs
|
||||
var FPLNButton = func(s, key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (s == "L") {
|
||||
if (key == 6 and TMPYActive[i].getBoolValue()) {
|
||||
fmgc.flightplan.eraseTempFP(i, 2);
|
||||
} else {
|
||||
if (scratchpad != "") {
|
||||
if (size(FPLNLines[i].output) >= key) {
|
||||
FPLNLines[i].output[key - 1].pushButtonLeft();
|
||||
}
|
||||
} else {
|
||||
notAllowed(i); # Remove when has functionality
|
||||
# FIXME: Add LAT REV Logic
|
||||
}
|
||||
}
|
||||
} else if (s == "R") {
|
||||
if (key == 6 and TMPYActive[i].getBoolValue()) {
|
||||
fmgc.flightplan.executeTempFP(i, 2);
|
||||
} else {
|
||||
# if (scratchpad != "") {
|
||||
# if (size(FPLNLines[i].output) >= key) {
|
||||
# FPLNLines[i].output[key - 1].pushButtonRight();
|
||||
# }
|
||||
# } else {
|
||||
notAllowed(i); # Remove when has functionality
|
||||
# FIXME: Add VERT REV Logic
|
||||
# }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var notInDataBase = func(i) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) { # Messages clear after NOT IN DATABASE
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "NOT IN DATABASE");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", getprop("/MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "NOT IN DATABASE");
|
||||
}
|
||||
|
||||
# For testing purposes only -- do not touch!
|
||||
var test = func {
|
||||
var fp = createFlightplan(getprop("sim/aircraft-dir")~"/plan.gpx");
|
||||
var desti = int(fp.getPlanSize()*0.5);
|
||||
FPLNLines[0].replacePlan(fp,6,desti,0);
|
||||
print("Display:");
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("down");FPLNLines[0].scrollDown();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
print("up");FPLNLines[0].scrollUp();
|
||||
foreach(line;FPLNLines[0].output) {
|
||||
printf("line: %s",line.getText());
|
||||
}
|
||||
}
|
||||
|
||||
#test();
|
||||
|
|
|
@ -70,6 +70,7 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
clearFPLNComputer();
|
||||
setprop("/FMGC/internal/dep-arpt", "");
|
||||
setprop("/FMGC/internal/arr-arpt", "");
|
||||
setprop("/FMGC/internal/tofrom-set", 0);
|
||||
|
@ -87,7 +88,7 @@ var initInputA = func(key, i) {
|
|||
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("/FMGC/internal/tofrom-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.flightplan.updateARPT(fromto[0], fromto[1], 1);
|
||||
fmgc.flightplan.updateARPT(fromto[0], fromto[1], 2);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
|
|
@ -96,53 +96,59 @@ var lskbutton = func(btn, i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L1",i);
|
||||
perfTOInput("L1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("L1",i);
|
||||
radnavInput("L1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||
dataInput("L1",i);
|
||||
dataInput("L1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("L1",i);
|
||||
printInput("L1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("L1",i);
|
||||
printInput2("L1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("L", 1, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "2") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
PerfInput("L2",i);
|
||||
PerfInput("L2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L2",i);
|
||||
perfTOInput("L2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("L2",i);
|
||||
radnavInput("L2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||
initInputA("L5",i); # Does the same thing as on the INIT page
|
||||
initInputA("L5", i); # Does the same thing as on the INIT page
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||
initInputA("L5",i);
|
||||
initInputA("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DES") {
|
||||
initInputA("L5",i);
|
||||
initInputA("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||
dataInput("L2",i);
|
||||
dataInput("L2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("L2",i);
|
||||
printInput("L2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("L2",i);
|
||||
printInput2("L2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("L", 2, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "3") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("L3",i);
|
||||
initInputA("L3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L3",i);
|
||||
perfTOInput("L3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "STATUS") {
|
||||
statusInput("L3",i);
|
||||
statusInput("L3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("L3",i);
|
||||
radnavInput("L3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("L3",i);
|
||||
printInput("L3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("L3",i);
|
||||
printInput2("L3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("L", 3, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -150,45 +156,51 @@ var lskbutton = func(btn, i) {
|
|||
if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "STATUS");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L4",i);
|
||||
perfTOInput("L4", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("L4",i);
|
||||
radnavInput("L4", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("L4",i);
|
||||
printInput2("L4", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("L", 4, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "5") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("L5",i);
|
||||
initInputA("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L5",i);
|
||||
perfTOInput("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||
perfCLBInput("L5",i);
|
||||
perfCLBInput("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||
perfCRZInput("L5",i);
|
||||
perfCRZInput("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DES") {
|
||||
perfDESInput("L5",i);
|
||||
perfDESInput("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("L5",i);
|
||||
radnavInput("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("L5",i);
|
||||
printInput("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("L5",i);
|
||||
printInput2("L5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("L", 5, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "6") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("L6",i);
|
||||
initInputA("L6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||
perfCLBInput("L6",i);
|
||||
perfCLBInput("L6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||
perfCRZInput("L6",i);
|
||||
perfCRZInput("L6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DES") {
|
||||
perfDESInput("L6",i);
|
||||
perfDESInput("L6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("L6",i);
|
||||
printInput2("L6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("L", 6, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -202,59 +214,59 @@ var lskbutton_b = func(btn, i) {
|
|||
var rskbutton = func(btn, i) {
|
||||
if (btn == "1") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R1",i);
|
||||
initInputA("R1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("R1",i);
|
||||
initInputB("R1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("R1",i);
|
||||
radnavInput("R1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("R1",i);
|
||||
printInput("R1", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("R1",i);
|
||||
printInput2("R1", i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "2") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("R2",i);
|
||||
initInputB("R2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("R2",i);
|
||||
radnavInput("R2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("R2",i);
|
||||
printInput("R2", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("R2",i);
|
||||
printInput2("R2", i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "3") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R3",i);
|
||||
initInputA("R3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("R3",i);
|
||||
perfTOInput("R3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
printInput("R3",i);
|
||||
printInput("R3", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("R3",i);
|
||||
printInput2("R3", i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "4") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("R4",i);
|
||||
perfTOInput("R4", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("R4",i);
|
||||
radnavInput("R4", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
printInput2("R4",i);
|
||||
printInput2("R4", i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "5") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("R5",i);
|
||||
perfTOInput("R5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||
radnavInput("R5",i);
|
||||
radnavInput("R5", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||
dataInput("R5",i);
|
||||
dataInput("R5", i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -268,11 +280,11 @@ var rskbutton = func(btn, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("R6",i);
|
||||
perfTOInput("R6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||
perfCLBInput("R6",i);
|
||||
perfCLBInput("R6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||
perfCRZInput("R6",i);
|
||||
perfCRZInput("R6", i);
|
||||
} else if ((getprop("/MCDU[" ~ i ~ "]/page") == "DATA") or (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") or (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2")) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad") != "AOC DISABLED") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
|
@ -284,7 +296,9 @@ var rskbutton = func(btn, i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "AOC DISABLED");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R6",i);
|
||||
initInputA("R6", i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
FPLNButton("R", 6, i);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -333,9 +347,13 @@ var arrowbutton = func(btn, i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
||||
}
|
||||
} else if (btn == "up") {
|
||||
# Nothing for now
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
slewFPLN(1, i);
|
||||
}
|
||||
} else if (btn == "down") {
|
||||
# Nothing for now
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
slewFPLN(-1, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,7 +381,12 @@ var pagebutton = func(btn, i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
} else if (btn == "f-pln") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
|
||||
if (active_out[2].getBoolValue()) {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
|
||||
}
|
||||
} else if (btn == "fuel-pred") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
}
|
||||
|
@ -534,6 +557,18 @@ var notAllowed = func(i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
|
||||
var formatError = func(i) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad") != "FORMAT ERROR") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", getprop("/MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "FORMAT ERROR");
|
||||
}
|
||||
|
||||
var screenFlash = func(time, i) {
|
||||
var page = getprop("/MCDU[" ~ i ~ "]/page");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "NONE");
|
||||
|
|
|
@ -7,7 +7,7 @@ print("System: FMGC Dev Version - Copyright (c) 2019 Joshua Davidson (it0uchpods
|
|||
|
||||
# 0 = TEMP FP
|
||||
# 1 = ACTIVE FP
|
||||
var fp = [createFlightplan(), createFlightplan()];
|
||||
var fp = [createFlightplan(), createFlightplan(), createFlightplan()];
|
||||
var wpDep = nil;
|
||||
var wpArr = nil;
|
||||
var pos = nil;
|
||||
|
@ -18,44 +18,46 @@ var courseDistanceFrom = nil;
|
|||
var courseDistanceFromPrev = nil;
|
||||
var sizeWP = nil;
|
||||
var magTrueError = 0;
|
||||
var arrivalAirportI = 0;
|
||||
var arrivalAirportI = [0, 0, 0];
|
||||
|
||||
# Vars for MultiFlightplan
|
||||
var currentWP = [nil, 0];
|
||||
var currentLeg = [nil, ""];
|
||||
var currentWP = [nil, nil, 0];
|
||||
var currentLeg = [nil, nil, ""];
|
||||
|
||||
# Create/Fetch props.nas for MultiFlightplan
|
||||
var altFeet = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1);
|
||||
var active_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/active", 0, "BOOL")];
|
||||
var currentWP_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/current-wp", 0, "INT")];
|
||||
var currentLeg_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/current-leg", "", "STRING")];
|
||||
var currentLegCourse_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/current-leg-course", 0, "DOUBLE")];
|
||||
var currentLegDist_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/current-leg-dist", 0, "DOUBLE")];
|
||||
var currentLegCourseMag_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/current-leg-course-mag", 0, "DOUBLE")];
|
||||
var arrivalLegDist_out = [nil, props.globals.initNode("/FMGC/flightplan[1]/arrival-leg-dist", 0, "DOUBLE")];
|
||||
var num_out = [props.globals.initNode("/FMGC/flightplan[0]/num", 0, "INT"), props.globals.initNode("/FMGC/flightplan[1]/num", 0, "INT")];
|
||||
var active_out = [nil, nil, props.globals.initNode("/FMGC/flightplan[2]/active", 0, "BOOL")];
|
||||
var currentWP_out = [nil, nil, props.globals.initNode("/FMGC/flightplan[2]/current-wp", 0, "INT")];
|
||||
var currentLeg_out = [nil, nil, props.globals.initNode("/FMGC/flightplan[2]/current-leg", "", "STRING")];
|
||||
var currentLegCourse_out = [nil, nil, props.globals.initNode("/FMGC/flightplan[2]/current-leg-course", 0, "DOUBLE")];
|
||||
var currentLegDist_out = [nil, nil, props.globals.initNode("/FMGC/flightplan[2]/current-leg-dist", 0, "DOUBLE")];
|
||||
var currentLegCourseMag_out = [nil, nil, props.globals.initNode("/FMGC/flightplan[2]/current-leg-course-mag", 0, "DOUBLE")];
|
||||
var arrivalLegDist_out = [props.globals.initNode("/FMGC/flightplan[0]/arrival-leg-dist", 0, "DOUBLE"), props.globals.initNode("/FMGC/flightplan[1]/arrival-leg-dist", 0, "DOUBLE"), props.globals.initNode("/FMGC/flightplan[2]/arrival-leg-dist", 0, "DOUBLE")];
|
||||
var num_out = [props.globals.initNode("/FMGC/flightplan[0]/num", 0, "INT"), props.globals.initNode("/FMGC/flightplan[1]/num", 0, "INT"), props.globals.initNode("/FMGC/flightplan[2]/num", 0, "INT")];
|
||||
var toFromSet = props.globals.initNode("/FMGC/internal/tofrom-set", 0, "BOOL");
|
||||
var magHDG = props.globals.getNode("/orientation/heading-magnetic-deg", 1);
|
||||
var trueHDG = props.globals.getNode("/orientation/heading-deg", 1);
|
||||
var FMGCdep = props.globals.getNode("/FMGC/internal/dep-arpt", 1);
|
||||
var FMGCarr = props.globals.getNode("/FMGC/internal/arr-arpt", 1);
|
||||
var TMPYactive = props.globals.initNode("/FMGC/internal/tmpy-active", 0, "BOOL");
|
||||
var TMPYActive = [props.globals.initNode("/FMGC/internal/tmpy-active[0]", 0, "BOOL"), props.globals.initNode("/FMGC/internal/tmpy-active[1]", 0, "BOOL")];
|
||||
|
||||
# Create props.nas for flightplan
|
||||
# Vectors inside vectors, so we can use as many flightplans or waypoints as we want
|
||||
var wpID = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/id", "", "STRING")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/id", "", "STRING")]];
|
||||
var wpLat = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/lat", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lat", 0, "DOUBLE")]];
|
||||
var wpLon = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/lon", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lon", 0, "DOUBLE")]];
|
||||
var wpCourse = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/course", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course", 0, "DOUBLE")]];
|
||||
var wpDistance = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/distance", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance", 0, "DOUBLE")]];
|
||||
var wpCoursePrev = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/course-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course-from-prev", 0, "DOUBLE")]];
|
||||
var wpDistancePrev = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/distance-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance-from-prev", 0, "DOUBLE")]];
|
||||
var wpID = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/id", "", "STRING")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/id", "", "STRING")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/id", "", "STRING")]];
|
||||
var wpLat = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/lat", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lat", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/lat", 0, "DOUBLE")]];
|
||||
var wpLon = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/lon", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lon", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/lon", 0, "DOUBLE")]];
|
||||
var wpCourse = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/course", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/course", 0, "DOUBLE")]];
|
||||
var wpDistance = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/distance", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/distance", 0, "DOUBLE")]];
|
||||
var wpCoursePrev = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/course-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/course-from-prev", 0, "DOUBLE")]];
|
||||
var wpDistancePrev = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/distance-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/distance-from-prev", 0, "DOUBLE")]];
|
||||
|
||||
var flightplan = {
|
||||
reset: func() {
|
||||
TMPYactive.setBoolValue(0);
|
||||
TMPYActive[0].setBoolValue(0);
|
||||
TMPYActive[1].setBoolValue(0);
|
||||
me.reset0();
|
||||
me.reset1();
|
||||
me.reset2();
|
||||
},
|
||||
reset0: func() {
|
||||
fp[0].cleanPlan();
|
||||
|
@ -66,61 +68,137 @@ var flightplan = {
|
|||
fp[1].cleanPlan();
|
||||
fp[1].departure = nil;
|
||||
fp[1].destination = nil;
|
||||
currentWP[1] = 0;
|
||||
currentLeg[1] = "";
|
||||
},
|
||||
initTempFP: func(n) {
|
||||
fp[0] = fp[n].clone();
|
||||
me.checkWPOutputs(0);
|
||||
TMPYactive.setBoolValue(1);
|
||||
reset2: func() {
|
||||
fp[2].cleanPlan();
|
||||
fp[2].departure = nil;
|
||||
fp[2].destination = nil;
|
||||
currentWP[2] = 0;
|
||||
currentLeg[2] = "";
|
||||
},
|
||||
executeTempFP: func(n) {
|
||||
fp[n] = fp[0].clone();
|
||||
initTempFP: func(f, n) { # f is temp, n is active
|
||||
fp[f] = fp[n].clone();
|
||||
TMPYActive[f].setBoolValue(1);
|
||||
me.checkWPOutputs(f);
|
||||
},
|
||||
eraseTempFP: func(f, n) { # f is temp, n is active
|
||||
TMPYActive[f].setBoolValue(0);
|
||||
if (f == 0) {
|
||||
me.reset0();
|
||||
} else if (f == 1) {
|
||||
me.reset1();
|
||||
}
|
||||
me.checkWPOutputs(n);
|
||||
TMPYactive.setBoolValue(0);
|
||||
me.reset0();
|
||||
},
|
||||
executeTempFP: func(f, n) { # f is temp, n is active
|
||||
fp[n] = fp[f].clone();
|
||||
TMPYActive[f].setBoolValue(0);
|
||||
if (f == 0) {
|
||||
me.reset0();
|
||||
} else if (f == 1) {
|
||||
me.reset1();
|
||||
}
|
||||
me.checkWPOutputs(n);
|
||||
},
|
||||
advanceDelete: func(n) {
|
||||
if (num_out[n].getValue() > 2) {
|
||||
if (TMPYActive[0].getBoolValue() and wpID[0][0] == wpID[n][0]) {
|
||||
me.deleteWP(0, 0);
|
||||
}
|
||||
if (TMPYActive[1].getBoolValue() and wpID[1][0] == wpID[n][0]) {
|
||||
me.deleteWP(0, 1);
|
||||
}
|
||||
me.deleteWP(0, n, 1);
|
||||
}
|
||||
},
|
||||
updateARPT: func(dep, arr, n) {
|
||||
if (n == 1) { # Which flightplan?
|
||||
me.reset1();
|
||||
if (n == 2) { # Which flightplan?
|
||||
me.reset2();
|
||||
|
||||
# Set Departure ARPT
|
||||
if (dep != nil) {
|
||||
fp[1].departure = airportinfo(dep);
|
||||
fp[2].departure = airportinfo(dep);
|
||||
} else {
|
||||
fp[1].departure = nil;
|
||||
fp[2].departure = nil;
|
||||
}
|
||||
|
||||
# Set Arrival ARPT
|
||||
if (arr != nil) {
|
||||
fp[1].destination = airportinfo(arr);
|
||||
fp[2].destination = airportinfo(arr);
|
||||
} else {
|
||||
fp[1].destination = nil;
|
||||
fp[2].destination = nil;
|
||||
}
|
||||
|
||||
currentWP[1] = 0;
|
||||
currentWP[2] = 0;
|
||||
}
|
||||
|
||||
me.checkWPOutputs(n);
|
||||
},
|
||||
# return 1 will cause NOT IN DATABASE, return 2 will cause NOT ALLOWED
|
||||
insertFix: func(wp, i, n) {
|
||||
var pos = findFixesByID(wp);
|
||||
if (pos != nil and size(pos) > 0) {
|
||||
if (i == 0) {
|
||||
return 2;
|
||||
} else if (pos != nil and size(pos) > 0) {
|
||||
fp[n].insertWP(createWPFrom(pos[0]), i);
|
||||
me.checkWPOutputs(n);
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
insertArpt: func(wp, i, n) {
|
||||
var pos = findAirportsByICAO(wp);
|
||||
if (i == 0) {
|
||||
return 2;
|
||||
} else if (pos != nil and size(pos) > 0) {
|
||||
fp[n].insertWP(createWPFrom(pos[0]), i);
|
||||
me.checkWPOutputs(n);
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
insertNavaid: func(nav, i, n) {
|
||||
var pos = findNavaidsByID(nav);
|
||||
if (pos != nil and size(pos) > 0) {
|
||||
if (i == 0) {
|
||||
return 2;
|
||||
} else if (pos != nil and size(pos) > 0) {
|
||||
fp[n].insertWP(createWPFrom(pos[0]), i);
|
||||
me.checkWPOutputs(n);
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
deleteWP: func(i, n) {
|
||||
if (fp[n].getPlanSize() > 2 and wpID[i].getValue() != FMGCdep.getValue() and wpID[i].getValue() != FMGCarr.getValue()) { # Not allowed to remove departure or arrival airport
|
||||
insertPPOS: func(n) {
|
||||
fp[n].insertWP(createWP(geo.aircraft_position(), "PPOS"), 0);
|
||||
me.checkWPOutputs(n);
|
||||
},
|
||||
insertTP: func(n) {
|
||||
fp[n].insertWP(createWP(geo.aircraft_position(), "T/P"), 0);
|
||||
me.checkWPOutputs(n);
|
||||
},
|
||||
deleteWP: func(i, n, t) {
|
||||
var wp = wpID[n][i].getValue();
|
||||
if (t == 1) {
|
||||
fp[n].deleteWP(i);
|
||||
me.outputProps(); # Make sure everything is updated before we update the MCDUs.
|
||||
me.updateMCDUDriver(n);
|
||||
canvas_nd.A3XXRouteDriver.triggerSignal("fp-removed");
|
||||
return 0;
|
||||
} else {
|
||||
if (i == 0) {
|
||||
return 2;
|
||||
} else if (fp[n].getPlanSize() > 2 and wp != FMGCdep.getValue() and wp != FMGCarr.getValue() and wp != "T/P" and wp != "PPOS") {
|
||||
fp[n].deleteWP(i);
|
||||
me.outputProps(); # Make sure everything is updated before we update the MCDUs.
|
||||
me.updateMCDUDriver(n);
|
||||
canvas_nd.A3XXRouteDriver.triggerSignal("fp-removed");
|
||||
return 0;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
},
|
||||
checkWPOutputs: func(n) {
|
||||
|
@ -134,14 +212,25 @@ var flightplan = {
|
|||
append(wpCoursePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/course-from-prev", 0, "DOUBLE"));
|
||||
append(wpDistancePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/distance-from-prev", 0, "DOUBLE"));
|
||||
}
|
||||
canvas_nd.A3XXRouteDriver.triggerSignal("fp-added");
|
||||
me.outputProps(); # Make sure everything is updated before we update the MCDUs.
|
||||
me.updateMCDUDriver(n);
|
||||
canvas_nd.A3XXRouteDriver.triggerSignal("fp-added"); # Update the NDs
|
||||
},
|
||||
updateMCDUDriver: func(n) {
|
||||
for (var i = 0; i < 2; i += 1) { # Update the 2 MCDUs
|
||||
if (TMPYActive[i].getBoolValue()) {
|
||||
mcdu.FPLNLines[i].replacePlan(i, mcdu.TMPY, mcdu.FPLNLines[i].index);
|
||||
} else {
|
||||
mcdu.FPLNLines[i].replacePlan(2, mcdu.MAIN, mcdu.FPLNLines[i].index);
|
||||
}
|
||||
}
|
||||
},
|
||||
outputProps: func() {
|
||||
geoPos = geo.aircraft_position();
|
||||
|
||||
for (var n = 0; n < 2; n += 1) { # Note: Some things don't get done for TMPY (0) hence all the if (n != 0) {}
|
||||
if (((n == 0 and TMPYactive.getBoolValue()) or n > 0) and toFromSet.getBoolValue() and fp[n].departure != nil and fp[n].destination != nil) {
|
||||
if (n != 0) {
|
||||
for (var n = 0; n < 3; n += 1) { # Note: Some things don't get done for TMPY (0) hence all the if (n > 1) {}
|
||||
if (((n == 0 and TMPYActive[0].getBoolValue()) or (n == 1 and TMPYActive[1].getBoolValue()) or n > 1) and toFromSet.getBoolValue() and fp[n].departure != nil and fp[n].destination != nil) {
|
||||
if (n > 1) {
|
||||
if (currentWP[n] > fp[n].getPlanSize()) {
|
||||
currentWP[n] = fp[n].getPlanSize();
|
||||
}
|
||||
|
@ -186,18 +275,14 @@ var flightplan = {
|
|||
wpDistancePrev[n][i].setValue(courseDistanceFrom[1]);
|
||||
}
|
||||
|
||||
if (n != 0) {
|
||||
if (wpID[n][i].getValue() == FMGCarr.getValue()) {
|
||||
arrivalAirportI = i;
|
||||
}
|
||||
if (wpID[n][i].getValue() == FMGCarr.getValue()) {
|
||||
arrivalAirportI[n] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (n != 0) {
|
||||
arrivalLegDist_out[n].setValue(wpDistance[n][arrivalAirportI].getValue());
|
||||
}
|
||||
arrivalLegDist_out[n].setValue(wpDistance[n][arrivalAirportI[n]].getValue());
|
||||
} else {
|
||||
if (n != 0) {
|
||||
if (n > 1) {
|
||||
if (active_out[n].getBoolValue() != 0) {
|
||||
active_out[n].setBoolValue(0);
|
||||
}
|
||||
|
@ -212,7 +297,7 @@ var flightplan = {
|
|||
}
|
||||
}
|
||||
|
||||
if (n != 0) {
|
||||
if (n > 1) {
|
||||
if (currentWP[n] != nil) {
|
||||
if (currentWP_out[n].getValue() != currentWP[n]) {
|
||||
currentWP_out[n].setValue(currentWP[n]);
|
||||
|
@ -224,10 +309,7 @@ var flightplan = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
mcdu.updateFPLN(0);
|
||||
mcdu.updateFPLN(1);
|
||||
},
|
||||
};
|
||||
|
||||
var outputPropsTimer = maketimer(0.4, flightplan.outputProps);
|
||||
var outputPropsTimer = maketimer(0.1, flightplan.outputProps);
|
||||
|
|
|
@ -449,7 +449,7 @@
|
|||
</condition>
|
||||
<expression>
|
||||
<sum>
|
||||
<property>/FMGC/flightplan[1]/current-leg-course</property>
|
||||
<property>/FMGC/flightplan[2]/current-leg-course</property>
|
||||
<product>
|
||||
<property>/it-autoflight/internal/drift-angle-deg</property>
|
||||
<value>-1.0</value>
|
||||
|
|
Reference in a new issue