Merge branch 'mcdu-messages' into dev
This commit is contained in:
commit
856500e871
30 changed files with 862 additions and 2754 deletions
|
@ -4090,6 +4090,9 @@
|
|||
<canvas_mcdu>
|
||||
<file>Aircraft/A320-family/Models/Instruments/MCDU/MCDU.nas</file>
|
||||
</canvas_mcdu>
|
||||
<mcdu_scratchpad> <!-- delay till after canvas mcdu -->
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/mcdu-messages.nas</file>
|
||||
</mcdu_scratchpad>
|
||||
<!-- Autopush -->
|
||||
<autopush>
|
||||
<file>Aircraft/A320-family/Nasal/Autopush/autopush.nas</file>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1078,6 +1078,11 @@ setlistener("/FMGC/internal/fuel-calculating", func() {
|
|||
var timer30secLanding = maketimer(1, func() {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
|
||||
setprop("/FMGC/status/phase", 7);
|
||||
if (getprop("/FMGC/internal/cost-index-set")) {
|
||||
setprop("/FMGC/internal/last-cost-index", getprop("/FMGC/internal/cost-index"));
|
||||
} else {
|
||||
setprop("/FMGC/internal/last-cost-index", 0);
|
||||
}
|
||||
setprop("/FMGC/internal/landing-time", -99);
|
||||
timer30secLanding.stop();
|
||||
}
|
||||
|
|
|
@ -59,8 +59,7 @@ var WaypointDatabase = {
|
|||
}
|
||||
me.write();
|
||||
if (me.getCount() != 0) {
|
||||
setprop("/MCDU[" ~ callerIdx ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ callerIdx ~ "]/scratchpad", "PILOT ELEMENT RETAINED");
|
||||
mcdu.mcdu_message(callerIdx, "PILOT ELEMENT RETAINED");
|
||||
}
|
||||
},
|
||||
# deleteAtIndex - delete at specific index. Set to nil, so it still exists in vector
|
||||
|
|
220
Nasal/FMGC/mcdu-messages.nas
Normal file
220
Nasal/FMGC/mcdu-messages.nas
Normal file
|
@ -0,0 +1,220 @@
|
|||
# A3XX FMGC MCDU Message Generator and Control
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450) and Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
var TypeIMessage = {
|
||||
new: func(msgText, isInhibit = 0) {
|
||||
var msg = { parents: [TypeIMessage] };
|
||||
msg.msgText = msgText;
|
||||
msg.colour = "wht";
|
||||
msg.inhibitable = isInhibit;
|
||||
return msg;
|
||||
},
|
||||
};
|
||||
|
||||
var TypeIIMessage = {
|
||||
new: func(msgText, colour = "wht", isInhibit = 0) {
|
||||
var msg = { parents: [TypeIIMessage] };
|
||||
msg.msgText = msgText;
|
||||
msg.colour = colour;
|
||||
msg.inhibitable = isInhibit;
|
||||
return msg;
|
||||
},
|
||||
};
|
||||
|
||||
var MessageQueueController = {
|
||||
new: func(computer) {
|
||||
var msgC = { parents: [MessageQueueController] };
|
||||
msgC.computer = computer;
|
||||
msgC.messages = std.Vector.new(); # show left to right
|
||||
return msgC;
|
||||
},
|
||||
# first in first out
|
||||
addNewMsg: func(msg) {
|
||||
if (me.messages.size() < 5) {
|
||||
if (!me.messages.contains(msg)) {
|
||||
me.messages.append(msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
getNextMsg: func() {
|
||||
if (me.messages.size() >= 1) {
|
||||
return me.messages.vector[0];
|
||||
}
|
||||
return nil;
|
||||
},
|
||||
deleteAtIndex: func(index) {
|
||||
if (num(me.messages.size()) >= (index + 1)) {
|
||||
me.messages.pop(index);
|
||||
}
|
||||
},
|
||||
clearQueue: func() {
|
||||
me.messages.clear();
|
||||
},
|
||||
loop: func() {
|
||||
if (me.getNextMsg() != nil) {
|
||||
if (!scratchpads[me.computer].showTypeIIMsg) {
|
||||
if (scratchpads[me.computer].showTypeII(me.getNextMsg())) {
|
||||
me.deleteAtIndex(me.getNextMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var scratchpadController = {
|
||||
new: func(mcdu) {
|
||||
var sp = { parents: [scratchpadController] };
|
||||
sp.scratchpad = "";
|
||||
sp.scratchpadSave = "";
|
||||
sp.scratchpadColour = "wht";
|
||||
sp.showTypeIMsg = 0;
|
||||
sp.showTypeIIMsg = 0;
|
||||
sp.mcdu = mcdu;
|
||||
return sp;
|
||||
},
|
||||
|
||||
addChar: func(character) {
|
||||
if (size(me.scratchpad) >= 22) {
|
||||
return;
|
||||
}
|
||||
|
||||
# any shown type ii is hidden
|
||||
if (me.showTypeIIMsg) {
|
||||
me.clearTypeII();
|
||||
}
|
||||
|
||||
# any shown type i is hidden
|
||||
if (me.showTypeIMsg) {
|
||||
me.clearTypeI();
|
||||
}
|
||||
|
||||
me.scratchpad = me.scratchpad ~ character;
|
||||
me.scratchpadColour = "wht";
|
||||
me.update();
|
||||
},
|
||||
showTypeI: func(msg) {
|
||||
# any shown type ii is hidden
|
||||
if (me.showTypeIIMsg) {
|
||||
me.clearTypeII();
|
||||
}
|
||||
|
||||
if (!me.showTypeIMsg) {
|
||||
me.showTypeIMsg = 1;
|
||||
|
||||
# save any data entered
|
||||
me.scratchpadSave = me.scratchpad;
|
||||
}
|
||||
|
||||
me.scratchpad = msg.msgText;
|
||||
me.scratchpadColour = msg.colour;
|
||||
me.update();
|
||||
},
|
||||
showTypeII: func(msg) {
|
||||
# only show if scratchpad empty
|
||||
if (me.scratchpad == "") {
|
||||
me.showTypeIIMsg = 1;
|
||||
me.scratchpad = msg.msgText;
|
||||
me.scratchpadColour = msg.colour;
|
||||
me.update();
|
||||
return 1;
|
||||
}
|
||||
me.update();
|
||||
return 0;
|
||||
},
|
||||
clearTypeI: func() {
|
||||
me.scratchpad = me.scratchpadSave;
|
||||
me.scratchpadSave = nil;
|
||||
me.showTypeIMsg = 0;
|
||||
me.update();
|
||||
},
|
||||
clearTypeII: func() {
|
||||
me.showTypeIIMsg = 0;
|
||||
me.empty();
|
||||
me.update();
|
||||
},
|
||||
override: func(str) {
|
||||
if (me.scratchpad == "USING COST INDEX N") {
|
||||
me.scratchpad = "USING COST INDEX " ~ str;
|
||||
me.update();
|
||||
}
|
||||
},
|
||||
empty: func() {
|
||||
me.scratchpad = "";
|
||||
me.update();
|
||||
},
|
||||
clear: func() {
|
||||
if (me.scratchpad == "CLR") {
|
||||
me.empty();
|
||||
} elsif (me.showTypeIMsg) {
|
||||
me.clearTypeI();
|
||||
} elsif (!me.showTypeIIMsg) {
|
||||
me.scratchpad = left(me.scratchpad, size(me.scratchpad) - 1);
|
||||
} else {
|
||||
me.clearTypeII();
|
||||
}
|
||||
me.update();
|
||||
},
|
||||
update: func() {
|
||||
if (me.mcdu == 1) {
|
||||
canvas_mcdu.MCDU_1.updateScratchpadCall();
|
||||
} else {
|
||||
canvas_mcdu.MCDU_2.updateScratchpadCall();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var MessageController = {
|
||||
typeIMessages: std.Vector.new([
|
||||
TypeIMessage.new("AOC DISABLED"),TypeIMessage.new("AWY/WPT MISMATCH"),TypeIMessage.new("DIR TO IN PROGRESS"),
|
||||
TypeIMessage.new("ENTRY OUT OF RANGE"),TypeIMessage.new("FORMAT ERROR"),TypeIMessage.new("INSERT/ERASE TMPY FIRST"),
|
||||
TypeIMessage.new("LIST OF 20 IN USE"),TypeIMessage.new("PILOT ELEMENT RETAINED"),TypeIMessage.new("NOT ALLOWED"),
|
||||
TypeIMessage.new("NOT IN DATA BASE"),TypeIMessage.new("ONLY SPD ENTRY ALLOWED"),TypeIMessage.new("REVISION IN PROGRESS"),
|
||||
TypeIMessage.new("TMPY F-PLN EXISTS", 1),TypeIMessage.new("SELECT DESIRED SYSTEM"),TypeIMessage.new("SELECT HDG/TRK FIRST"),
|
||||
TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"),
|
||||
]),
|
||||
typeIIMessages: std.Vector.new([
|
||||
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
|
||||
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),
|
||||
]),
|
||||
|
||||
getTypeIMsgByText: func(text) {
|
||||
return me.getMsgByText(text, me.typeIMessages.vector);
|
||||
},
|
||||
getTypeIIMsgByText: func(text) {
|
||||
return me.getMsgByText(text, me.typeIIMessages.vector);
|
||||
},
|
||||
getMsgByText: func(text, theVector) {
|
||||
foreach (var message; theVector) {
|
||||
if (message.msgText = text) {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
},
|
||||
};
|
||||
|
||||
var scratchpads = [scratchpadController.new(1), scratchpadController.new(2)];
|
||||
var messageQueues = [MessageQueueController.new(0), MessageQueueController.new(1)];
|
||||
|
||||
var loop1MsgTimer = func() {
|
||||
if (messageQueues[0].getNextMsg() != nil) {
|
||||
if (!scratchpads[messageQueues[0].computer].showTypeIIMsg) {
|
||||
if (scratchpads[messageQueues[0].computer].showTypeII(messageQueues[0].getNextMsg())) {
|
||||
messageQueues[0].deleteAtIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var loop2MsgTimer = func() {
|
||||
if (messageQueues[1].getNextMsg() != nil) {
|
||||
if (!scratchpads[messageQueues[1].computer].showTypeIIMsg) {
|
||||
if (scratchpads[messageQueues[1].computer].showTypeII(messageQueues[1].getNextMsg())) {
|
||||
messageQueues[1].deleteAtIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var mcduMsgtimer1 = maketimer(1, loop1MsgTimer);
|
||||
var mcduMsgtimer2 = maketimer(1, loop2MsgTimer);
|
|
@ -212,6 +212,8 @@ var systemsInit = func {
|
|||
fmgc.FMGCinit();
|
||||
mcdu.MCDU_init(0);
|
||||
mcdu.MCDU_init(1);
|
||||
mcdu_scratchpad.mcduMsgtimer1.start();
|
||||
mcdu_scratchpad.mcduMsgtimer2.start();
|
||||
systemsLoop.start();
|
||||
lightsLoop.start();
|
||||
ecam.ECAM.init();
|
||||
|
|
|
@ -506,8 +506,7 @@ var arrivalPage = {
|
|||
me.arrowsColour[0][5] = "yel";
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -593,11 +592,10 @@ var arrivalPage = {
|
|||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
me.scrollRight();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (size(me.stars) >= (index - 2)) {
|
||||
|
@ -625,11 +623,10 @@ var arrivalPage = {
|
|||
me.updateActiveTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -640,8 +637,7 @@ var arrivalPage = {
|
|||
me.updateActiveTransitions();
|
||||
me.updateTransitions();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} elsif (size(me.transitions) >= (index - 1)) {
|
||||
if (!dirToFlag) {
|
||||
|
@ -652,11 +648,10 @@ var arrivalPage = {
|
|||
me.updateTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
},
|
||||
};
|
|
@ -52,6 +52,11 @@ var closestAirportPage = {
|
|||
},
|
||||
freeze: func() {
|
||||
me.frozen = !me.frozen;
|
||||
if (me.frozen) {
|
||||
me.L6 = [" UNFREEZE", nil, "blu"];
|
||||
} else {
|
||||
me.L6 = [" FREEZE", nil, "blu"];
|
||||
}
|
||||
},
|
||||
update: func() {
|
||||
if (me.frozen) { return; }
|
||||
|
@ -106,7 +111,7 @@ var closestAirportPage = {
|
|||
return;
|
||||
}
|
||||
if (size(id) > 4) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
if (airportinfo(id) == nil) {
|
||||
notInDataBase(me.computer);
|
||||
|
|
|
@ -430,8 +430,7 @@ var departurePage = {
|
|||
me.arrowsColour[0][5] = "yel";
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -508,11 +507,10 @@ var departurePage = {
|
|||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
me.scrollRight();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (size(me.sids) >= (index - 1)) {
|
||||
|
@ -538,11 +536,10 @@ var departurePage = {
|
|||
me.updateActiveTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -553,8 +550,7 @@ var departurePage = {
|
|||
me.updateActiveTransitions();
|
||||
me.updateTransitions();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} elsif (size(me.transitions) >= (index - 1)) {
|
||||
if (!dirToFlag) {
|
||||
|
@ -565,11 +561,10 @@ var departurePage = {
|
|||
me.updateTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
},
|
||||
};
|
|
@ -157,7 +157,7 @@ var dirTo = {
|
|||
var lonDecimal = mcdu.stringToDegrees(lon, "lon");
|
||||
|
||||
if (latDecimal > 90 or latDecimal < -90 or lonDecimal > 180 or lonDecimal < -180) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
|
||||
var myWpLatLon = createWP(latDecimal, lonDecimal, "LL" ~ 01);
|
||||
|
@ -230,10 +230,9 @@ var dirTo = {
|
|||
}
|
||||
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
},
|
||||
leftFieldBtn: func(index) {
|
||||
me.makeTmpy();
|
||||
|
@ -254,24 +253,22 @@ var dirTo = {
|
|||
if (fmgc.flightPlanController.temporaryFlag[me.computer] and dirToFlag) {
|
||||
dirToFlag = 0;
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
},
|
||||
fieldR6: func() {
|
||||
if (fmgc.flightPlanController.temporaryFlag[me.computer] and dirToFlag) {
|
||||
dirToFlag = 0;
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
|
||||
},
|
||||
updateDist: func(dist) {
|
||||
me.R1 = ["---- " ~ sprintf("%.0f", dist) ~ " ", "UTC DIST ", "wht"];
|
||||
|
|
|
@ -188,10 +188,10 @@ var staticText = {
|
|||
return [nil, nil, "ack"];
|
||||
},
|
||||
pushButtonLeft: func() {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
},
|
||||
pushButtonRight: func() {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -406,26 +406,24 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
}
|
||||
} else {
|
||||
if (size(me.outputList) >= index) {
|
||||
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
|
||||
var returny = fmgc.flightPlanController.scratchpad(getprop("MCDU[" ~ me.computer ~ "]/scratchpad"), (index - 1 + me.scroll), me.computer);
|
||||
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) > 0) {
|
||||
var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, (index - 1 + me.scroll), me.computer);
|
||||
if (returny == 3) {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
} elsif (returny == 0) {
|
||||
notInDataBase(me.computer);
|
||||
mcdu_message(me.computer, "NOT IN DATA BASE");
|
||||
} elsif (returny == 1) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} elsif (returny == 4) {
|
||||
databaseFull(me.computer);
|
||||
mcdu_message(me.computer, "LIST OF 20 IN USE");
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
}
|
||||
} else {
|
||||
me.outputList[index - 1].pushButtonLeft();
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -440,42 +438,22 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (size(me.outputList) >= index) {
|
||||
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
|
||||
notAllowed(me.computer);
|
||||
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) > 0) {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} else {
|
||||
me.outputList[index - 1].pushButtonRight();
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var notInDataBase = func(i) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
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");
|
||||
}
|
||||
|
||||
var databaseFull = func(i) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "LIST OF 20 IN USE");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "LIST OF 20 IN USE");
|
||||
}
|
||||
|
||||
var decimalToShortString = func(dms, type) {
|
||||
var degrees = split(".", sprintf(dms))[0];
|
||||
if (type == "lat") {
|
||||
|
|
|
@ -29,14 +29,13 @@ var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
|
|||
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
||||
|
||||
var fuelPredInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/rte-rsv", 0.05 * num(getprop("/FMGC/internal/trip-fuel")));
|
||||
setprop("/FMGC/internal/rte-percent", 5.0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (getprop("/FMGC/internal/trip-fuel") != 0) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -46,7 +45,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/rte-rsv", num(perc) / 100 * num(getprop("/FMGC/internal/trip-fuel")));
|
||||
setprop("/FMGC/internal/rte-percent", perc);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
|
||||
setprop("/FMGC/internal/rte-rsv", scratchpad);
|
||||
|
@ -56,12 +55,12 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/rte-percent", 15.0); # need reasearch on this value
|
||||
}
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and getprop("/FMGC/internal/alt-set")) {
|
||||
if (scratchpad == "CLR") {
|
||||
|
@ -69,8 +68,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -79,12 +77,12 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L5" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
|
@ -93,8 +91,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/final-fuel-set", 0);
|
||||
setprop("/FMGC/internal/final-time-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -102,9 +99,9 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/final-fuel", tf);
|
||||
setprop("/FMGC/internal/final-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
var tf = num(scratchpad);
|
||||
|
@ -113,9 +110,9 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/final-time", scratchpad);
|
||||
setprop("/FMGC/internal/final-time-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
|
@ -123,8 +120,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/min-dest-fob", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -132,20 +128,26 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/min-dest-fob", tf);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (num(getprop("/FMGC/internal/min-dest-fob")) < num(getprop("/FMGC/internal/final-fuel") + getprop("/FMGC/internal/alt-fuel"))) {
|
||||
genericMessage(i, "CHECK MIN DEST FOB", "wht");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R3" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
if (!getprop("/FMGC/internal/cost-index-set")) {
|
||||
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
|
||||
}
|
||||
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
|
||||
|
@ -193,9 +195,9 @@ var fuelPredInput = func(key, i) {
|
|||
}
|
||||
}
|
||||
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
|
@ -210,31 +212,30 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/fffq-sensor", "FF+FQ");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find("/", scratchpad) == 0) {
|
||||
var sensor = substr(scratchpad, 1);
|
||||
if (sensor == "FF+FQ" or sensor == "FQ+FF" or sensor == "FF" or sensor == "FQ") {
|
||||
setprop("FMGC/internal/fffq-sensor", sensor);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var initInputA = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/alt-airport", "");
|
||||
|
@ -13,53 +13,54 @@ var initInputA = func(key, i) {
|
|||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateARPT();
|
||||
#} else if (scratchpad == "") {
|
||||
#setprop("/FMGC/internal/alt-selected", 1);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else if (getprop("/FMGC/internal/tofrom-set") == 1) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4) {
|
||||
setprop("/FMGC/internal/alt-airport", scratchpad);
|
||||
setprop("/FMGC/internal/alt-set", 1);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4) {
|
||||
setprop("/FMGC/internal/alt-airport", scratchpad);
|
||||
setprop("/FMGC/internal/alt-set", 1);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateARPT();
|
||||
#setprop("/FMGC/internal/alt-selected", 1);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
fmgc.updateARPT();
|
||||
#setprop("/FMGC/internal/alt-selected", 1);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "TMPY F-PLN EXISTS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var flts = size(scratchpad);
|
||||
if (flts >= 1 and flts <= 8) {
|
||||
setprop("MCDUC/flight-num", scratchpad);
|
||||
setprop("MCDUC/flight-num-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
|
@ -67,12 +68,12 @@ var initInputA = func(key, i) {
|
|||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
|
@ -86,8 +87,7 @@ var initInputA = func(key, i) {
|
|||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find("/", scratchpad) != -1) {
|
||||
var crztemp = split("/", scratchpad);
|
||||
if (find("FL", crztemp[0]) != -1) {
|
||||
|
@ -106,9 +106,9 @@ var initInputA = func(key, i) {
|
|||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (crzs >= 1 and crzs <= 3 and crz != nil and temps >= 1 and temps <= 3 and temp != nil) {
|
||||
if (crz > 0 and crz <= 390 and temp >= -99 and temp <= 99) {
|
||||
|
@ -122,12 +122,12 @@ var initInputA = func(key, i) {
|
|||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (find("FL", scratchpad) != -1) {
|
||||
|
@ -147,12 +147,12 @@ var initInputA = func(key, i) {
|
|||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
|
@ -170,51 +170,54 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
fmgc.flightPlanController.reset(2);
|
||||
fmgc.flightPlanController.init();
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
#} else if (scratchpad == "") {
|
||||
#setprop("/FMGC/internal/alt-selected", 0);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9 and find("/", scratchpad) != -1) {
|
||||
var fromto = split("/", scratchpad);
|
||||
var froms = size(fromto[0]);
|
||||
var tos = size(fromto[1]);
|
||||
if (froms == 4 and tos == 4) {
|
||||
#route
|
||||
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
||||
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("/FMGC/internal/tofrom-set", 1);
|
||||
#scratchpad
|
||||
mcdu.clearScratchpad(i);
|
||||
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
||||
setprop("/FMGC/internal/alt-selected", 0);
|
||||
#ref lat
|
||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "N" : "S";
|
||||
setprop("/FMGC/internal/align-ref-lat-degrees", degrees);
|
||||
setprop("/FMGC/internal/align-ref-lat-minutes", minutes);
|
||||
setprop("/FMGC/internal/align-ref-lat-sign", sign);
|
||||
#ref long
|
||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lon");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "E" : "W";
|
||||
setprop("/FMGC/internal/align-ref-long-degrees", degrees);
|
||||
setprop("/FMGC/internal/align-ref-long-minutes", minutes);
|
||||
setprop("/FMGC/internal/align-ref-long-sign", sign);
|
||||
#ref edit
|
||||
setprop("/FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("/FMGC/internal/align-ref-long-edit", 0);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9 and find("/", scratchpad) != -1) {
|
||||
var fromto = split("/", scratchpad);
|
||||
var froms = size(fromto[0]);
|
||||
var tos = size(fromto[1]);
|
||||
if (froms == 4 and tos == 4) {
|
||||
#route
|
||||
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
||||
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("/FMGC/internal/tofrom-set", 1);
|
||||
#scratchpad
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
||||
setprop("/FMGC/internal/alt-selected", 0);
|
||||
#ref lat
|
||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "N" : "S";
|
||||
setprop("/FMGC/internal/align-ref-lat-degrees", degrees);
|
||||
setprop("/FMGC/internal/align-ref-lat-minutes", minutes);
|
||||
setprop("/FMGC/internal/align-ref-lat-sign", sign);
|
||||
#ref long
|
||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lon");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "E" : "W";
|
||||
setprop("/FMGC/internal/align-ref-long-degrees", degrees);
|
||||
setprop("/FMGC/internal/align-ref-long-minutes", minutes);
|
||||
setprop("/FMGC/internal/align-ref-long-sign", sign);
|
||||
#ref edit
|
||||
setprop("/FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("/FMGC/internal/align-ref-long-edit", 0);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "TMPY F-PLN EXISTS");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
|
@ -223,29 +226,27 @@ var initInputA = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/tropo", 36090);
|
||||
setprop("/FMGC/internal/tropo-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tropo = size(scratchpad);
|
||||
if (tropo == 5 and scratchpad <= 99990) {
|
||||
setprop("FMGC/internal/tropo-set", 1);
|
||||
setprop("FMGC/internal/tropo", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/gndtemp-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and getprop("/FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||
setprop("/FMGC/internal/gndtemp", scratchpad);
|
||||
setprop("/FMGC/internal/gndtemp-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var initInputB = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/taxi-fuel", 0.4);
|
||||
|
@ -13,8 +13,7 @@ var initInputB = func(key, i) {
|
|||
} else if (getprop("/FMGC/internal/fuel-request-set")) {
|
||||
setprop("/FMGC/internal/block-calculating", 1);
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 4) {
|
||||
|
@ -22,13 +21,13 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/taxi-fuel", scratchpad);
|
||||
setprop("/FMGC/internal/taxi-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateFuel();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
|
@ -38,8 +37,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/rte-percent", 5.0);
|
||||
setprop("/FMGC/internal/rte-percent-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (getprop("/FMGC/internal/trip-fuel") != 0) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -51,7 +49,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/rte-percent", perc);
|
||||
setprop("/FMGC/internal/rte-percent-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
|
||||
setprop("/FMGC/internal/rte-rsv", scratchpad);
|
||||
|
@ -63,12 +61,12 @@ var initInputB = func(key, i) {
|
|||
}
|
||||
setprop("/FMGC/internal/rte-percent-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and getprop("/FMGC/internal/alt-set")) {
|
||||
if (scratchpad == "CLR") {
|
||||
|
@ -76,8 +74,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -86,12 +83,12 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L5" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
|
@ -100,8 +97,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/final-fuel-set", 0);
|
||||
setprop("/FMGC/internal/final-time-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -109,9 +105,9 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/final-fuel", tf);
|
||||
setprop("/FMGC/internal/final-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
var tf = num(scratchpad);
|
||||
|
@ -120,9 +116,9 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/final-time", scratchpad);
|
||||
setprop("/FMGC/internal/final-time-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
|
@ -130,8 +126,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/min-dest-fob", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -139,20 +134,26 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/min-dest-fob", tf);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (num(getprop("/FMGC/internal/min-dest-fob")) < num(getprop("/FMGC/internal/final-fuel") + getprop("/FMGC/internal/alt-fuel"))) {
|
||||
genericMessage(i, "CHECK MIN DEST FOB", "wht");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R1" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
if (!getprop("/FMGC/internal/cost-index-set")) {
|
||||
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
|
||||
}
|
||||
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
|
||||
|
@ -197,21 +198,21 @@ var initInputB = func(key, i) {
|
|||
}
|
||||
}
|
||||
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("/FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
|
@ -246,8 +247,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
var maxblock = getprop("/options/maxblock");
|
||||
|
@ -274,12 +274,12 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
|
@ -290,7 +290,7 @@ var initInputB = func(key, i) {
|
|||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R5" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
|
@ -299,8 +299,7 @@ var initInputB = func(key, i) {
|
|||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
if (find("TL", scratchpad) != -1 or find("HD", scratchpad) != -1) {
|
||||
var effwind = substr(scratchpad, 2);
|
||||
|
@ -310,9 +309,9 @@ var initInputB = func(key, i) {
|
|||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (find("-", scratchpad) != -1 or find("+", scratchpad) != -1 or find("T", scratchpad) != -1 or find("H", scratchpad) != -1) {
|
||||
var effwind = substr(scratchpad, 1);
|
||||
|
@ -322,9 +321,9 @@ var initInputB = func(key, i) {
|
|||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 500) {
|
||||
|
@ -333,13 +332,13 @@ var initInputB = func(key, i) {
|
|||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ var initInputIRS = func(key, i) {
|
|||
setprop("FMGC/internal/align-ref-long-minutes", getprop("FMGC/internal/align-ref-long-minutes") + 0.1);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "down") {
|
||||
if (getprop("FMGC/internal/align-ref-lat-edit")) {
|
||||
|
@ -59,14 +59,14 @@ var initInputIRS = func(key, i) {
|
|||
setprop("FMGC/internal/align-ref-long-minutes", getprop("FMGC/internal/align-ref-long-minutes") - 0.1);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L1") {
|
||||
if (getprop("FMGC/internal/tofrom-set")) {
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 1);
|
||||
setprop("FMGC/internal/align-ref-long-edit", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
|
@ -77,7 +77,7 @@ var initInputIRS = func(key, i) {
|
|||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("FMGC/internal/align-ref-long-edit", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
|
@ -91,27 +91,11 @@ var initInputIRS = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
}
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "SELECT REFERENCE") {
|
||||
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", "SELECT REFERENCE");
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE");
|
||||
} else if (getprop("systems/navigation/adr/any-adr-on") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "IRS NOT ALIGNED") {
|
||||
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", "IRS NOT ALIGNED");
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,8 +120,7 @@ var latRev = {
|
|||
if (!dirToFlag) {
|
||||
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
me._checkTmpy();
|
||||
}
|
||||
|
@ -129,14 +128,13 @@ var latRev = {
|
|||
nextWpt: func() {
|
||||
me.makeTmpy();
|
||||
|
||||
var returny = fmgc.flightPlanController.scratchpad(getprop("/MCDU[" ~ me.computer ~ "]/scratchpad"), me.index + 1, me.computer);
|
||||
var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, me.index + 1, me.computer);
|
||||
if (returny == 0) {
|
||||
notInDataBase(me.computer);
|
||||
} elsif (returny == 1) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||
setprop("/MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
if (getprop("/MCDU[" ~ me.computer ~ "]/page") != "DUPLICATENAMES") {
|
||||
setprop("/MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
|
||||
|
|
|
@ -5,21 +5,15 @@
|
|||
|
||||
var scratchpadNode = [nil, nil];
|
||||
var MCDU_init = func(i) {
|
||||
scratchpadNode = [props.globals.initNode("/MCDU[0]/scratchpad", "", "STRING"), props.globals.initNode("/MCDU[1]/scratchpad", "", "STRING")];
|
||||
MCDU_reset(i); # Reset MCDU, clears data
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
MCDU_reset(i);
|
||||
}
|
||||
|
||||
var MCDU_reset = func(i) {
|
||||
setprop("/MCDU[" ~ i ~ "]/active", 0);
|
||||
setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/last-page", "NONE");
|
||||
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
mcdu.clearScratchpad(i);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
|
||||
setprop("/FMGC/keyboard-left", 0);
|
||||
setprop("/FMGC/keyboard-right", 0);
|
||||
|
@ -65,6 +59,7 @@ var MCDU_reset = func(i) {
|
|||
setprop("/FMGC/internal/alt-set", 0);
|
||||
setprop("/FMGC/internal/cost-index", "0");
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("/FMGC/internal/last-cost-index", 0);
|
||||
setprop("/FMGC/internal/cruise-ft", 10000);
|
||||
setprop("/FMGC/internal/cruise-fl", 100);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
||||
|
@ -197,19 +192,16 @@ var lskbutton = func(btn, i) {
|
|||
if (btn == "1") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/active") != 2) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
|
||||
mcdu_message(i, "WAIT FOR SYSTEM RESPONSE");
|
||||
setprop("/MCDU[" ~ i ~ "]/active", 1);
|
||||
settimer(func(){
|
||||
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
|
||||
mcdu.clearScratchpad(i);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
setprop("/MCDU[" ~ i ~ "]/active", 2);
|
||||
}, 2);
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
|
||||
mcdu.clearScratchpad(i);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
|
||||
initInputIRS("L1",i);
|
||||
|
@ -244,16 +236,16 @@ var lskbutton = func(btn, i) {
|
|||
canvas_mcdu.myDeparture[i] = departurePage.new(canvas_mcdu.myLatRev[i].title[2], i);
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "DEPARTURE");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
canvas_mcdu.myFpln[i].pushButtonLeft(1);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||
canvas_mcdu.myDirTo[i].fieldL1(getprop("/MCDU[" ~ i ~ "]/scratchpad"));
|
||||
canvas_mcdu.myDirTo[i].fieldL1(mcdu_scratchpad.scratchpads[i].scratchpad);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||
canvas_mcdu.myDuplicate[i].pushButtonLeft(1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "2") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
|
@ -287,7 +279,7 @@ var lskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||
canvas_mcdu.myDuplicate[i].pushButtonLeft(2);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "3") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
|
@ -325,12 +317,12 @@ var lskbutton = func(btn, i) {
|
|||
canvas_mcdu.myHold[i] = holdPage.new(i, canvas_mcdu.myLatRev[i].wpt);
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "HOLD");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||
canvas_mcdu.myDuplicate[i].pushButtonLeft(3);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "4") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||
|
@ -358,7 +350,7 @@ var lskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||
canvas_mcdu.myDuplicate[i].pushButtonLeft(4);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "5") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
|
@ -398,10 +390,10 @@ var lskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||
canvas_mcdu.myDuplicate[i].pushButtonLeft(5);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") {
|
||||
canvas_mcdu.myClosestAirport[i].manAirportCall(getprop("/MCDU[" ~ i ~ "]/scratchpad"));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
canvas_mcdu.myClosestAirport[i].manAirportCall(mcdu_scratchpad.scratchpads[i].scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "6") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
|
@ -441,7 +433,7 @@ var lskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") {
|
||||
canvas_mcdu.myClosestAirport[i].freeze();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -470,7 +462,7 @@ var rskbutton = func(btn, i) {
|
|||
canvas_mcdu.myArrival[i]._setupPageWithData();
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "ARRIVAL");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
canvas_mcdu.myFpln[i].pushButtonRight(1);
|
||||
|
@ -483,10 +475,10 @@ var rskbutton = func(btn, i) {
|
|||
canvas_mcdu.myPilotWP[i] = pilotWaypointPage.new(i);
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "PILOTWP");
|
||||
} else {
|
||||
notAllowed(i); # todo spawn new waypoints page
|
||||
mcdu_message(i, "NOT ALLOWED"); # todo spawn new waypoints page
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "2") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
|
@ -506,7 +498,7 @@ var rskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
canvas_mcdu.myFpln[i].pushButtonRight(2);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "3") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
|
@ -531,12 +523,12 @@ var rskbutton = func(btn, i) {
|
|||
if (canvas_mcdu.myLatRev[i].type != 2) {
|
||||
canvas_mcdu.myLatRev[i].nextWpt();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
canvas_mcdu.myFpln[i].pushButtonRight(3);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "4") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
|
@ -556,7 +548,7 @@ var rskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
canvas_mcdu.myFpln[i].pushButtonRight(4);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "5") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
|
@ -590,19 +582,18 @@ var rskbutton = func(btn, i) {
|
|||
canvas_mcdu.myAirways[i] = airwaysPage.new(i, canvas_mcdu.myLatRev[i].wpt);
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "AIRWAYS");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (btn == "6") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/last-page") != "NONE") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-page"));
|
||||
mcdu.clearScratchpad(i);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R6",i);
|
||||
|
@ -619,15 +610,7 @@ var rskbutton = func(btn, i) {
|
|||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
|
||||
perfAPPRInput("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) {
|
||||
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", "AOC DISABLED");
|
||||
mcdu_message(i, "AOC DISABLED");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R6",i);
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||
|
@ -647,7 +630,7 @@ var rskbutton = func(btn, i) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -769,7 +752,7 @@ var pagebutton = func(btn, i) {
|
|||
} else if (btn == "mcdu") {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-page", getprop("/MCDU[" ~ i ~ "]/page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
mcdu_message(i, "SELECT DESIRED SYSTEM");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
} else if (btn == "f-pln" or btn == "airport") {
|
||||
if (canvas_mcdu.myFpln[i] == nil) {
|
||||
|
@ -785,6 +768,8 @@ var pagebutton = func(btn, i) {
|
|||
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[2];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
canvas_mcdu.myFpln[i].scroll = 0;
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
|
||||
|
||||
|
@ -792,8 +777,7 @@ var pagebutton = func(btn, i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
} else if (btn == "dirto") {
|
||||
if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "INSRT / ERASE TMPY FIRST");
|
||||
mcdu_message(i, "INSERT/ERASE TMPY FIRST");
|
||||
return;
|
||||
} elsif (canvas_mcdu.myDirTo[i] == nil) {
|
||||
canvas_mcdu.myDirTo[i] = dirTo.new(i);
|
||||
|
@ -804,94 +788,32 @@ var pagebutton = func(btn, i) {
|
|||
}
|
||||
|
||||
var button = func(btn, i) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 0 and getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") {
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (btn == "SLASH") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "/");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].addChar("/");
|
||||
} else if (btn == "SP") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ " ");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].addChar(" ");
|
||||
} else if (btn == "CLR") {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (size(scratchpad) == 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "CLR");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
mcdu.clearScratchpad(i);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (size(scratchpad) > 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", left(scratchpad, size(scratchpad) - 1));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].addChar("CLR");
|
||||
} else {
|
||||
mcdu_scratchpad.scratchpads[i].clear();
|
||||
}
|
||||
} else if (btn == "DOT") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ ".");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].addChar(".");
|
||||
} else if (btn == "PLUSMINUS") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "-");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu_scratchpad.scratchpads[i].addChar("-");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ btn);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
} else {
|
||||
if (btn == "CLR") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (size(scratchpad) == 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "CLR");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", getprop("/MCDU[" ~ i ~ "]/last-scratchpad"));
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].addChar(btn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var genericMessage = func(i, text, color) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad") != text) {
|
||||
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-color", color);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", text);
|
||||
}
|
||||
|
||||
var notAllowed = func(i) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad") != "NOT ALLOWED") {
|
||||
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", "NOT ALLOWED");
|
||||
}
|
||||
|
||||
var formatError = func(i) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
|
||||
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 clearScratchpad = func(i) {
|
||||
scratchpadNode[i].setValue("");
|
||||
var mcdu_message = func(i, string, overrideStr = "") {
|
||||
mcdu_scratchpad.scratchpads[i].showTypeI(mcdu_scratchpad.MessageController.getTypeIMsgByText(string));
|
||||
mcdu_scratchpad.scratchpads[i].override(overrideStr);
|
||||
}
|
||||
|
||||
var screenFlash = func(time, i) {
|
||||
|
|
|
@ -5,37 +5,34 @@ var ldg_config_3_set = props.globals.getNode("/FMGC/internal/ldg-config-3-set",
|
|||
var ldg_config_f_set = props.globals.getNode("/FMGC/internal/ldg-config-f-set", 1);
|
||||
|
||||
var perfAPPRInput = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/dest-qnh", -1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (num(scratchpad) != nil and (scratchpad >= 28.06 and scratchpad <= 31.01) or (scratchpad >= 745 and scratchpad <= 1050)) {
|
||||
# doesn't support accidental temp input yet
|
||||
setprop("/FMGC/internal/dest-qnh", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/dest-temp", -999);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (num(scratchpad) != nil and scratchpad >= -99 and scratchpad < 99) {
|
||||
setprop("/FMGC/internal/dest-temp", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
var tfs = size(scratchpad);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/dest-mag", -1);
|
||||
setprop("/FMGC/internal/dest-wind", -1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (tfs >= 3 and tfs <= 7 and find("/", scratchpad) != -1) {
|
||||
var weather = split("/", scratchpad);
|
||||
var mag = int(weather[0]);
|
||||
|
@ -46,96 +43,92 @@ var perfAPPRInput = func(key, i) {
|
|||
if (mag != nil and wind != nil and mag >= 0 and mag <= 360 and wind >= 0 and wind <= 200) {
|
||||
setprop("/FMGC/internal/dest-mag", weather[0]);
|
||||
setprop("/FMGC/internal/dest-wind", weather[1]);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateARPT();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.transAlt = 18000;
|
||||
fmgc.FMGCInternal.transAltSet = 0;
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and (tfs == 4 or tfs == 5) and scratchpad >= 1000 and scratchpad <= 39000) {
|
||||
fmgc.FMGCInternal.transAlt = math.round(scratchpad, 500);
|
||||
fmgc.FMGCInternal.transAltSet = 1;
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} elsif (int(scratchpad) != nil and (tfs == 2 or tfs == 3) and scratchpad >= 10 and scratchpad <= 390) {
|
||||
fmgc.FMGCInternal.transAlt = math.round(scratchpad * 100, 5);
|
||||
fmgc.FMGCInternal.transAltSet = 1;
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vapp-speed-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("/FMGC/internal/vapp-speed-set", 1);
|
||||
setprop("/FMGC/internal/computed-speeds/vapp_appr", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "PERFDES");
|
||||
} else if (key == "R2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/baro", 99999);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and scratchpad >= getprop("/FMGC/internal/ldg-elev") and scratchpad <= 5000 + getprop("/FMGC/internal/ldg-elev")) {
|
||||
if (getprop("/FMGC/internal/radio-no") == 0) {
|
||||
setprop("/FMGC/internal/radio", 99999);
|
||||
}
|
||||
setprop("/FMGC/internal/baro", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/radio", 99999);
|
||||
setprop("/FMGC/internal/radio-no", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (scratchpad == "NO") {
|
||||
setprop("/FMGC/internal/radio", 99999);
|
||||
setprop("/FMGC/internal/radio-no", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 700) {
|
||||
setprop("/FMGC/internal/baro", 99999);
|
||||
setprop("/FMGC/internal/radio-no", 0);
|
||||
setprop("/FMGC/internal/radio", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "" and ldg_config_f_set.getValue() == 1 and ldg_config_3_set.getValue() == 0) {
|
||||
setprop("/FMGC/internal/ldg-config-3-set", 1);
|
||||
setprop("/FMGC/internal/ldg-config-f-set", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "" and ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) {
|
||||
setprop("/FMGC/internal/ldg-config-3-set", 0);
|
||||
setprop("/FMGC/internal/ldg-config-f-set", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "PERFGA");
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfCLBInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
|
@ -17,20 +16,19 @@ var perfCLBInput = func(key, i) {
|
|||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (getprop("/FMGC/status/phase") == 2) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFTO");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
if (getprop("/FMGC/status/phase") == 2) {
|
||||
|
@ -41,7 +39,7 @@ var perfCLBInput = func(key, i) {
|
|||
setprop("/FMGC/internal/decel", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/FMGC/internal/activate-once", 1);
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfCRZInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
|
@ -17,12 +16,12 @@ var perfCRZInput = func(key, i) {
|
|||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
|
@ -34,7 +33,7 @@ var perfCRZInput = func(key, i) {
|
|||
setprop("/FMGC/internal/decel", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/FMGC/internal/activate-once", 1);
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfDESInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
|
@ -17,12 +16,12 @@ var perfDESInput = func(key, i) {
|
|||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
|
@ -34,7 +33,7 @@ var perfDESInput = func(key, i) {
|
|||
setprop("/FMGC/internal/decel", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/FMGC/internal/activate-once", 1);
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
# uses universal values, will implement separately once FPLN is finished
|
||||
|
||||
var perfGAInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("/FMGC/internal/accel-agl-ft", "1500");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 7 and tfs <= 9 and find("/", scratchpad) != -1) {
|
||||
|
@ -21,12 +20,12 @@ var perfGAInput = func(key, i) {
|
|||
setprop("systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("/FMGC/internal/accel-agl-ft", thracc[1]);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
|
@ -35,16 +34,15 @@ var perfGAInput = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and tfs >= 3 and tfs <= 5) {
|
||||
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,55 +4,52 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfTOInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (getprop("/FMGC/status/phase") != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/v1", 0);
|
||||
setprop("/FMGC/internal/v1-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("/FMGC/internal/v1", scratchpad);
|
||||
setprop("/FMGC/internal/v1-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (getprop("/FMGC/status/phase") != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vr", 0);
|
||||
setprop("/FMGC/internal/vr-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("/FMGC/internal/vr", scratchpad);
|
||||
setprop("/FMGC/internal/vr-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (getprop("/FMGC/status/phase") != 1) {
|
||||
|
@ -60,8 +57,7 @@ var perfTOInput = func(key, i) {
|
|||
setprop("/FMGC/internal/v2", 0);
|
||||
setprop("/FMGC/internal/v2-set", 0);
|
||||
setprop("it-autoflight/settings/togaspd", 157);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
|
@ -69,31 +65,30 @@ var perfTOInput = func(key, i) {
|
|||
setprop("/FMGC/internal/v2", scratchpad);
|
||||
setprop("/FMGC/internal/v2-set", 1);
|
||||
setprop("it-autoflight/settings/togaspd", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.transAlt = 18000;
|
||||
fmgc.FMGCInternal.transAltSet = 0;
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and (tfs == 4 or tfs <= 5) and scratchpad >= 1000 and scratchpad <= 39000) {
|
||||
fmgc.FMGCInternal.transAlt = int(scratchpad / 10) * 10;
|
||||
fmgc.FMGCInternal.transAltSet = 1;
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
|
@ -101,8 +96,7 @@ var perfTOInput = func(key, i) {
|
|||
setprop("systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("/FMGC/internal/accel-agl-ft", "1500");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (find("/", scratchpad) != -1) {
|
||||
|
@ -115,18 +109,18 @@ var perfTOInput = func(key, i) {
|
|||
setprop("systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
|
||||
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (thrreds == 0 and int(acc) != nil and (accs >= 3 and accs <= 5) and acc >= 400 and acc <= 39000) {
|
||||
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (num(scratchpad) != nil and (tfs >= 3 and tfs <= 5) and scratchpad >= 400 and scratchpad <= 39000) {
|
||||
setprop("systems/thrust/clbreduc-ft", int(scratchpad / 10) * 10);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
|
@ -134,8 +128,7 @@ var perfTOInput = func(key, i) {
|
|||
setprop("/FMGC/internal/to-flap", 0);
|
||||
setprop("/FMGC/internal/to-ths", "0.0");
|
||||
setprop("/FMGC/internal/flap-ths-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
if (find("/", scratchpad) != -1) {
|
||||
var flapths = split("/", scratchpad);
|
||||
|
@ -150,62 +143,61 @@ var perfTOInput = func(key, i) {
|
|||
if (flaps == 0 and getprop("/FMGC/internal/flap-ths-set")) {
|
||||
if (trims == 5 and find("DN", trim) != -1 and validtrima) {
|
||||
setprop("/FMGC/internal/to-ths", -1 * trima);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("DN", trim) != -1 and validtrimb) {
|
||||
setprop("/FMGC/internal/to-ths", -1 * trimb);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrima) {
|
||||
setprop("/FMGC/internal/to-ths", trima);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrimb) {
|
||||
setprop("/FMGC/internal/to-ths", trimb);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (flaps == 1 and num(flap) != nil and flap >= 0 and flap <= 3) {
|
||||
if (trims == 5 and find("DN", trim) != -1 and validtrima) {
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", -1 * trima);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("DN", trim) != -1 and validtrimb) {
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", -1 * trimb);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrima) {
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", trima);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrimb) {
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", trimb);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (size(scratchpad) == 1 and num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 3) {
|
||||
setprop("/FMGC/internal/to-flap", scratchpad);
|
||||
if (!getprop("/FMGC/internal/flap-ths-set")) {
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
}
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/flex", 0);
|
||||
setprop("/FMGC/internal/flex-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 1 or tfs == 2) {
|
||||
|
@ -214,28 +206,27 @@ var perfTOInput = func(key, i) {
|
|||
setprop("/FMGC/internal/flex-set", 1);
|
||||
var flex_calc = getprop("/FMGC/internal/flex") - getprop("environment/temperature-degc");
|
||||
setprop("/FMGC/internal/flex-cmd", flex_calc);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and (tfs == 4 or tfs == 5) and scratchpad >= 1000 and scratchpad <= 39000) {
|
||||
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var progCLBInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
|
@ -11,13 +11,12 @@ var progCLBInput = func(key, i) {
|
|||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (getprop("/FMGC/status/phase") == 5) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
|
@ -25,10 +24,10 @@ var progCLBInput = func(key, i) {
|
|||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var progCRZInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
|
@ -11,13 +11,12 @@ var progCRZInput = func(key, i) {
|
|||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (getprop("/FMGC/status/phase") == 5) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
|
@ -25,10 +24,10 @@ var progCRZInput = func(key, i) {
|
|||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var progDESInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
|
@ -11,13 +11,12 @@ var progDESInput = func(key, i) {
|
|||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (getprop("/FMGC/status/phase") == 4 or getprop("/FMGC/status/phase") == 5 or getprop("/FMGC/status/phase") == 6) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
|
@ -25,10 +24,10 @@ var progDESInput = func(key, i) {
|
|||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,22 +3,21 @@
|
|||
var altSet = props.globals.getNode("it-autoflight/input/alt", 1);
|
||||
|
||||
var progTOInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100 and getprop("/FMGC/internal/cruise-lvl-set")) {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
|
||||
var radnavInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -17,47 +16,45 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
|
||||
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
|
||||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor1freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
|
||||
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor1freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor1crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad);
|
||||
setprop("/FMGC/internal/vor1crs-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/ils1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -68,63 +65,60 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/ils1freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) {
|
||||
genericMessage(i, "RWY/LS MISMATCH", "amb");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/ils1crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad);
|
||||
setprop("/FMGC/internal/ils1crs-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/adf1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 4) {
|
||||
if (scratchpad >= 190 and scratchpad <= 1750) {
|
||||
setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad);
|
||||
setprop("/FMGC/internal/adf1freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor2freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -133,59 +127,57 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
|
||||
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
|
||||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor2freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
|
||||
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor2freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor2crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad);
|
||||
setprop("/FMGC/internal/vor2crs-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/adf2freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 4) {
|
||||
if (scratchpad >= 190 and scratchpad <= 1750) {
|
||||
setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad);
|
||||
setprop("/FMGC/internal/adf2freq-set", 1);
|
||||
mcdu.clearScratchpad(i);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,8 +118,7 @@ var vertRev = {
|
|||
if (!dirToFlag) {
|
||||
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
me._checkTmpy();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,9 @@ var default = [
|
|||
"/controls/gear/brake-parking",
|
||||
# electrics
|
||||
"/systems/electrical/sources/bat-1/percent-calc",
|
||||
"/systems/electrical/sources/bat-2/percent-calc"
|
||||
"/systems/electrical/sources/bat-2/percent-calc",
|
||||
# FMGC
|
||||
"/FMGC/internal/last-cost-index",
|
||||
];
|
||||
|
||||
var save = func (saved_props, file) {
|
||||
|
|
Loading…
Reference in a new issue