Canvas Nasal/JavaScript Subset: Difference between revisions

Jump to navigation Jump to search
m
Line 17: Line 17:
One idea we discussed is to "compile" Nasal into Javascript and send it to the browser (together with the canvas as SVG), but we don't know yet if this is possible with a reasonable effort. Also we should ensure that the JavaScript API and Nasal API are identical, such the code can be easily converted/ported. So we need to define a safe subset of Nasal and JavaScript and come up with corresponding classes to wrap identical stuff. And there are a quite a few useful JS features that Nasal will never support, so we need to use factories for those to hide differences between both languages (sounds like something that Philosopher might enjoy), or someone will end up complaining that jQuery breaks Nasal...
One idea we discussed is to "compile" Nasal into Javascript and send it to the browser (together with the canvas as SVG), but we don't know yet if this is possible with a reasonable effort. Also we should ensure that the JavaScript API and Nasal API are identical, such the code can be easily converted/ported. So we need to define a safe subset of Nasal and JavaScript and come up with corresponding classes to wrap identical stuff. And there are a quite a few useful JS features that Nasal will never support, so we need to use factories for those to hide differences between both languages (sounds like something that Philosopher might enjoy), or someone will end up complaining that jQuery breaks Nasal...


{{FGCquote
  | I have uploaded a new free Android App in the Play Store. This time it is a NAV display for airliners. At the moment the App works with the Boeing 777 and Airbus 330 (Omega), but I will start adding support to other planes in the near future. Many details like fixes, nav aids, waypoints (up to 12) have been carefully implemented so that the App resembles as much fatefully as possible the Boeing NAV display. The modes APP,VOR,MAP, ARC views, etc. are controlled from the panel in flightgear.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=223022#p223022
    |title=<nowiki>Flightgear Android Navigation Displays for Airliners</nowiki>
    |author=<nowiki>saul</nowiki>
    |date=<nowiki>Mon Nov 03</nowiki>
  }}
}}
{{FGCquote
  | in the long term it would however make sense to re-implement this on top of Torsten's mongoose work, and maybe reusing some of Gijs' Canvas/ND work (certainly the SVG stuff could be reused, maybe even some generic Nasal/JavaScript code).
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=223640#p223640
    |title=<nowiki>Re: Flightgear Android Navigation Displays for Airliners</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Sat Nov 08</nowiki>
  }}
}}
{{FGCquote
  |Would love to see future enhancements. Specifically  ILS, QNS/STD and Roll Scale. If you need support, just let me know.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=226877#p226877
    |title=<nowiki>Re: Flightgear Android Navigation Displays for Airliners</nowiki>
    |author=<nowiki>dutchman</nowiki>
    |date=<nowiki>Fri Dec 12</nowiki>
  }}
}}
{{FGCquote
  |Before any significant amount of time is spent on re-implementing functionality available available on Gijs' ND, I'd suggest to seriously consider collaborating whenever possible - all the  artwork and animation logic can be easily made platform-agnostic, i.e. there's nothing Android/FlightGear or Canvas-specific about updating a SVG element and animating/transforming it. To make this work, you would merely need to use a tiny subset of JavaScript and Nasal and add a few of helper functions as wrappers for platform-specific functionality (think property tree access) - TorstenD has already written most of the code required for this as part of his mongoose work.
That way, you could easily reuse the same SVG/artwork that's internally used by the Canvas ND.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=226881#p226881
    |title=<nowiki>Re: Flightgear Android Navigation Displays for Airliners</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Fri Dec 12</nowiki>
  }}
}}


== Mapping ==
== Mapping ==

Navigation menu