Board index FlightGear Development Nasal

Nasal flightplan - loading transitions

Nasal is the scripting language of FlightGear.

Nasal flightplan - loading transitions

Postby legoboyvdlp » Thu Jan 09, 2020 9:21 pm

Hi,
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...
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Nasal flightplan - loading transitions

Postby Isaak » Thu Jan 09, 2020 10:40 pm

For what it's worth: I 've never been able to load transitions in FlightGear. I 've only used the Route Manager, so no experience with nasal FP, but I would guess that transitions aren't supported yet? It would be wise to ask on the mailing list, as James is the one with most knowledge of the RM/FP-system.
Want to support medical research with your pc? Start Folding at Home and join team FlightGear!
Isaak
 
Posts: 768
Joined: Sat Jun 04, 2011 3:52 pm
Location: Hamme, Belgium
Pronouns: he, him
Callsign: OO-ISA
Version: next
OS: Windows 10

Re: Nasal flightplan - loading transitions

Postby legoboyvdlp » Fri Jan 10, 2020 12:28 am

In theory according to the code it should work; if nobody has any ideas I'll pass it on, but just wanted to see if anyone else was working on a Nasal Flightplan based system and might know.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP


Return to Nasal

Who is online

Users browsing this forum: No registered users and 4 guests