1
0
Fork 0

Merge branch 'dev' into 3D

This commit is contained in:
Jonathan Redpath 2022-01-12 14:48:00 +00:00
commit f64600b541
12 changed files with 86 additions and 38 deletions

Binary file not shown.

View file

@ -1680,7 +1680,7 @@
</binding>
</action>
</animation>
<!--animation>
<animation>
<type>pick</type>
<object-name>overfly</object-name>
<action>
@ -1703,7 +1703,7 @@
</condition>
</binding>
</action>
</animation-->
</animation>
<animation>
<type>pick</type>
<object-name>clr</object-name>

View file

@ -1680,7 +1680,7 @@
</binding>
</action>
</animation>
<!--animation>
<animation>
<type>pick</type>
<object-name>overfly</object-name>
<action>
@ -1703,7 +1703,7 @@
</condition>
</binding>
</action>
</animation-->
</animation>
<animation>
<type>pick</type>
<object-name>clr</object-name>

View file

@ -2017,7 +2017,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -2065,7 +2065,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -2113,7 +2113,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -2161,7 +2161,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>

View file

@ -2017,7 +2017,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -2065,7 +2065,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -2113,7 +2113,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -2161,7 +2161,7 @@
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.012</character-size>
<character-size>0.008</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>

View file

@ -419,16 +419,11 @@ var ITAF = {
}
Internal.lnavAdvanceNm.setValue(FPLN.turnDist);
# Advance logic done by flightplan controller
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue()) {
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWpTemp).fly_type == "flyBy") {
flightPlanController.autoSequencing();
} elsif (FPLN.wp0Dist.getValue() <= 0.15) {
flightPlanController.autoSequencing();
}
#if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWpTemp).fly_type == "flyBy") {
# flightPlanController.autoSequencing();
#} elsif (FPLN.wp0Dist.getValue() <= 0.1) {
# flightPlanController.autoSequencing();
#}
}
}
},

View file

