Board index FlightGear Development Nasal

Spoken GCA

Nasal is the scripting language of FlightGear.

Re: Spoken GCA

Postby rleibner » Sat Feb 24, 2018 5:14 pm

Hooray wrote in Sat Feb 24, 2018 12:06 pm:I'd suggest 5 lines of Nasal code to look up navdata using an airport that is out of range.
Something like this:
Code: Select all
var apts = findAirportsWithinRange(50);
foreach(var apt; apts)
    printf('elevation near %s :  %i m.', apt.name, geo.elevation(apt.lat, apt.lon));

I think that output clearly shows the issue.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken GCA

Postby rleibner » Sat Feb 24, 2018 5:25 pm

Hi clm76,
Thanks for your help.
I am still fighting (unsuccessfully) against the 'vertical blue line'.
Next step will be a canvas dialog to customize glideSlope, final dist, and may be other parameters.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken GCA

Postby Hooray » Sat Feb 24, 2018 5:59 pm

yes, looks good.
I'd suggest you give the devel list a try and see if people have a strong opinion/preference regarding a native code based solution.
If you should however find that development resources are scarce or that people are hesitant to help with this, let me know, and I'll help you come up with a scripting space workaround that should work well enough in the meantime (probably exploiting the AI system to force the tile manager to load the corresponding tile).

But again, if you can get any core developer support to get a proper fix, that's definitely much better than working around such issues using a handful of hacks.

PS: Regarding the configuration UI, I believe that the original GCA addon was using a procedurally-created Canvas dialog that was driven by a corresponding hash, which included support for glideslope angle etc ? By the way, are you taking airport/runway-specific information into account when computing the approach profile (TDZE) ?
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12170
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken GCA

Postby rleibner » Sat Feb 24, 2018 6:14 pm

Hooray wrote in Sat Feb 24, 2018 5:59 pm: I believe that the original GCA addon was using a procedurally-created Canvas dialog
Yes, it was. I'm hesitating among using that type of dialog, or adding specific buttons/knobs to adjust Slope and Final values.
Hooray wrote in Sat Feb 24, 2018 5:59 pm:are you taking airport/runway-specific information into account when computing the approach profile (TDZE) ?
No, I dont know nothing about. (airportinfo() is barely documented, isn't it?)
Can you point me to some example about TDZE ?
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken GCA

Postby Hooray » Sat Feb 24, 2018 6:30 pm

Thanks to Red Leader's work, there's actually fairly good info:

http://wiki.flightgear.org/Nasal_librar ... info.28.29
http://wiki.flightgear.org/Navdata_cach ... _via_Nasal

The most important ones would seem to be:
  • lat/lon
  • threshold

Looking at the docs, I am not sure if there's any better way to get the runway's TDZE (touch-down zone elevation) without doing an elevation query (geodinfo): https://skybrary.aero/index.php/TouchDo ... tion_(TDZE)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12170
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken GCA

Postby rleibner » Sat Feb 24, 2018 7:06 pm

Hooray wrote in Sat Feb 24, 2018 6:30 pm:The most important ones would seem to be:
lat/lon
threshold
Oh, you meant that.
Certainly I'm using airportinfo().runways[rwy].lat/lon()
About threshold, not all FG airports return its value. May be the best tactic is to use threshold (if any) or to assign 250 m (if not).
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken GCA

Postby Parnikkapore » Sun Feb 25, 2018 3:07 pm

Hi, I just tried out the PAR addon, and unfortunately it is unusable...
the error message is something like
Code: Select all
line 293: Nasal runtime error: symbol "err" not defined

could you help with this?
There are free alternatives to every program you encounter. You just have to find them.
Parnikkapore
 
Posts: 831
Joined: Thu Oct 29, 2015 10:16 am
Callsign: HS-FGS
Version: next [PPA]
OS: Mint 18

Re: Spoken GCA

Postby Hooray » Sun Feb 25, 2018 3:16 pm

clm76 posted the corresponding fix, but rleibner said already that he fixed this in the repository, too.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12170
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken GCA

Postby clm76 » Sun Feb 25, 2018 4:43 pm

Hooray wrote in Sun Feb 25, 2018 3:16 pm:rleibner said already that he fixed this in the repository, too.

The lastest version didn't fix this error.

Parnikkapore wrote in Sun Feb 25, 2018 3:07 pm:Hi, I just tried out the PAR addon, and unfortunately it is unusable...
the error message is something like
Code: Select all
line 293: Nasal runtime error: symbol "err" not defined

could you help with this?


To fix this error, add this line of code at line 6 in the file "par.nas" , just after "var gcaCtrl = nil;".
Code: Select all
var err = [];

with " [ ] " and not "( )".
clm76
 
Posts: 155
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.3.0
OS: Linux Mint 20

Re: Spoken GCA

Postby rleibner » Sun Feb 25, 2018 6:22 pm

About the line 293: Nasal runtime error: symbol "err" not defined:
I can not reproduce such an error in my tests. Thought it was caused by the MP/AI traffic (usually I have it enabled) but after turn it off, nothing changed to me.
Anyway, as clm76 proposes, declaring early var err = []; should fix that.
Thanks.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken GCA

Postby Hooray » Sun Feb 25, 2018 6:57 pm

this shows usually up when using the call() API without also setting up the empty vector to gather any errors - thus, it makes sense to simply initialize the vector in-line:

call(foo, [1,2,3], var err=[]);
if(size(err)) {
}
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12170
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken GCA

Postby Parnikkapore » Sun Feb 25, 2018 10:30 pm

By the way, I use the devel PPA, in case it matters.
@clm76: Will try ASAP!
There are free alternatives to every program you encounter. You just have to find them.
Parnikkapore
 
Posts: 831
Joined: Thu Oct 29, 2015 10:16 am
Callsign: HS-FGS
Version: next [PPA]
OS: Mint 18

Re: Spoken GCA

Postby rleibner » Mon Feb 26, 2018 4:29 pm

Parnikkapore wrote in Sun Feb 25, 2018 10:30 pm:this shows usually up when using the call() API without also setting up the empty vector to gather any errors

That's what it's strange, actually par.nas reads:
Code: Select all
 if(size(nodes)>1){
   for(var i=1; i<size(nodes); i+=1) call(me.updateMark,[nodes[i]],me,var err = []);
   if (size(err)) {
      print("Closing instrument");
      me.timer.stop();
    }
 }
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken GCA

Postby clm76 » Tue Feb 27, 2018 7:54 am

Hi,
I found the origin of the nasal error line 294 :
Code: Select all
 if (size(err)) {

If AI traffic is not enabled, « size(nodes) » = 1 at line 292 so :
Code: Select all
 for(var i=1; i<size(nodes); i+=1) call(me.updateMark,[nodes[i]],me,var err = []);

with «var i=1; i < size(nodes) », "me.updateMark" isn't called and « var err = [] » is not defined.
clm76
 
Posts: 155
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.3.0
OS: Linux Mint 20

Re: Spoken GCA

Postby Hooray » Tue Feb 27, 2018 3:41 pm

thanks for reporting back, that makes perfect sense, good job there !
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12170
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest