From c3669c2419eb4f5406b321e7a181ef08bc3c1761 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Wed, 12 Jan 2022 11:53:57 +0000 Subject: [PATCH] Add OVERFLY function --- Fonts/HoneywellMCDU.ttf | Bin 6584 -> 6652 bytes Models/Instruments/MCDU/MCDU1.xml | 4 ++-- Models/Instruments/MCDU/MCDU2.xml | 4 ++-- Nasal/FMGC/FMGC-b.nas | 11 +++-------- Nasal/FMGC/flightplan.nas | 15 +++++++++++++++ Nasal/MCDU/F-PLN.nas | 4 ++-- Nasal/MCDU/MCDU.nas | 2 ++ gui/dialogs/mcdu1-dlg.xml | 4 ++-- gui/dialogs/mcdu2-dlg.xml | 4 ++-- 9 files changed, 30 insertions(+), 18 deletions(-) diff --git a/Fonts/HoneywellMCDU.ttf b/Fonts/HoneywellMCDU.ttf index f4ed812c9930b1be538c4489369dba7f76ac1b86..f5c7916c59e9c5f81fa96c034464cc30f08bf2fa 100644 GIT binary patch delta 1032 zcmYjQYe-dD6khA>v(G*^uX&rBVp@8Ap!S+6Z&~)R2aZKi7S04cC@<#YhxaBVWJOO% z3+&}0!GazzKg@A1R!IJmh=^z+Vtx$t(tG_8;Y>dSE5^CHTj!e5IqZG+_kC-9XRpP& zeg2rg6c7NW!$}ZOSyuMTmiFAv5`b9|W@m3G{kaVCp^kAMD3GVWbI#GMRiQbZsQCaAE*j++`UrC`6lD$V4$f1THqM#8yWjTfnfFTWy5^Il#>8PdBcH& zjn6JLZ2_2<`ho-A#;f6qKDYm~e_zt7kB}+eGY@Ynjz*l{0kb|r9$by1hDL`Q{dfO;Hi_2e_5CmhT>e_!h6FS_&I;l3wdq`lasIt+Cq!VL-Yid^Bd1(i)L2i(nZnr&A(b z6t7sxN)E2#y|T?*UH(uEn0aQ6*=BZ|kEBNy$RfE*9+#J7w|r{Z))MQ8)uSwxs@AF< zs!_G6uzIBaR>QVo`|Lt{n;o*7?ceMN_JBPGKxfTA@H!RAEL8;(e-&x8SFXe~x+)io zM7&JTEVng&aeVq_~E{Y zvDHRzFF?C%Hd$8RpPvYRkgOIdvutz|AWKGQQ5;I_8{P^7Z2?N6^(- JX{Pgs_yYYxL1zE} delta 1004 zcmYLIT})g>6h3q3&YipL78Y3$mcQL@n-VZl+*qI$VhKW%3QbGXq?M%XVgZ$q)w z(`s6*iV5ujV}Hb$zVwHZv`y8R=mTj;llDPLAF6E$yCy^l5+p%MS#~_LfjT#5=6>II z=FB;F&W#7Z57qz!fK)gR9GYuu_tX#7yPE)VE)bhnSMzEuWP*qAagBF2KL6srH$U0| zz}g8nw?sl+cQ3xZ@pMh#SPv0)TSsr}&%d0w4q%=FNWa~FF!YAEckoZrX2~|U6Cp;7 zlN4YB;SKGP!#(Squt@k0;ZHjbwS-Pj49(Gglkka1sHY41-~-aP6ZUn6A_uS5&Qt+p zy#`?H>^k)B;a=-5omZT#Gk%z?hAQeD8|^=k_VOY)`5(l?qsF6CdVT!d{RFyMCEJD# z>~#isg$0j=;X1gq3g-b-0@`R++UOnBik|-;Ybd#nYd<|yTqRZ?DkjM!)-)Ja`&aWS zB892Hlct@xHf%C>Q9h$ae%f#9SM@;ss6LBdn!E-Kzu`W7V$@(I&of~&l;MXwmzP&; zAtAuF(%gK;tlTkfrkV}r5p&QSF_(l}6o_ikDtg4AxFP1PJS%K{Y0XKHMY2jZ$s_U$ zIU;|O6LQA3ZLeK!@3lMae*2O=ZpX0SyvDx5Ey6FuAlP1>i(#>q<>Ig?4i9*LOOJ_m~jQ)aR$UZiyA>Z=kz~i$DHe} zWUxZ?x`K3}4X)2=`wF{9N5x#d - + pick clr diff --git a/Models/Instruments/MCDU/MCDU2.xml b/Models/Instruments/MCDU/MCDU2.xml index 78516b3e..d49c0a8d 100644 --- a/Models/Instruments/MCDU/MCDU2.xml +++ b/Models/Instruments/MCDU/MCDU2.xml @@ -1673,7 +1673,7 @@ - + pick clr diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index bdd332cb..950c99a8 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -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(); - #} } } }, diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index b072de4e..426457a0 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -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) { diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index a83f7c0f..92c00b52 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -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 { diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 60d363d8..55c0df44 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -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); } diff --git a/gui/dialogs/mcdu1-dlg.xml b/gui/dialogs/mcdu1-dlg.xml index b2abfed9..c3377802 100644 --- a/gui/dialogs/mcdu1-dlg.xml +++ b/gui/dialogs/mcdu1-dlg.xml @@ -1255,7 +1255,7 @@ ^ 25 25 - +