1
0
Fork 0

AOC Weather request pages: adjust for new font. Correct some text to new manuals. Fix behavior with CLR prompt

This commit is contained in:
Jonathan Redpath 2022-02-06 17:54:21 +00:00
parent 90a9125992
commit 760c6b275f
3 changed files with 73 additions and 52 deletions

View file

@ -440,6 +440,25 @@ var canvas_MCDU_base = {
me["Simple_R5S"].setFont("HoneywellMCDUSmall.ttf"); me["Simple_R5S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_R5S"].setFontSize(small); me["Simple_R5S"].setFontSize(small);
} }
if (page == "RECEIVEDMSG") {
me["Simple_L2S"].setFont("HoneywellMCDU.ttf");
me["Simple_L2S"].setFontSize(normal);
me["Simple_L3S"].setFont("HoneywellMCDU.ttf");
me["Simple_L3S"].setFontSize(normal);
me["Simple_L4S"].setFont("HoneywellMCDU.ttf");
me["Simple_L4S"].setFontSize(normal);
me["Simple_L5S"].setFont("HoneywellMCDU.ttf");
me["Simple_L5S"].setFontSize(normal);
} else {
me["Simple_L2S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_L2S"].setFontSize(small);
me["Simple_L3S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_L3S"].setFontSize(small);
me["Simple_L4S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_L4S"].setFontSize(small);
me["Simple_L5S"].setFont("HoneywellMCDUSmall.ttf");
me["Simple_L5S"].setFontSize(small);
}
if (page == "IRSMON") { if (page == "IRSMON") {
me["Simple_R1S"].setFont("HoneywellMCDU.ttf"); me["Simple_R1S"].setFont("HoneywellMCDU.ttf");
me["Simple_R1S"].setFontSize(normal); me["Simple_R1S"].setFontSize(normal);
@ -941,11 +960,11 @@ var canvas_MCDU_base = {
me["Simple_L1"].setText(" WEATHER TYPE"); me["Simple_L1"].setText(" WEATHER TYPE");
me["Simple_L1S"].setText(" " ~ atsu.AOC.selectedType); me["Simple_L1S"].setText(" " ~ atsu.AOC.selectedType);
me["Simple_R1S"].setText("STA 1 "); me["Simple_R1S"].setText("STA 1");
me["Simple_R2"].setText("[ ]"); me["Simple_R2"].setText("[ ]");
me["Simple_R2S"].setText("STA 2 "); me["Simple_R2S"].setText("STA 2");
me["Simple_R3"].setText("[ ]"); me["Simple_R3"].setText("[ ]");
me["Simple_R3S"].setText("STA 3 "); me["Simple_R3S"].setText("STA 3");
pageSwitch[i].setBoolValue(1); pageSwitch[i].setBoolValue(1);
} }
@ -964,7 +983,7 @@ var canvas_MCDU_base = {
} }
} else { } else {
me["Simple_R5"].setText("SEND "); me["Simple_R5"].setText("SEND ");
me["Simple_R1"].setText("[ ]"); me["Simple_R1"].setText("[ ]");
me["WEATHERREQSEND"].hide(); me["WEATHERREQSEND"].hide();
} }
@ -1029,12 +1048,8 @@ var canvas_MCDU_base = {
if (mcdu.ReceivedMessagesDatabase.getCountPages() > 1) { if (mcdu.ReceivedMessagesDatabase.getCountPages() > 1) {
me["Simple_PageNum"].show(); me["Simple_PageNum"].show();
me["Simple_PageNum"].setText(myReceivedMessages[i].getPageNumStr()); me["Simple_PageNum"].setText(myReceivedMessages[i].getPageNumStr());
me["ArrowLeft"].show();
me["ArrowRight"].show();
} else { } else {
me["Simple_PageNum"].hide(); me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
} }
me.dynamicPageArrowFunc(myReceivedMessages[i]); me.dynamicPageArrowFunc(myReceivedMessages[i]);
@ -1069,7 +1084,7 @@ var canvas_MCDU_base = {
me["Simple_C3B"].hide(); me["Simple_C3B"].hide();
me["Simple_C4B"].hide(); me["Simple_C4B"].hide();
me.fontSizeLeft(small, small, small, small, small, normal); me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
me.fontSizeCenter(normal, normal, normal, normal, normal, normal); me.fontSizeCenter(normal, normal, normal, normal, normal, normal);
me.fontSizeRight(normal, normal, normal, normal, normal, normal); me.fontSizeRight(normal, normal, normal, normal, normal, normal);

View file

@ -946,13 +946,19 @@ var rskbutton = func(btn, i) {
} else if (page == "AOCMENU") { } else if (page == "AOCMENU") {
pageNode[i].setValue("FLTLOG"); pageNode[i].setValue("FLTLOG");
} else if (page == "WEATHERREQ") { } else if (page == "WEATHERREQ") {
var result = atsu.AOC.newStation(mcdu_scratchpad.scratchpads[i].scratchpad, i); if (mcdu_scratchpad.scratchpads[i].scratchpad != "CLR") {
if (result == 1) { var result = atsu.AOC.newStation(mcdu_scratchpad.scratchpads[i].scratchpad, i);
mcdu_message(i, "NOT ALLOWED"); if (result == 1) {
} elsif (result == 2) { mcdu_message(i, "NOT ALLOWED");
mcdu_message(i, "NOT IN DATA BASE"); } elsif (result == 2) {
mcdu_message(i, "NOT IN DATA BASE");
} else {
mcdu_scratchpad.scratchpads[i].empty();
}
} else { } else {
mcdu_scratchpad.scratchpads[i].empty(); atsu.AOC.sent = 0;
atsu.AOC.received = 0;
atsu.AOC.station = nil;
} }
} else if (page == "WEATHERTYPE") { } else if (page == "WEATHERTYPE") {
atsu.AOC.selectedType = "TERM FCST"; atsu.AOC.selectedType = "TERM FCST";

View file

@ -17,7 +17,7 @@ var receivedMessagesPage = {
computer: nil, computer: nil,
size: 0, size: 0,
getPageNumStr: func() { getPageNumStr: func() {
return me.curPage ~ "/" ~ ReceivedMessagesDatabase.getCountPages(); return " " ~ sprintf("%02d",me.curPage) ~ "/" ~ sprintf("%02d",ReceivedMessagesDatabase.getCountPages());
}, },
new: func(computer) { new: func(computer) {
var ap = {parents:[receivedMessagesPage]}; var ap = {parents:[receivedMessagesPage]};
@ -58,7 +58,7 @@ var receivedMessagesPage = {
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]]; me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
}, },
_setupPageWithData: func() { _setupPageWithData: func() {
me.title = "RECEIVED MESSAGES "; me.title = "ACARS - RCVD MSGS ";
me.L6 = [" RETURN", nil, "wht"]; me.L6 = [" RETURN", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]]; me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
me.arrowsColour = [["blu", "blu", "blu", "blu", "blu", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]]; me.arrowsColour = [["blu", "blu", "blu", "blu", "blu", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
@ -71,60 +71,60 @@ var receivedMessagesPage = {
if (me.size >= (me.curPage * 5) + -4) { if (me.size >= (me.curPage * 5) + -4) {
message = ReceivedMessagesDatabase.database.vector[-5 + (me.curPage * 5)]; message = ReceivedMessagesDatabase.database.vector[-5 + (me.curPage * 5)];
me.L1[0] = " " ~ left(message.body, size(message.body) > 23 ? 23 : size(message.body)); me.L1[0] = " " ~ left(message.body, size(message.body) > 17 ? 17 : size(message.body));
me.L1[2] = "blu"; me.L1[2] = "blu";
if (!message.viewed) { if (!message.viewed) {
me.L1[1] = " " ~ message.time ~ " NEW"; me.L1[1] = " " ~ message.time ~ " NEW";
} else { } else {
me.L1[1] = " " ~ message.time ~ " VIEWED"; me.L1[1] = " " ~ message.time ~ " VIEWED";
} }
me.arrowsMatrix[0][0] = 1; me.arrowsMatrix[0][0] = 1;
} }
if (me.size >= (me.curPage * 5) + -3) { if (me.size >= (me.curPage * 5) + -3) {
message = ReceivedMessagesDatabase.database.vector[-4 + (me.curPage * 5)]; message = ReceivedMessagesDatabase.database.vector[-4 + (me.curPage * 5)];
me.L2[0] = " " ~ left(message.body, size(message.body) > 23 ? 23 : size(message.body)); me.L2[0] = " " ~ left(message.body, size(message.body) > 17 ? 17 : size(message.body));
me.L2[2] = "blu"; me.L2[2] = "blu";
if (!message.viewed) { if (!message.viewed) {
me.L2[1] = " " ~ message.time ~ " NEW"; me.L2[1] = " " ~ message.time ~ " NEW";
} else { } else {
me.L2[1] = " " ~ message.time ~ " VIEWED"; me.L2[1] = " " ~ message.time ~ " VIEWED";
} }
me.arrowsMatrix[0][1] = 1; me.arrowsMatrix[0][1] = 1;
} }
if (me.size >= (me.curPage * 5) + -2) { if (me.size >= (me.curPage * 5) + -2) {
message = ReceivedMessagesDatabase.database.vector[-3 + (me.curPage * 5)]; message = ReceivedMessagesDatabase.database.vector[-3 + (me.curPage * 5)];
me.L3[0] = " " ~ left(message.body, size(message.body) > 23 ? 23 : size(message.body)); me.L3[0] = " " ~ left(message.body, size(message.body) > 17 ? 17 : size(message.body));
me.L3[2] = "blu"; me.L3[2] = "blu";
if (!message.viewed) { if (!message.viewed) {
me.L3[1] = " " ~ message.time ~ " NEW"; me.L3[1] = " " ~ message.time ~ " NEW";
} else { } else {
me.L3[1] = " " ~ message.time ~ " VIEWED"; me.L3[1] = " " ~ message.time ~ " VIEWED";
} }
me.arrowsMatrix[0][2] = 1; me.arrowsMatrix[0][2] = 1;
} }
if (me.size >= (me.curPage * 5) + -1) { if (me.size >= (me.curPage * 5) + -1) {
message = ReceivedMessagesDatabase.database.vector[-2 + (me.curPage * 5)]; message = ReceivedMessagesDatabase.database.vector[-2 + (me.curPage * 5)];
me.L4[0] = " " ~ left(message.body, size(message.body) > 23 ? 23 : size(message.body)); me.L4[0] = " " ~ left(message.body, size(message.body) > 17 ? 17 : size(message.body));
me.L4[2] = "blu"; me.L4[2] = "blu";
if (!message.viewed) { if (!message.viewed) {
me.L4[1] = " " ~ message.time ~ " NEW"; me.L4[1] = " " ~ message.time ~ " NEW";
} else { } else {
me.L4[1] = " " ~ message.time ~ " VIEWED"; me.L4[1] = " " ~ message.time ~ " VIEWED";
} }
me.arrowsMatrix[0][3] = 1; me.arrowsMatrix[0][3] = 1;
} }
if (me.size >= (me.curPage * 5) + 0) { if (me.size >= (me.curPage * 5) + 0) {
message = ReceivedMessagesDatabase.database.vector[-1 + (me.curPage * 5)]; message = ReceivedMessagesDatabase.database.vector[-1 + (me.curPage * 5)];
me.L5[0] = " " ~ left(message.body, size(message.body) > 23 ? 23 : size(message.body)); me.L5[0] = " " ~ left(message.body, size(message.body) > 17 ? 17 : size(message.body));
me.L5[2] = "blu"; me.L5[2] = "blu";
if (!message.viewed) { if (!message.viewed) {
me.L5[1] = " " ~ message.time ~ " NEW"; me.L5[1] = " " ~ message.time ~ " NEW";
} else { } else {
me.L5[1] = " " ~ message.time ~ " VIEWED"; me.L5[1] = " " ~ message.time ~ " VIEWED";
} }
me.arrowsMatrix[0][4] = 1; me.arrowsMatrix[0][4] = 1;
} }
@ -236,37 +236,37 @@ var receivedMessagePage = {
me.L1[1] = message.time; me.L1[1] = message.time;
me.C1[1] = "VIEWED"; me.C1[1] = "VIEWED";
me.C1[2] = "grn"; me.C1[2] = "grn";
me.R1[1] = me.curPage ~ "/" ~ ReceivedMessagesDatabase.getSize(); me.R1[1] = sprintf("%02d",me.curPage) ~ "/" ~ sprintf("%02d",ReceivedMessagesDatabase.getSize());
me.L1[0] = left(message.body, size(message.body) > 30 ? 30 : size(message.body)); me.L1[0] = left(message.body, size(message.body) > 24 ? 24 : size(message.body));
me.L1[2] = "wht"; me.L1[2] = "wht";
me.L2[2] = "wht"; me.L2[2] = "wht";
me.L3[2] = "wht"; me.L3[2] = "wht";
me.L4[2] = "wht"; me.L4[2] = "wht";
me.L5[2] = "wht"; me.L5[2] = "wht";
if (size(message.body) > 30) { if (size(message.body) > 24) {
me.L2[1] = left(split(me.L1[0], message.body)[1], size(message.body) > 60 ? 30 : size(message.body) - 30); me.L2[1] = left(split(me.L1[0], message.body)[1], size(message.body) > 48 ? 24 : size(message.body) - 24);
} }
if (size(message.body) > 60) { if (size(message.body) > 48) {
me.L2[0] = left(split(me.L2[1], message.body)[1], size(message.body) > 90 ? 30 : size(message.body) - 60); me.L2[0] = left(split(me.L2[1], message.body)[1], size(message.body) > 72 ? 24 : size(message.body) - 48);
} }
if (size(message.body) > 90) { if (size(message.body) > 72) {
me.L3[1] = left(split(me.L2[0], message.body)[1], size(message.body) > 120 ? 30 : size(message.body) - 90); me.L3[1] = left(split(me.L2[0], message.body)[1], size(message.body) > 96 ? 24 : size(message.body) - 72);
}
if (size(message.body) > 96) {
me.L3[0] = left(split(me.L3[1], message.body)[1], size(message.body) > 120 ? 24 : size(message.body) - 96);
} }
if (size(message.body) > 120) { if (size(message.body) > 120) {
me.L3[0] = left(split(me.L3[1], message.body)[1], size(message.body) > 150 ? 30 : size(message.body) - 120); me.L4[1] = left(split(me.L3[0], message.body)[1], size(message.body) > 144 ? 24 : size(message.body) - 120);
} }
if (size(message.body) > 150) { if (size(message.body) > 144) {
me.L4[1] = left(split(me.L3[0], message.body)[1], size(message.body) > 180 ? 30 : size(message.body) - 150); me.L4[0] = left(split(me.L4[1], message.body)[1], size(message.body) > 168 ? 24 : size(message.body) - 144);
} }
if (size(message.body) > 180) { if (size(message.body) > 168) {
me.L4[0] = left(split(me.L4[1], message.body)[1], size(message.body) > 210 ? 30 : size(message.body) - 180); me.L5[1] = left(split(me.L4[0], message.body)[1], size(message.body) > 192 ? 24 : size(message.body) - 168);
} }
if (size(message.body) > 210) { if (size(message.body) > 192) {
me.L5[1] = left(split(me.L4[0], message.body)[1], size(message.body) > 240 ? 30 : size(message.body) - 210); me.L5[0] = left(split(me.L5[1], message.body)[1], size(message.body) > 216 ? 24 : size(message.body) - 192);
}
if (size(message.body) > 240) {
me.L5[0] = left(split(me.L5[1], message.body)[1], size(message.body) > 270 ? 30 : size(message.body) - 240);
} }
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);