diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 334c5c9c..f40183cf 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -263,7 +263,10 @@ var FCUController = { HDGPush: func() { if (me.FCUworking) { if (fmgc.Output.fd1.getBoolValue() or fmgc.Output.fd2.getBoolValue() or fmgc.Output.ap1.getBoolValue() or fmgc.Output.ap2.getBoolValue()) { - fmgc.Input.lat.setValue(1); + var wp = fmgc.flightPlanController.flightplans[2].getWP(fmgc.flightPlanController.currentToWptIndex.getValue() + 1); + if (wp != nil and wp.wp_type != "discontinuity") { + fmgc.Input.lat.setValue(1); + } } } }, diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index fa0bf517..4eb4aaad 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -429,6 +429,10 @@ var ITAF = { # This is removed because sequencing is done by the flightplan controller # Internal.lnavAdvanceNm.setValue(FPLN.turnDist); + # TODO - if the waypoint is the DEST waypoint, crosstrack error must be less than 0.5nm and course error less than 30 deg + # TODO - if in HDG mode, if no distance, then crosstrack error must be less than 5nm + # TODO - if in nav, no distance condition applies, but DEST course error must be less than 30 (CONFIRM) + 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) { diff --git a/Nasal/FMGC/flightplan-delegates.nas b/Nasal/FMGC/flightplan-delegates.nas index 579c436e..5fa00820 100644 --- a/Nasal/FMGC/flightplan-delegates.nas +++ b/Nasal/FMGC/flightplan-delegates.nas @@ -126,6 +126,8 @@ var A320GPSDeleagte = { sequence: func { + return; + if (!me.flightplan.active) return; #flightPlanController.autoSequencing(); diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index c9cc2e91..94c4424f 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -209,12 +209,19 @@ var flightPlanController = { # Advancing logic me.currentToWptIndexTemp = me.currentToWptIndex.getValue(); - me.currentToWptIndex.setValue(me.currentToWptIndexTemp + 1); + # TODO - after sequencing discontinuity, FPLN should show PPOS then DISCONTINUITY + # Clearing that discontinuity is not allowed, you must exit using DIRTO, or else using NAV ARM and overfly + # TODO - triple click - confirm, is it only with DES disengage, or also with the NAV loss? - if (me.num[2].getValue() > 2 and me.currentToWptIndexTemp >= 1) { - for (var i = 0; i <= 2; i += 1) { - if (i == 2 or me.temporaryFlag[i]) { - me.flightplans[i].getWP(me.currentToWptIndexTemp - 1).hidden = 1; + if (me.flightplans[2].getWP(me.currentToWptIndexTemp + 1).wp_type == "discontinuity") { + fmgc.Input.lat.setValue(3); + } else { + me.currentToWptIndex.setValue(me.currentToWptIndexTemp + 1); + if (me.num[2].getValue() > 2 and me.currentToWptIndexTemp >= 1) { + for (var i = 0; i <= 2; i += 1) { + if (i == 2 or me.temporaryFlag[i]) { + me.flightplans[i].getWP(me.currentToWptIndexTemp - 1).hidden = 1; + } } } } @@ -823,7 +830,7 @@ var flightPlanController = { var errs = []; call(func { me.currentToWptIndex.setValue(1); - }, nil, nil, nil,errs); + }, nil, nil, nil, errs); if (size(errs) != 0) { debug.printerror(errs); } } me.active.setValue(1);