1
0
Fork 0

DATA / STATUS pages - cleanup with new font

This commit is contained in:
Jonathan Redpath 2022-01-15 17:47:00 +00:00
parent eb12d3ed4d
commit da624bfb2e
5 changed files with 80 additions and 51 deletions

View file

@ -4837,7 +4837,6 @@
<file>Aircraft/A320-family/Nasal/MCDU/PERFTO.nas</file> <file>Aircraft/A320-family/Nasal/MCDU/PERFTO.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/RADNAV.nas</file> <file>Aircraft/A320-family/Nasal/MCDU/RADNAV.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/DATA.nas</file> <file>Aircraft/A320-family/Nasal/MCDU/DATA.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/STATUS.nas</file>
</mcdu> </mcdu>
<!-- Traffic layer from E-jet --> <!-- Traffic layer from E-jet -->
<traffic> <traffic>

View file

@ -373,18 +373,18 @@ var canvas_MCDU_base = {
var degrees2 = int(dms2); var degrees2 = int(dms2);
var minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60)); var minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60));
var sign2 = degrees2 >= 0 ? "E" : "W"; var sign2 = degrees2 >= 0 ? "E" : "W";
return sprintf("%d %.1f%s/%03s %.1f%s",abs(degrees),minutes,sign,abs(degrees2),minutes2,sign2); return sprintf("%d°%.1f%s/%03s°%.1f%s",abs(degrees),minutes,sign,abs(degrees2),minutes2,sign2);
}, },
getIRSStatus: func(a,b = 0) { getIRSStatus: func(a,b = 0) {
var irsstatus = "INVAL"; var irsstatus = "INVAL";
if (systems.ADIRS.ADIRunits[a].operative) { if (systems.ADIRS.ADIRunits[a].operative) {
if (systems.ADIRS.Operating.aligned[a].getValue()) { if (systems.ADIRS.Operating.aligned[a].getValue()) {
irsstatus = (systems.ADIRS.ADIRunits[a].mode == 2) ? "ATT" : "NAV"; irsstatus = (systems.ADIRS.ADIRunits[a].mode == 2) ? " ATT" : "NAV";
} else { } else {
if (b) { if (b) {
irsstatus = "ALIGN TTN" ~ sprintf("%2d",math.round(systems.ADIRS.ADIRunits[a]._alignTime) / 60); irsstatus = " ALIGN TTN" ~ sprintf("%2d",math.round(systems.ADIRS.ADIRunits[a]._alignTime) / 60);
} else { } else {
irsstatus = "ALIGN"; irsstatus = " ALIGN";
} }
} }
} }
@ -436,6 +436,33 @@ var canvas_MCDU_base = {
if (page != "ATISDETAIL") { if (page != "ATISDETAIL") {
me["ATISArrows"].hide(); me["ATISArrows"].hide();
} }
if (page == "STATUS") {
me["Simple_R5S"].setFont("HoneywellMCDU.ttf");
me["Simple_R5S"].setFontSize(normal);
} else {
me["Simple_R5S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_R5S"].setFontSize(small);
}
if (page == "IRSMON") {
me["Simple_R1S"].setFont("HoneywellMCDU.ttf");
me["Simple_R1S"].setFontSize(normal);
me["Simple_R2S"].setFont("HoneywellMCDU.ttf");
me["Simple_R2S"].setFontSize(normal);
me["Simple_R3S"].setFont("HoneywellMCDU.ttf");
me["Simple_R3S"].setFontSize(normal);
} else {
me["Simple_R1S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_R1S"].setFontSize(small);
me["Simple_R2S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_R2S"].setFontSize(small);
me["Simple_R3S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_R3S"].setFontSize(small);
}
if (page != "POSMON") {
me["Simple_Title"].setFontSize(normal);
me["Simple_Title2"].setFontSize(normal);
}
if (page == "F-PLNA" or page == "F-PLNB") { if (page == "F-PLNA" or page == "F-PLNB") {
if (!pageSwitch[i].getBoolValue()) { if (!pageSwitch[i].getBoolValue()) {
me["Simple"].show(); me["Simple"].show();
@ -1989,7 +2016,7 @@ var canvas_MCDU_base = {
me["arrowsDepArr"].show(); me["arrowsDepArr"].show();
me["arrow1L"].hide(); me["arrow1L"].hide();
me["arrow2L"].hide(); me["arrow2L"].hide();
me["arrow3L"].hide(); me["arrow3L"].show();
me["arrow4L"].hide(); me["arrow4L"].hide();
me["arrow5L"].hide(); me["arrow5L"].hide();
me["arrow1R"].hide(); me["arrow1R"].hide();
@ -2007,15 +2034,15 @@ var canvas_MCDU_base = {
showLeft(me,1, 1, 1, -1, -1, 1); showLeft(me,1, 1, 1, -1, -1, 1);
me["Simple_L0S"].hide(); me["Simple_L0S"].hide();
showLeftS(me,1, 1, 1, -1, -1, 1); showLeftS(me,1, 1, 1, -1, -1, 1);
showLeftArrow(me,-1, -1, 1, -1, -1, -1); showLeftArrow(me,-1, -1, -1, -1, -1, -1);
showRight(me,-1, 1, -1, 1, 1, 1); showRight(me,-1, 1, -1, 1, 1, 1);
showRightS(me,-1, -1, -1, 1, 1, 1); showRightS(me,-1, -1, -1, 1, 1, 1);
showRightArrow(me,-1, -1, -1, -1, -1, 1); showRightArrow(me,-1, -1, -1, -1, -1, 1);
me["Simple_C3B"].hide(); me["Simple_C3B"].hide();
me["Simple_C4B"].hide(); me["Simple_C4B"].hide();
me.fontSizeLeft(normal, normal, normal, normal, small, normal); me.fontSizeLeft(normal, normal, small, normal, normal, small);
me.fontSizeRight(normal, normal, normal, small, normal, normal); me.fontSizeRight(normal, normal, normal, normal, normal, normal);
me.colorLeft("grn", "blu", "blu", "wht", "blu", "grn"); me.colorLeft("grn", "blu", "blu", "wht", "blu", "grn");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
@ -2040,6 +2067,7 @@ var canvas_MCDU_base = {
me["Simple_R6S"].setText("SOFTWARE "); me["Simple_R6S"].setText("SOFTWARE ");
me["Simple_R4S"].setText("PILOT STORED "); me["Simple_R4S"].setText("PILOT STORED ");
me["Simple_R4"].setText("00RTES 00RWYS "); me["Simple_R4"].setText("00RTES 00RWYS ");
me["arrow3L"].setColor(BLUE);
pageSwitch[i].setBoolValue(1); pageSwitch[i].setBoolValue(1);
} }
@ -2231,7 +2259,7 @@ var canvas_MCDU_base = {
showRightArrow(me,-1, -1, -1, -1, -1, 1); showRightArrow(me,-1, -1, -1, -1, -1, 1);
me.standardFontSize(); me.standardFontSize();
me.fontSizeLeft(small, small, small, small, small, normal);
me.colorLeft("wht", "wht", "wht", "wht", "grn", "blu"); me.colorLeft("wht", "wht", "wht", "wht", "grn", "blu");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "blu"); me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "blu");
@ -2254,6 +2282,8 @@ var canvas_MCDU_base = {
if (pageFreezed[i] == nil) { if (pageFreezed[i] == nil) {
me["Simple_Title"].setText("POSITION MONITOR"); me["Simple_Title"].setText("POSITION MONITOR");
me["Simple_Title"].setFontSize(normal);
me["Simple_Title2"].setFontSize(normal);
me["Simple_Title2"].hide(); me["Simple_Title2"].hide();
me["Simple_L6"].setText(" FREEZE"); me["Simple_L6"].setText(" FREEZE");
@ -2273,7 +2303,7 @@ var canvas_MCDU_base = {
if (systems.ADIRS.Operating.aligned[0].getValue()) { # TODO real FMGC1 GPS data if (systems.ADIRS.Operating.aligned[0].getValue()) { # TODO real FMGC1 GPS data
me["Simple_R1"].setText(latlog); me["Simple_R1"].setText(latlog);
me["Simple_R1"].setColor(GREEN); me["Simple_R1"].setColor(GREEN);
me["Simple_L2S"].setText(sprintf("%16s","3IRS/GPS")); me["Simple_L2S"].setText(sprintf(" %16s","3IRS/GPS"));
} else { } else {
me["Simple_R1"].setText("----.--/-----.--"); me["Simple_R1"].setText("----.--/-----.--");
me["Simple_R1"].setColor(WHITE); me["Simple_R1"].setColor(WHITE);
@ -2283,7 +2313,7 @@ var canvas_MCDU_base = {
if (systems.ADIRS.Operating.aligned[1].getValue()) { # TODO real FMGC2 GPS data if (systems.ADIRS.Operating.aligned[1].getValue()) { # TODO real FMGC2 GPS data
me["Simple_R2"].setText(latlog); me["Simple_R2"].setText(latlog);
me["Simple_R2"].setColor(GREEN); me["Simple_R2"].setColor(GREEN);
me["Simple_L3S"].setText(sprintf("%16s","3IRS/GPS")); me["Simple_L3S"].setText(sprintf(" %16s","3IRS/GPS"));
} else { } else {
me["Simple_R2"].setText("----.--/-----.--"); me["Simple_R2"].setText("----.--/-----.--");
me["Simple_R2"].setColor(WHITE); me["Simple_R2"].setColor(WHITE);
@ -2306,7 +2336,7 @@ var canvas_MCDU_base = {
for ( var a=0; a<3; a+=1 ) { for ( var a=0; a<3; a+=1 ) {
if (systems.ADIRS.Operating.aligned[a].getValue()) { if (systems.ADIRS.Operating.aligned[a].getValue()) {
me[Simple_row5[a]].setText(sprintf("%-8s",(systems.ADIRS.ADIRunits[a].mode == 2) ? "ATT" : "NAV 0.0")); me[Simple_row5[a]].setText(sprintf("%-8s",(systems.ADIRS.ADIRunits[a].mode == 2) ? "ATT" : "NAV 0.1"));
} else { } else {
me[Simple_row5[a]].setText(sprintf("%-8s",me.getIRSStatus(a))); me[Simple_row5[a]].setText(sprintf("%-8s",me.getIRSStatus(a)));
} }
@ -2315,8 +2345,10 @@ var canvas_MCDU_base = {
} else { } else {
me["Simple_Title"].setText("POSITION FROZEN AT "); me["Simple_Title"].setText("POSITION FROZEN AT ");
me["Simple_Title"].setFontSize(small);
me["Simple_Title2"].setText(sprintf("%23s ",pageFreezed[i])); me["Simple_Title2"].setText(sprintf("%23s ",pageFreezed[i]));
me["Simple_Title2"].show(); me["Simple_Title2"].show();
me["Simple_Title2"].setFontSize(small);
me["Simple_L6"].setText(" UNFREEZE"); me["Simple_L6"].setText(" UNFREEZE");
} }
@ -2330,7 +2362,12 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) { if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter(); me.defaultHideWithCenter();
me.standardFontSize(); me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
me.fontSizeLeftS(0, 0, 0, small, small, small);
me.fontSizeRight(normal, normal, normal, normal, normal, normal);
me.fontSizeRightS(small, small, small, small, small, small);
me.fontSizeCenter(normal, normal, normal, normal, normal, normal);
me.fontSizeCenterS(small, small, small, small, small, small);
me.defaultPageNumbers(); me.defaultPageNumbers();
@ -2376,7 +2413,7 @@ var canvas_MCDU_base = {
var rows = ["Simple_L2S","Simple_L3S","Simple_L4S"]; var rows = ["Simple_L2S","Simple_L3S","Simple_L4S"];
var center = ["Simple_C1","Simple_C2","Simple_C3"]; var center = ["Simple_C1","Simple_C2","Simple_C3"];
for (var a = 0; a<3; a+=1) { for (var a = 0; a<3; a+=1) {
me[rows[a]].setText(" " ~ me.getIRSStatus(a,1)); me[rows[a]].setText(me.getIRSStatus(a,1));
if (systems.ADIRS.ADIRunits[a]._excessMotion) { if (systems.ADIRS.ADIRunits[a]._excessMotion) {
me[center[a]].show(); me[center[a]].show();
} else { } else {
@ -2385,8 +2422,8 @@ var canvas_MCDU_base = {
} }
if (fmgc.FMGCInternal.phase == 7) { # DONE phase if (fmgc.FMGCInternal.phase == 7) { # DONE phase
if (fmgc.FMGCInternal.arrApt != nil and fmgc.flightPlanController.flightplans[2].departure_runway != nil) { if (fmgc.FMGCInternal.arrApt != nil and fmgc.flightPlanController.flightplans[2].destination_runway != nil) {
me["Simple_R1S"].setText(sprintf("DRIFT AT %7s ",fmgc.FMGCInternal.arrApt ~ fmgc.flightPlanController.flightplans[2].departure_runway.id)); me["Simple_R1S"].setText(sprintf("DRIFT AT %7s ",fmgc.FMGCInternal.arrApt ~ fmgc.flightPlanController.flightplans[2].destination_runway.id));
} }
me["Simple_R2S"].setText(sprintf("DRIFT %2.1fNM/H ",0)); me["Simple_R2S"].setText(sprintf("DRIFT %2.1fNM/H ",0));
me["Simple_R3S"].setText(sprintf("DRIFT %2.1fNM/H ",0)); me["Simple_R3S"].setText(sprintf("DRIFT %2.1fNM/H ",0));
@ -2432,11 +2469,11 @@ var canvas_MCDU_base = {
me["Simple_L1S"].setText("GPS1 POSITION"); me["Simple_L1S"].setText("GPS1 POSITION");
me["Simple_L2S"].setText("TTRK"); me["Simple_L2S"].setText("TTRK");
me["Simple_L3S"].setText("MERIT"); me["Simple_L3S"].setText("MERIT");
me["Simple_L3"].setText(sprintf("%3d",((rand() * 50) - 25) + 50) ~ "M"); me["Simple_L3"].setText(sprintf("%s",int(((rand() * 50) - 25) + 50)) ~ "M");
me["Simple_L4S"].setText("GPS2 POSITION"); me["Simple_L4S"].setText("GPS2 POSITION");
me["Simple_L5S"].setText("TTRK"); me["Simple_L5S"].setText("TTRK");
me["Simple_L6S"].setText("MERIT"); me["Simple_L6S"].setText("MERIT");
me["Simple_L6"].setText(sprintf("%3d",((rand() * 50) - 25) + 50) ~ "M"); me["Simple_L6"].setText(sprintf("%s",int(((rand() * 50) - 25) + 50)) ~ "M");
me["Simple_C2S"].setText("UTC"); me["Simple_C2S"].setText("UTC");
me["Simple_C3S"].setText("GPS ALT"); me["Simple_C3S"].setText("GPS ALT");
me["Simple_C5S"].setText("UTC"); me["Simple_C5S"].setText("UTC");

View file

@ -40,6 +40,8 @@ var closestAirportPage = {
me.C1[1] = " BRG DIST"; me.C1[1] = " BRG DIST";
me.R1[1] = "UTC "; me.R1[1] = "UTC ";
me.L5 = ["[ ]", nil, "blu"]; me.L5 = ["[ ]", nil, "blu"];
me.C5 = [nil, nil, "grn"];
me.R5 = [nil, nil, "grn"];
me.L6 = [" FREEZE", nil, "blu"]; me.L6 = [" FREEZE", nil, "blu"];
me.R6 = ["EFOB/WIND ", nil, "wht"]; me.R6 = ["EFOB/WIND ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1]]; me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1]];
@ -96,31 +98,29 @@ var closestAirportPage = {
var magvarLocal = magvar(); var magvarLocal = magvar();
if (size(me.airports) >= 1) { if (size(me.airports) >= 1) {
me.cdVector[0] = courseAndDistance(me.airports[0]); me.cdVector[0] = courseAndDistance(me.airports[0]);
me.C1 = [math.round(me.cdVector[0][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"]; me.C1 = [sprintf("%03d",me.cdVector[0][0] - magvarLocal) ~ "° " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"];
} }
if (size(me.airports) >= 2) { if (size(me.airports) >= 2) {
me.cdVector[1] = courseAndDistance(me.airports[1]); me.cdVector[1] = courseAndDistance(me.airports[1]);
me.C2 = [math.round(me.cdVector[1][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[1][1]) , nil, "grn"]; me.C2 = [sprintf("%03d",me.cdVector[1][0] - magvarLocal) ~ "° " ~ math.round(me.cdVector[1][1]) , nil, "grn"];
} }
if (size(me.airports) >= 3) { if (size(me.airports) >= 3) {
me.cdVector[2] = courseAndDistance(me.airports[2]); me.cdVector[2] = courseAndDistance(me.airports[2]);
me.C3 = [math.round(me.cdVector[2][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[2][1]), nil, "grn"]; me.C3 = [sprintf("%03d",me.cdVector[2][0] - magvarLocal) ~ "° " ~ math.round(me.cdVector[2][1]), nil, "grn"];
} }
if (size(me.airports) >= 4) { if (size(me.airports) >= 4) {
me.cdVector[3] = courseAndDistance(me.airports[3]); me.cdVector[3] = courseAndDistance(me.airports[3]);
me.C4 = [math.round(me.cdVector[3][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[3][1]), nil, "grn"]; me.C4 = [sprintf("%03d",me.cdVector[3][0] - magvarLocal) ~ "° " ~ math.round(me.cdVector[3][1]), nil, "grn"];
} }
if (me.manAirport != nil) { if (me.manAirport != nil) {
me.C5 = [math.round(courseAndDistance(me.manAirport)[0] - magvarLocal) ~ " " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"]; me.C5 = [sprintf("%03d",courseAndDistance(me.manAirport)[0] - magvarLocal) ~ "° " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"];
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}, },
manAirportCall: func(id) { manAirportCall: func(id) {
if (id == "CLR") { if (id == "CLR") {
me.manAirport = nil; me.manAirport = nil;
me.L5 = [nil, nil, "grn"]; me._setupPageWithData();
me.C5 = [nil, nil, "grn"];
me.R5 = [nil, nil, "grn"];
return; return;
} }
if (size(id) > 4) { if (size(id) > 4) {
@ -131,6 +131,7 @@ var closestAirportPage = {
me.manAirport = airportinfo(id); me.manAirport = airportinfo(id);
me.L5 = [id, nil, "grn"]; me.L5 = [id, nil, "grn"];
me.R5 = ["----", nil, "grn"]; me.R5 = ["----", nil, "grn"];
mcdu_scratchpad.scratchpads[i].empty();
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} }

View file

@ -522,7 +522,7 @@ var lskbutton = func(btn, i) {
} else if (page == "PERFAPPR") { } else if (page == "PERFAPPR") {
perfAPPRInput("L3",i); perfAPPRInput("L3",i);
} else if (page == "STATUS") { } else if (page == "STATUS") {
statusInput("L3",i); fmgc.switchDatabase();
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
radnavInput("L3",i); radnavInput("L3",i);
} else if (page == "DATA") { } else if (page == "DATA") {
@ -786,7 +786,6 @@ var lskbutton = func(btn, i) {
canvas_mcdu.myDuplicate[i].pushButtonLeft(5); canvas_mcdu.myDuplicate[i].pushButtonLeft(5);
} else if (page == "CLOSESTAIRPORT") { } else if (page == "CLOSESTAIRPORT") {
canvas_mcdu.myClosestAirport[i].manAirportCall(mcdu_scratchpad.scratchpads[i].scratchpad); canvas_mcdu.myClosestAirport[i].manAirportCall(mcdu_scratchpad.scratchpads[i].scratchpad);
mcdu_scratchpad.scratchpads[i].empty();
} else if (page == "ATCMENU") { } else if (page == "ATCMENU") {
pageNode[i].setValue("NOTIFICATION"); pageNode[i].setValue("NOTIFICATION");
} else if (page == "FLTLOG") { } else if (page == "FLTLOG") {
@ -1171,7 +1170,16 @@ var rskbutton = func(btn, i) {
} }
pageNode[i].setValue("WINDDES"); pageNode[i].setValue("WINDDES");
} else if (page == "STATUS") { } else if (page == "STATUS") {
statusInput("R5",i); if (fmgc.WaypointDatabase.getCount() >= 1) {
if (fmgc.WaypointDatabase.confirm[i]) {
fmgc.WaypointDatabase.delete(i);
fmgc.WaypointDatabase.confirm[i] = 0;
} else {
fmgc.WaypointDatabase.confirm[i] = 1;
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (page == "PERFTO") { } else if (page == "PERFTO") {
perfTOInput("R5",i); perfTOInput("R5",i);
} else if (page == "PERFAPPR") { } else if (page == "PERFAPPR") {

View file

@ -1,16 +0,0 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)
var statusInput = func(key, i) {
if (key == "L3") {
fmgc.switchDatabase();
} elsif (key == "R5") {
if (fmgc.WaypointDatabase.confirm[i]) {
fmgc.WaypointDatabase.delete(i);
fmgc.WaypointDatabase.confirm[i] = 0;
} else {
fmgc.WaypointDatabase.confirm[i] = 1;
}
}
}