Merge branch 'master' of https://github.com/it0uchpods/IDG-A32X into ECAM

This commit is contained in:
Jonathan Redpath 2018-04-09 16:07:42 +01:00
commit ab0c910329
3 changed files with 889 additions and 773 deletions

View file

@ -9,6 +9,8 @@ var MCDU_1 = nil;
var MCDU_2 = nil; var MCDU_2 = nil;
var MCDU1_display = nil; var MCDU1_display = nil;
var MCDU2_display = nil; var MCDU2_display = nil;
var updateL = 0;
var updateR = 0;
var default = "BoeingCDU-Large.ttf"; var default = "BoeingCDU-Large.ttf";
var symbol = "helvetica_medium.txf"; var symbol = "helvetica_medium.txf";
var normal = 70; var normal = 70;
@ -22,6 +24,8 @@ var ils = "";
var adf1 = ""; var adf1 = "";
var adf2 = ""; var adf2 = "";
var engrdy = ""; var engrdy = "";
setprop("/MCDU[0]/internal/switch", 0);
setprop("/MCDU[1]/internal/switch", 0);
setprop("/MCDUC/colors/wht/r", 1); setprop("/MCDUC/colors/wht/r", 1);
setprop("/MCDUC/colors/wht/g", 1); setprop("/MCDUC/colors/wht/g", 1);
setprop("/MCDUC/colors/wht/b", 1); setprop("/MCDUC/colors/wht/b", 1);
@ -93,19 +97,32 @@ var canvas_MCDU_base = {
if (getprop("/systems/electrical/bus/ac1") >= 110) { if (getprop("/systems/electrical/bus/ac1") >= 110) {
MCDU_1.page.show(); MCDU_1.page.show();
MCDU_1.update(); MCDU_1.update();
updateL = 1;
} else { } else {
MCDU_1.page.hide(); MCDU_1.page.hide();
updateL = 0;
} }
if (getprop("/systems/electrical/bus/ac2") >= 110) { if (getprop("/systems/electrical/bus/ac2") >= 110) {
MCDU_2.page.show(); MCDU_2.page.show();
MCDU_2.update(); MCDU_2.update();
updateR = 1;
} else { } else {
MCDU_2.page.hide(); MCDU_2.page.hide();
updateR = 0;
}
},
updateFast: func() {
if (updateL) {
MCDU_1.updateFast();
}
if (updateR) {
MCDU_2.updateFast();
} }
}, },
updateCommon: func(i) { updateCommon: func(i) {
page = getprop("/MCDU[" ~ i ~ "]/page"); page = getprop("/MCDU[" ~ i ~ "]/page");
if (page == "MCDU") { if (page == "MCDU") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].hide(); me["Simple_Center"].hide();
me["INITA"].hide(); me["INITA"].hide();
@ -168,6 +185,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
if (getprop("/MCDU[" ~ i ~ "]/active") == 0) { if (getprop("/MCDU[" ~ i ~ "]/active") == 0) {
me["Simple_L1"].setText(" FMGC"); me["Simple_L1"].setText(" FMGC");
me["Simple_L1"].setColor(1,1,1); me["Simple_L1"].setColor(1,1,1);
@ -183,6 +203,7 @@ var canvas_MCDU_base = {
me["Simple_L4"].setText(" CFDS"); me["Simple_L4"].setText(" CFDS");
me["Simple_R6"].setText("RETURN "); me["Simple_R6"].setText("RETURN ");
} else if (page == "STATUS") { } else if (page == "STATUS") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].hide(); me["Simple_Center"].hide();
me["INITA"].hide(); me["INITA"].hide();
@ -246,6 +267,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
me["Simple_L1"].setText(sprintf("%s", getprop("/MCDUC/eng"))); me["Simple_L1"].setText(sprintf("%s", getprop("/MCDUC/eng")));
me["Simple_L2"].setText(sprintf("%s", " " ~ getprop("/FMGC/internal/navdatabase"))); me["Simple_L2"].setText(sprintf("%s", " " ~ getprop("/FMGC/internal/navdatabase")));
me["Simple_L3"].setText(sprintf("%s", " " ~ getprop("/FMGC/internal/navdatabase2"))); me["Simple_L3"].setText(sprintf("%s", " " ~ getprop("/FMGC/internal/navdatabase2")));
@ -260,6 +284,7 @@ var canvas_MCDU_base = {
me["Simple_R6"].setText("STATUS/XLOAD "); me["Simple_R6"].setText("STATUS/XLOAD ");
me["Simple_R6S"].setText("SOFTWARE "); me["Simple_R6S"].setText("SOFTWARE ");
} else if (page == "DATA") { } else if (page == "DATA") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].hide(); me["Simple_Center"].hide();
me["INITA"].hide(); me["INITA"].hide();
@ -323,6 +348,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
me["Simple_L1"].setText(" MONITOR"); me["Simple_L1"].setText(" MONITOR");
me["Simple_L2"].setText(" MONITOR"); me["Simple_L2"].setText(" MONITOR");
me["Simple_L3"].setText(" MONITOR"); me["Simple_L3"].setText(" MONITOR");
@ -335,6 +363,7 @@ var canvas_MCDU_base = {
me["Simple_R5S"].setText("PRINT "); me["Simple_R5S"].setText("PRINT ");
me["Simple_R6S"].setText("AOC "); me["Simple_R6S"].setText("AOC ");
} else if (page == "DATA2") { } else if (page == "DATA2") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].hide(); me["Simple_Center"].hide();
me["INITA"].hide(); me["INITA"].hide();
@ -398,6 +427,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
me["Simple_L1"].setText(" WAYPOINTS"); me["Simple_L1"].setText(" WAYPOINTS");
me["Simple_L2"].setText(" NAVAIDS"); me["Simple_L2"].setText(" NAVAIDS");
me["Simple_L3"].setText(" RUNWAYS"); me["Simple_L3"].setText(" RUNWAYS");
@ -415,6 +447,7 @@ var canvas_MCDU_base = {
me["Simple_R3S"].setText("PILOTS "); me["Simple_R3S"].setText("PILOTS ");
me["Simple_R4S"].setText("PILOTS "); me["Simple_R4S"].setText("PILOTS ");
} else if (page == "POSMON") { } else if (page == "POSMON") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].show(); me["Simple_Center"].show();
me["INITA"].hide(); me["INITA"].hide();
@ -490,6 +523,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
me["Simple_L1"].setText("FMGC1"); me["Simple_L1"].setText("FMGC1");
me["Simple_L2"].setText("FMGC2"); me["Simple_L2"].setText("FMGC2");
me["Simple_L3"].setText("GPIRS"); me["Simple_L3"].setText("GPIRS");
@ -507,6 +543,7 @@ var canvas_MCDU_base = {
me["Simple_C5"].setText("NAV -.-"); me["Simple_C5"].setText("NAV -.-");
me["Simple_C5S"].setText("IRS2"); me["Simple_C5S"].setText("IRS2");
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].hide(); me["Simple_Center"].hide();
me["INITA"].hide(); me["INITA"].hide();
@ -572,6 +609,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
vor1 = getprop("FMGC/internal/vor1-mcdu"); vor1 = getprop("FMGC/internal/vor1-mcdu");
vor2 = getprop("FMGC/internal/vor2-mcdu"); vor2 = getprop("FMGC/internal/vor2-mcdu");
ils = getprop("FMGC/internal/ils1-mcdu"); ils = getprop("FMGC/internal/ils1-mcdu");
@ -647,6 +687,7 @@ var canvas_MCDU_base = {
me["Simple_R4S"].setText("SLOPE CRS"); me["Simple_R4S"].setText("SLOPE CRS");
me["Simple_R5S"].setText("FREQ/ADF2"); me["Simple_R5S"].setText("FREQ/ADF2");
} else if (page == "INITA") { } else if (page == "INITA") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].hide(); me["Simple_Center"].hide();
me["INITA"].show(); me["INITA"].show();
@ -703,6 +744,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "amb", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "amb", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
if (getprop("/MCDUC/flight-num-set") == 1) { if (getprop("/MCDUC/flight-num-set") == 1) {
me["INITA_FltNbr"].hide(); me["INITA_FltNbr"].hide();
me["Simple_L3"].show(); me["Simple_L3"].show();
@ -791,6 +835,7 @@ var canvas_MCDU_base = {
me["Simple_R5"].setText("WIND "); me["Simple_R5"].setText("WIND ");
me["Simple_R6"].setText(sprintf("%5.0f", getprop("/FMGC/internal/tropo"))); me["Simple_R6"].setText(sprintf("%5.0f", getprop("/FMGC/internal/tropo")));
} else if (page == "INITB") { } else if (page == "INITB") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].show(); me["Simple_Center"].show();
me["INITA"].hide(); me["INITA"].hide();
@ -867,6 +912,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
if (getprop("/FMGC/internal/zfwcg-set") == 1) { if (getprop("/FMGC/internal/zfwcg-set") == 1) {
me["Simple_C1"].setFontSize(normal); me["Simple_C1"].setFontSize(normal);
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", getprop("/FMGC/internal/zfwcg"))); me["Simple_C1"].setText(" " ~ sprintf("%3.1f", getprop("/FMGC/internal/zfwcg")));
@ -916,6 +964,7 @@ var canvas_MCDU_base = {
me["Simple_R4S"].setText("TOW"); me["Simple_R4S"].setText("TOW");
me["Simple_R5S"].setText("LW"); me["Simple_R5S"].setText("LW");
} else if (page == "FUELPRED") { } else if (page == "FUELPRED") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].show(); me["Simple_Center"].show();
me["INITA"].hide(); me["INITA"].hide();
@ -993,6 +1042,9 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
engrdy = getprop("/engines/ready"); engrdy = getprop("/engines/ready");
if (!engrdy or getprop("/FMGC/internal/arr-arpt") == "") { if (!engrdy or getprop("/FMGC/internal/arr-arpt") == "") {
@ -1026,6 +1078,7 @@ var canvas_MCDU_base = {
me["Simple_R4S"].setText("CRZTEMP/TROPO"); me["Simple_R4S"].setText("CRZTEMP/TROPO");
} else if (page == "TO") { } else if (page == "TO") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].show(); me["Simple_Center"].show();
me["INITA"].hide(); me["INITA"].hide();
@ -1103,6 +1156,9 @@ var canvas_MCDU_base = {
me.colorCenter("grn", "grn", "grn", "wht", "wht", "wht"); me.colorCenter("grn", "grn", "grn", "wht", "wht", "wht");
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
if (getprop("/FMGC/internal/v1-set") == 1) { if (getprop("/FMGC/internal/v1-set") == 1) {
me["PERFTO_V1"].hide(); me["PERFTO_V1"].hide();
me["Simple_L1"].show(); me["Simple_L1"].show();
@ -1179,6 +1235,7 @@ var canvas_MCDU_base = {
me["Simple_C2S"].setText("SLT RETR "); me["Simple_C2S"].setText("SLT RETR ");
me["Simple_C3S"].setText("CLEAN "); me["Simple_C3S"].setText("CLEAN ");
} else if (page == "CLB" or page == "CRZ" or page == "DES") { } else if (page == "CLB" or page == "CRZ" or page == "DES") {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].show(); me["Simple"].show();
me["Simple_Center"].show(); me["Simple_Center"].show();
me["INITA"].hide(); me["INITA"].hide();
@ -1254,6 +1311,9 @@ var canvas_MCDU_base = {
me.colorCenter("wht", "wht", "wht", "wht", "blu", "wht"); me.colorCenter("wht", "wht", "wht", "wht", "blu", "wht");
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
if (getprop("/it-autoflight/input/spd-managed") == 1) { if (getprop("/it-autoflight/input/spd-managed") == 1) {
me["Simple_L1"].setText("MANAGED"); me["Simple_L1"].setText("MANAGED");
} else { } else {
@ -1296,14 +1356,19 @@ var canvas_MCDU_base = {
me["Simple_C5"].setText(" -350"); me["Simple_C5"].setText(" -350");
me["Simple_C1S"].setText("TIME "); me["Simple_C1S"].setText("TIME ");
} else { } else {
if (getprop("/MCDU[" ~ i ~ "]/internal/switch") != 1) {
me["Simple"].hide(); me["Simple"].hide();
me["INITA"].hide(); me["INITA"].hide();
me["INITB"].hide(); me["INITB"].hide();
me["PERFTO"].hide(); me["PERFTO"].hide();
me["ArrowLeft"].hide(); me["ArrowLeft"].hide();
me["ArrowRight"].hide(); me["ArrowRight"].hide();
}
setprop("/MCDU[" ~ i ~ "]/internal/switch", 1);
}
}
},
updateCommonFast: func(i) {
me["Scratchpad"].setText(sprintf("%s", getprop("/MCDU[" ~ i ~ "]/scratchpad"))); me["Scratchpad"].setText(sprintf("%s", getprop("/MCDU[" ~ i ~ "]/scratchpad")));
}, },
# ack = ignore, wht = white, grn = green, blu = blue, amb = amber, yel = yellow # ack = ignore, wht = white, grn = green, blu = blue, amb = amber, yel = yellow
@ -1620,6 +1685,9 @@ var canvas_MCDU_1 = {
update: func() { update: func() {
me.updateCommon(0); me.updateCommon(0);
}, },
updateFast: func() {
me.updateCommonFast(0);
},
}; };
var canvas_MCDU_2 = { var canvas_MCDU_2 = {
@ -1632,6 +1700,9 @@ var canvas_MCDU_2 = {
update: func() { update: func() {
me.updateCommon(1); me.updateCommon(1);
}, },
updateFast: func() {
me.updateCommonFast(1);
},
}; };
setlistener("sim/signals/fdm-initialized", func { setlistener("sim/signals/fdm-initialized", func {
@ -1656,12 +1727,17 @@ setlistener("sim/signals/fdm-initialized", func {
MCDU_2 = canvas_MCDU_2.new(group_MCDU2, "Aircraft/IDG-A32X/Models/Instruments/MCDU/res/mcdu.svg"); MCDU_2 = canvas_MCDU_2.new(group_MCDU2, "Aircraft/IDG-A32X/Models/Instruments/MCDU/res/mcdu.svg");
MCDU_update.start(); MCDU_update.start();
MCDU_update_fast.start();
}); });
var MCDU_update = maketimer(0.125, func { var MCDU_update = maketimer(0.2, func {
canvas_MCDU_base.update(); canvas_MCDU_base.update();
}); });
var MCDU_update_fast = maketimer(0.125, func {
canvas_MCDU_base.updateFast();
});
var showMCDU1 = func { var showMCDU1 = func {
var dlg = canvas.Window.new([512, 432], "dialog").set("resize", 1); var dlg = canvas.Window.new([512, 432], "dialog").set("resize", 1);
dlg.setCanvas(MCDU1_display); dlg.setCanvas(MCDU1_display);
@ -1671,3 +1747,11 @@ var showMCDU2 = func {
var dlg = canvas.Window.new([512, 432], "dialog").set("resize", 1); var dlg = canvas.Window.new([512, 432], "dialog").set("resize", 1);
dlg.setCanvas(MCDU2_display); dlg.setCanvas(MCDU2_display);
} }
setlistener("/MCDU[0]/page", func {
setprop("/MCDU[0]/internal/switch", 0);
});
setlistener("/MCDU[1]/page", func {
setprop("/MCDU[1]/internal/switch", 0);
});

View file

@ -13,6 +13,8 @@ var PFD_1_mismatch = nil;
var PFD_2_mismatch = nil; var PFD_2_mismatch = nil;
var PFD1_display = nil; var PFD1_display = nil;
var PFD2_display = nil; var PFD2_display = nil;
var updateL = 0;
var updateR = 0;
var elapsedtime = 0; var elapsedtime = 0;
var ASI = 0; var ASI = 0;
var ASItrgt = 0; var ASItrgt = 0;
@ -164,36 +166,44 @@ var canvas_PFD_base = {
PFD_1.page.hide(); PFD_1.page.hide();
PFD_1_test.page.show(); PFD_1_test.page.show();
PFD_1_test.update(); PFD_1_test.update();
updateL = 0;
} else if (getprop("/instrumentation/du/du2-test-time") + getprop("/instrumentation/du/du2-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) { } else if (getprop("/instrumentation/du/du2-test-time") + getprop("/instrumentation/du/du2-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) {
PFD_1.page.hide(); PFD_1.page.hide();
PFD_1_test.page.show(); PFD_1_test.page.show();
PFD_1_test.update(); PFD_1_test.update();
updateL = 0;
} else { } else {
PFD_1_test.page.hide(); PFD_1_test.page.hide();
PFD_1.page.show(); PFD_1.page.show();
PFD_1.update(); PFD_1.updateFast();
updateL = 1;
} }
} else { } else {
PFD_1_test.page.hide(); PFD_1_test.page.hide();
PFD_1.page.hide(); PFD_1.page.hide();
updateL = 0;
} }
if (getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/controls/lighting/DU/du6") > 0) { if (getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/controls/lighting/DU/du6") > 0) {
if (getprop("/instrumentation/du/du6-test-time") + getprop("/instrumentation/du/du6-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) { if (getprop("/instrumentation/du/du6-test-time") + getprop("/instrumentation/du/du6-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) {
PFD_2.page.hide(); PFD_2.page.hide();
PFD_2_test.page.show(); PFD_2_test.page.show();
PFD_2_test.update(); PFD_2_test.update();
updateR = 0;
} else if (getprop("/instrumentation/du/du5-test-time") + getprop("/instrumentation/du/du5-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) { } else if (getprop("/instrumentation/du/du5-test-time") + getprop("/instrumentation/du/du5-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) {
PFD_2.page.hide(); PFD_2.page.hide();
PFD_2_test.page.show(); PFD_2_test.page.show();
PFD_2_test.update(); PFD_2_test.update();
updateR = 0;
} else { } else {
PFD_2_test.page.hide(); PFD_2_test.page.hide();
PFD_2.page.show(); PFD_2.page.show();
PFD_2.update(); PFD_2.updateFast();
updateR = 1;
} }
} else { } else {
PFD_2_test.page.hide(); PFD_2_test.page.hide();
PFD_2.page.hide(); PFD_2.page.hide();
updateR = 0;
} }
} else { } else {
PFD_1_test.page.hide(); PFD_1_test.page.hide();
@ -204,6 +214,16 @@ var canvas_PFD_base = {
PFD_2_mismatch.page.show(); PFD_2_mismatch.page.show();
PFD_1_mismatch.update(); PFD_1_mismatch.update();
PFD_2_mismatch.update(); PFD_2_mismatch.update();
updateL = 0;
updateR = 0;
}
},
updateSlow: func() {
if (updateL) {
PFD_1.update();
}
if (updateR) {
PFD_2.update();
} }
}, },
updateCommon: func () { updateCommon: func () {
@ -489,6 +509,27 @@ var canvas_PFD_base = {
me["FMA_athr_box"].hide(); me["FMA_athr_box"].hide();
} }
# QNH
if (getprop("/modes/altimeter/std") == 1) {
me["QNH"].hide();
me["QNH_setting"].hide();
me["QNH_std"].show();
me["QNH_box"].show();
} else if (getprop("/modes/altimeter/inhg") == 0) {
me["QNH_setting"].setText(sprintf("%4.0f", getprop("/instrumentation/altimeter/setting-hpa")));
me["QNH"].show();
me["QNH_setting"].show();
me["QNH_std"].hide();
me["QNH_box"].hide();
} else if (getprop("/modes/altimeter/inhg") == 1) {
me["QNH_setting"].setText(sprintf("%2.2f", getprop("/instrumentation/altimeter/setting-inhg")));
me["QNH"].show();
me["QNH_setting"].show();
me["QNH_std"].hide();
me["QNH_box"].hide();
}
},
updateCommonFast: func() {
# Airspeed # Airspeed
# Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations # Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations
if (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") <= 30) { if (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") <= 30) {
@ -709,26 +750,6 @@ var canvas_PFD_base = {
me["ALT_target"].hide(); me["ALT_target"].hide();
} }
# QNH
if (getprop("/modes/altimeter/std") == 1) {
me["QNH"].hide();
me["QNH_setting"].hide();
me["QNH_std"].show();
me["QNH_box"].show();
} else if (getprop("/modes/altimeter/inhg") == 0) {
me["QNH_setting"].setText(sprintf("%4.0f", getprop("/instrumentation/altimeter/setting-hpa")));
me["QNH"].show();
me["QNH_setting"].show();
me["QNH_std"].hide();
me["QNH_box"].hide();
} else if (getprop("/modes/altimeter/inhg") == 1) {
me["QNH_setting"].setText(sprintf("%2.2f", getprop("/instrumentation/altimeter/setting-inhg")));
me["QNH"].show();
me["QNH_setting"].show();
me["QNH_std"].hide();
me["QNH_box"].hide();
}
# Vertical Speed # Vertical Speed
me["VS_pointer"].setRotation(getprop("/instrumentation/pfd/vs-needle") * D2R); me["VS_pointer"].setRotation(getprop("/instrumentation/pfd/vs-needle") * D2R);
@ -911,6 +932,9 @@ var canvas_PFD_1 = {
me.updateCommon(); me.updateCommon();
}, },
updateFast: func() {
me.updateCommonFast();
},
}; };
var canvas_PFD_2 = { var canvas_PFD_2 = {
@ -1004,6 +1028,9 @@ var canvas_PFD_2 = {
me.updateCommon(); me.updateCommon();
}, },
updateFast: func() {
me.updateCommonFast();
},
}; };
var canvas_PFD_1_test = { var canvas_PFD_1_test = {
@ -1178,9 +1205,14 @@ setlistener("sim/signals/fdm-initialized", func {
PFD_2_mismatch = canvas_PFD_2_mismatch.new(group_pfd2_mismatch, "Aircraft/IDG-A32X/Models/Instruments/Common/res/mismatch.svg"); PFD_2_mismatch = canvas_PFD_2_mismatch.new(group_pfd2_mismatch, "Aircraft/IDG-A32X/Models/Instruments/Common/res/mismatch.svg");
PFD_update.start(); PFD_update.start();
PFD_update_fast.start();
}); });
var PFD_update = maketimer(0.05, func { var PFD_update = maketimer(0.15, func {
canvas_PFD_base.updateSlow();
});
var PFD_update_fast = maketimer(0.05, func {
canvas_PFD_base.update(); canvas_PFD_base.update();
}); });

View file

@ -1 +1 @@
4323 4330