1
0
Fork 0

findAirportsByICAO

This commit is contained in:
Jonathan Redpath 2022-02-15 23:37:44 +00:00
parent 7fe513d974
commit 45fd29792c

View file

@ -79,8 +79,8 @@ var initInputA = func(key, i) {
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else if (fmgc.FMGCInternal.toFromSet) {
if (!fmgc.flightPlanController.temporaryFlag[i]) {
var tfs = size(scratchpad);
if (tfs == 4) {
if (size(scratchpad) == 4) {
if (size(findAirportsByICAO(scratchpad)) > 0) {
fmgc.FMGCInternal.altAirport = scratchpad;
fmgc.FMGCInternal.altAirportSet = 1;
atsu.ATISInstances[2].newStation(scratchpad);
@ -93,6 +93,9 @@ var initInputA = func(key, i) {
}
mcdu_scratchpad.scratchpads[i].empty();
fmgc.updateARPT();
} else {
mcdu_message(i, "NOT IN DATA BASE");
}
#fmgc.FMGCInternal.altSelected = 1;
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
@ -249,12 +252,10 @@ var initInputA = func(key, i) {
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
if (!fmgc.flightPlanController.temporaryFlag[i]) {
var tfs = size(scratchpad);
if (tfs == 9 and find("/", scratchpad) != -1) {
if (size(scratchpad) == 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) {
if (size(fromto[0]) == 4 and size(fromto[1]) == 4) {
if (size(findAirportsByICAO(fromto[0])) > 0 and size(findAirportsByICAO(fromto[1])) > 0) {
resetFlightplan(i);
fmgc.FMGCInternal.depApt = fromto[0];
fmgc.FMGCInternal.arrApt = fromto[1];
@ -268,6 +269,9 @@ var initInputA = func(key, i) {
fmgc.FMGCInternal.altSelected = 0;
fmgc.updateARPT();
fmgc.updateArptLatLon();
} else {
mcdu_message(i, "NOT IN DATA BASE");
}
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
mcdu_message(i, "NOT ALLOWED");