Fix closest airports magVar; fix the database adding to first wp
This commit is contained in:
parent
eb37ea57fc
commit
82631ed689
4 changed files with 10 additions and 6 deletions
|
@ -33,6 +33,7 @@ var WaypointDatabase = {
|
|||
} elsif (me.waypointsVec[wpObj.index] == nil) {
|
||||
# add at passed index
|
||||
me.waypointsVec[wpObj.index] = wpObj;
|
||||
return 2;
|
||||
} else {
|
||||
# fall back to end
|
||||
logprint(4, "pilotWaypoint constructor claims index " ~ wpObj.index ~ " is nil, but it isn't!");
|
||||
|
|
|
@ -575,7 +575,7 @@ var flightPlanController = {
|
|||
}
|
||||
|
||||
var localMagvar = magvar(wpGhost.lat, wpGhost.lon);
|
||||
return me.insertPlaceBearingDistance(wpGhost, textSplit[1] + localMagvar, textSplit[2], index, plan);
|
||||
return me.insertPlaceBearingDistance(wpGhost, textSplit[1] + localMagvar, textSplit[2], index, plan); # magnetic to true? I don't know. But this works!
|
||||
},
|
||||
|
||||
|
||||
|
@ -592,6 +592,7 @@ var flightPlanController = {
|
|||
if (addDb != 2) {
|
||||
return addDb;
|
||||
}
|
||||
|
||||
me.flightplans[plan].insertWP(waypoint.wpGhost, index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
|
|
|
@ -87,12 +87,13 @@ var closestAirportPage = {
|
|||
me.cdVector[1] = courseAndDistance(me.airports[1]);
|
||||
me.cdVector[2] = courseAndDistance(me.airports[2]);
|
||||
me.cdVector[3] = courseAndDistance(me.airports[3]);
|
||||
me.C1 = [math.round(me.cdVector[0][0]) ~ " " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"];
|
||||
me.C2 = [math.round(me.cdVector[1][0]) ~ " " ~ math.round(me.cdVector[1][1]), nil, "grn"];
|
||||
me.C3 = [math.round(me.cdVector[2][0]) ~ " " ~ math.round(me.cdVector[2][1]), nil, "grn"];
|
||||
me.C4 = [math.round(me.cdVector[3][0]) ~ " " ~ math.round(me.cdVector[3][1]), nil, "grn"];
|
||||
var magvarLocal = magvar();
|
||||
me.C1 = [math.round(me.cdVector[0][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"];
|
||||
me.C2 = [math.round(me.cdVector[1][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[1][1]) , nil, "grn"];
|
||||
me.C3 = [math.round(me.cdVector[2][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[2][1]), nil, "grn"];
|
||||
me.C4 = [math.round(me.cdVector[3][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[3][1]), nil, "grn"];
|
||||
if (me.manAirport != nil) {
|
||||
me.C5 = [math.round(courseAndDistance(me.manAirport)[0]) ~ " " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"];
|
||||
me.C5 = [math.round(courseAndDistance(me.manAirport)[0] - magvarLocal) ~ " " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"];
|
||||
}
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
|
|
|
@ -390,6 +390,7 @@ var lskbutton = func(btn, i) {
|
|||
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", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue