Howto talk:Development of the CDU: Difference between revisions

Jump to navigation Jump to search
Switch to {{fg root file}}, {{gitorious source}}, and {{readme file}} to fix the broken Gitorious links.
m (moved [[Talk:Howto: Development of the CDU]] to [[Talk:Howto:Development of the CDU]]: Robot: Moved page)
(Switch to {{fg root file}}, {{gitorious source}}, and {{readme file}} to fix the broken Gitorious links.)
 
Line 25: Line 25:


=== Loading external Nasal files from XML files ===
=== Loading external Nasal files from XML files ===
There is code to do this in [http://gitorious.org/fg/fgdata/blobs/master/Nasal/io.nas $FG_ROOT/Nasal/io.nas] - namely the function "load_nasal(filename, namespace)".  
There is code to do this in {{fg root file|Nasal/io.nas}} - namely the function "load_nasal(filename, namespace)".  
io.nas contains some comments. Basically, this allows you to reference/load and run separate Nasal modules, without having to embed all of the code directly in the XML markup. So it's a good practice and makes things easier:
io.nas contains some comments. Basically, this allows you to reference/load and run separate Nasal modules, without having to embed all of the code directly in the XML markup. So it's a good practice and makes things easier:


Line 76: Line 76:


== LCD screen abstraction ==
== LCD screen abstraction ==
My suggestion would be to introduce a new Nasal module here, where people can use a wrapper to create a new alphanumerical screen area and map it to the corresponding [http://gitorious.org/fg/fgdata/blobs/master/Docs/README.osgtext osgText animations]:
My suggestion would be to introduce a new Nasal module here, where people can use a wrapper to create a new alphanumerical screen area and map it to the corresponding osgText animations ({{readme file|osgtext}}):


  var myLCD = lcd.new(lines:14,columns:24);
  var myLCD = lcd.new(lines:14,columns:24);
Line 145: Line 145:
I've done a proof-of-concept of the text handler and display, there is probably more that could be done with this, but it works quite nicely, just need a way to style each line now?
I've done a proof-of-concept of the text handler and display, there is probably more that could be done with this, but it works quite nicely, just need a way to style each line now?


http://gitorious.org/airbus-aircraft/a380/blobs/master/Nasal/TextRegion.nas
{{gitorious source|airbus-aircraft|a380|path=Nasal/TextRegion.nas}}
http://gitorious.org/airbus-aircraft/a380/blobs/master/XML/FlightDeck/FrontPanel/eicas.xml
{{gitorious source|airbus-aircraft|a380|path=XML/FlightDeck/FrontPanel/eicas.xml}}


and in my system.nas (I think from memory) I declare at the beginning (so it's not inside any function and acts like a global var)
and in my system.nas (I think from memory) I declare at the beginning (so it's not inside any function and acts like a global var)
Line 196: Line 196:
   (or any of the other renderers for that matter) actually does. My current assumption is that of a default or fall-back.  
   (or any of the other renderers for that matter) actually does. My current assumption is that of a default or fall-back.  


"params" is way to parameterize a previously included XML file, so that tags can be overriden with custom values. This is useful to factor out stuff into separate files and then reuse these generic files and just change some values by using "parameters". The "params" tag is briefly explained in $FG_ROOT/Docs/README.xmlpanel: http://gitorious.org/fg/fgdata/blobs/master/Docs/README.xmlpanel
"params" is way to parameterize a previously included XML file, so that tags can be overriden with custom values. This is useful to factor out stuff into separate files and then reuse these generic files and just change some values by using "parameters". The "params" tag is briefly explained in {{readme file|xmlpanel}}.
This file contains lots of important things that would actually better be moved to the README.xmlsyntax or README.introduction files (or at least be covered here in the wiki). It also covers aliasing, property indexing and XML file inclusion. So it's definitely worth having a look.  
This file contains lots of important things that would actually better be moved to the README.xmlsyntax or README.introduction files (or at least be covered here in the wiki). It also covers aliasing, property indexing and XML file inclusion. So it's definitely worth having a look.  


Line 208: Line 208:


==Update: almost complete CDU logics moved to Nasal==
==Update: almost complete CDU logics moved to Nasal==
As of last week, the cdu in Git ([http://gitorious.org/fg/fgdata/trees/master/Aircraft/Instruments-3d/cdu Aircraft/Instruments-3d/cdu]) is controlled almost completely by Nasal. Latest pieces of XML logics will be moved to Nasal soon. Altough he Nasal script does its work well (much more flexible/clear than XML), I am quite sure there should be a better way. Feedback is welcome of course ;)
As of last week, the cdu in Git ({{fg root file|Aircraft/Instruments-3d/cdu}}) is controlled almost completely by Nasal. Latest pieces of XML logics will be moved to Nasal soon. Altough he Nasal script does its work well (much more flexible/clear than XML), I am quite sure there should be a better way. Feedback is welcome of course ;)


[[User:Gijs|Gijs]] 06:56, 30 January 2011 (EST)
[[User:Gijs|Gijs]] 06:56, 30 January 2011 (EST)

Navigation menu