1
0
Fork 0

Add OVERFLY function

This commit is contained in:
Jonathan Redpath 2022-01-12 11:53:57 +00:00
parent 1b9790c536
commit c3669c2419
9 changed files with 30 additions and 18 deletions

Binary file not shown.

View file

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

View file

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

View file

@ -432,16 +432,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 {

View file

@ -1531,6 +1531,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>