@ -245,6 +245,19 @@ var flightPlanController = {
}
},
# changeOverflyType - toggle flyby type of passed waypoint
# args: index, plan, computer
# index: index to toggle
# plan: plan on which operation is performed
# If the passed waypoint exists, toggle its flyover attribute
changeOverFlyType: func(index, plan) {
wp = me.flightplans[plan].getWP(index);
if (wp == nil or wp.wp_name == "DISCONTINUITY" or wp.wp_name == "VECTORS") { return 1; };
wp.fly_type = (wp.fly_type == "flyBy") ? "flyOver" : "flyBy";
return 2;
},
# for these two remember to call flightPlanChanged. We are assuming this is called from a function which will all flightPlanChanged itself.
# addDiscontinuity - insert discontinuity at passed index
@ -730,6 +743,8 @@ var flightPlanController = {
if (size(split("/", text)) == 3) {
return me.getWPforPBD(text, index, thePlan);
} elsif (text == "@") {
return me.changeOverFlyType(index, thePlan);
} elsif (text == "CLR") {
return me.deleteWP(index, thePlan, 0);
} elsif (size(text) > 12) {

View file

@ -20,9 +20,9 @@ var fplnItem = {
return ["MANUAL", me.getSubText(), me.colour];
} else {
if (size(wptName) == 2) {
return[wptName[0] ~ wptName[1], me.getSubText(), me.colour];
return[wptName[0] ~ wptName[1 ~ (me.wp.fly_type == "flyOver" ? "@" : "")], me.getSubText(), me.colour];
} else {
return [me.wp.wp_name, me.getSubText(), me.colour];
return [me.wp.wp_name ~ (me.wp.fly_type == "flyOver" ? "@" : ""), me.getSubText(), me.colour];
}
}
} else {
@ -99,8 +99,11 @@ var fplnItem = {
return sprintf("%03.0f", math.round(me.brg));
},
getTrack: func() {
var wp = fmgc.flightPlanController.flightplans[me.plan].getWP(me.index);
me.trk = fmgc.wpCoursePrev[me.plan][me.index].getValue() - magvar(wp.lat, wp.lon);
if (me.index > (size(fmgc.wpCoursePrev[me.plan]) - 1)) {
me.trk = me.wp.leg_bearing - magvar(me.wp.lat, me.wp.lon);
} else {
me.trk = fmgc.wpCoursePrev[me.plan][me.index].getValue() - magvar(me.wp.lat, me.wp.lon);
}
if (me.trk < 0) { me.trk += 360; }
if (me.trk > 360) { me.trk -= 360; }
return sprintf("%03.0f", math.round(me.trk));
@ -138,10 +141,14 @@ var fplnItem = {
}
},
getDist: func() {
if (me.index == fmgc.flightPlanController.currentToWptIndex.getValue()) {
return math.round(fmgc.wpDistance[me.plan][me.index].getValue());
if (me.index > size(fmgc.wpDistancePrev[me.plan]) - 1) {
return math.round(me.wp.leg_distance);
} else {
return math.round(fmgc.wpDistancePrev[me.plan][me.index].getValue());
if (me.index == fmgc.flightPlanController.currentToWptIndex.getValue()) {
return math.round(fmgc.wpDistance[me.plan][me.index].getValue());
} else {
return math.round(fmgc.wpDistancePrev[me.plan][me.index].getValue());
}
}
},
pushButtonLeft: func() {
@ -359,7 +366,25 @@ var fplnPage = { # this one is only created once, and then updated - remember th
}
}
append(me.planList, staticText.new(me.computer, me.getText("fplnEnd")));
append(me.planList, staticText.new(me.computer, me.getText("noAltnFpln")));
if (!fmgc.FMGCInternal.altAirportSet) {
append(me.planList, staticText.new(me.computer, me.getText("noAltnFpln")));
} else {
var altnApt = findAirportsByICAO(fmgc.FMGCInternal.altAirport)[0];
append(me.planList, fplnItem.new({
alt_cstr: nil,
alt_cstr_type: nil,
fly_type: "flyBy",
lat: altnApt.lat,
leg_bearing: courseAndDistance(findAirportsByICAO(fmgc.FMGCInternal.arrApt)[0], altnApt)[0],
leg_distance: courseAndDistance(findAirportsByICAO(fmgc.FMGCInternal.arrApt)[0], altnApt)[1],
lon: altnApt.lon,
speed_cstr: nil,
speed_cstr_type: nil,
wp_name: fmgc.FMGCInternal.altAirport,
}, i, me.planIndex, me.computer, "blu"));
append(me.planList, staticText.new(me.computer, me.getText("altnFplnEnd")));
}
me.basePage();
},
basePage: func() {

View file

@ -85,6 +85,8 @@ var latRev = {
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 0, 0]];
} elsif (me.type == 1) {
me.title = ["LAT REV", " FROM ", left(me.wpt.wp_name, 4)];
me.arrowsMatrix = [[0, 0, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "wht", "blu", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
if (size(me.wpt.wp_name) > 4) {
me.arrAirport = findAirportsByICAO(left(me.wpt.wp_name, 4));
} else {
@ -92,27 +94,36 @@ var latRev = {
}
me.subtitle = [dmsToString(sprintf(me.arrAirport[0].lat), "lat"), dmsToString(sprintf(me.arrAirport[0].lon), "lon")];
me.L3 = [" ALTN", nil, "wht"];
me.L4 = [" ALTN", " ENABLE", "blu"];
if (fmgc.FMGCInternal.altAirportSet) {
me.L4 = [" ALTN", " ENABLE", "blu"];
me.arrowsMatrix[0][3] = 1;
} else {
me.arrowsMatrix[0][3] = 0;
}
me.L6 = [" RETURN", nil, "wht"];
me.R1 = ["ARRIVAL ", nil, "wht"];
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
me.arrowsMatrix = [[0, 0, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "wht", "blu", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0]];
} elsif (me.type == 3) {
me.title = ["LAT REV", " FROM ", me.wpt.wp_name];
me.arrowsMatrix = [[0, 0, 1, 1, 0, 1], [1, 0, 0, 0, 1, 0]];
me.arrowsColour = [["ack", "ack", "wht", "blu", "ack", "wht"], ["wht", "ack", "ack", "ack", "wht", "ack"]];
if (me.wpt != nil) {
me.subtitle = [dmsToString(sprintf(me.wpt.lat), "lat"), dmsToString(sprintf(me.wpt.lon), "lon")];
}
me.L3 = [" HOLD", nil, "wht"];
me.L4 = [" ALTN", " ENABLE", "blu"];
if (fmgc.FMGCInternal.altAirportSet) {
me.L4 = [" ALTN", " ENABLE", "blu"];
me.arrowsMatrix[0][3] = 1;
} else {
me.arrowsMatrix[0][3] = 0;
}
me.L6 = [" RETURN", nil, "wht"];
me.R1 = ["FIX INFO ", nil, "wht"];
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
me.R4 = ["[ ]", "NEW DEST", "blu"];
me.R5 = ["AIRWAYS ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 1, 1, 0, 1], [1, 0, 0, 0, 1, 0]];
me.arrowsColour = [["ack", "ack", "wht", "blu", "ack", "wht"], ["wht", "ack", "ack", "ack", "wht", "ack"]];
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0]];
}
}

View file

@ -1567,6 +1567,8 @@ var button = func(btn, i, event = "") {
} else {
mcdu_scratchpad.scratchpads[i].addChar("-");
}
} else if (btn == "OVFY") {
mcdu_scratchpad.scratchpads[i].addChar("@");
} else {
mcdu_scratchpad.scratchpads[i].addChar(btn);
}

View file

@ -1255,7 +1255,7 @@
<legend>^</legend>
<pref-height>25</pref-height>
<pref-width>25</pref-width>
<!--binding>
<binding>
<command>nasal</command>
<script>mcdu.button("OVFY", 0);</script>
<condition>
@ -1264,7 +1264,7 @@
<value>110</value>
</greater-than-equals>
</condition>
</binding-->
</binding>
</button>
<button>

View file

@ -1262,7 +1262,7 @@
<legend>^</legend>
<pref-height>25</pref-height>
<pref-width>25</pref-width>
<!--binding>
<binding>
<command>nasal</command>
<script>mcdu.button("OVFY", 1);</script>
<condition>
@ -1271,7 +1271,7 @@
<value>110</value>
</greater-than-equals>
</condition>
</binding-->
</binding>
</button>
<button>