I've been trying to work with the nasal flightplan. So far I have successfully made a working F-PLN and departure page - I can select runway, SID, and also display transition.
However, I have been unable to load a transition. For instance, KJFK 31L SKORR8.RNGRR --> inspecting NasalPositioned.cxx suggested the way to do so was to first have my ghost object (hereafter called procedureGhost) for my SID, then:
a) fetch a vector of transitions using procedureGhost.transition
b) fetching a string from the appropriate index by calling vector[0] (e.g. RNGRR is index 0 at that SID)
c) running the string into procedureGhost.transition() which in theory will return a new procedure ghost of the transition
d) set flightplan.sid to the new procedure ghost, which will automatically load both the SID and transition according to NasalPositioned.nas::896.
However, running this in the Nasal Console does -- not -- load the sid!
- Code: Select all
var mySID = findAirportsByICAO("KJFK")[0].getSid(canvas_mcdu.myDeparture[0].selectedSID);
var myTransString = mySID.transitions[0];
debug.dump(mySID.transition(myTransString));
the debug.dump shows that it is a transition object.
However, when I load it as the SID of my flightplan object, it fails; if I call it as such:
- Code: Select all
var mySID = findAirportsByICAO("KJFK")[0].getSid(canvas_mcdu.myDeparture[0].selectedSID);
var myTransString = mySID.transitions[0];
var myTransition = mySID.transition(myTransString);
fmgc.flightPlanController.flightplans[2].sid = myTransition;
debug.dump(fmgc.flightPlanController.flightplans[2].sid.route("31L"));
the vector of waypoints has size 2 - so obviously, the transition waypoints are not being added...
All this occurs irrespective of transition, SID, runway, or airport.
Actually - if I call
- Code: Select all
debug.dump(fmgc.flightPlanController.flightplans[2].sid_trans);
it does show a procedure ghost as well - so maybe it has been loaded, but certainly the waypoints are not being added to the waypoint list...
If anyone has managed to do so - would you mind sharing how you did it? Thank you
If not, something might be amiss in FlightPlan::setSID...