Howto talk:Development of the CDU: Difference between revisions

Jump to navigation Jump to search
Update: almost complete CDU logics moved to Nasal
(added example of the text handler concept.)
(Update: almost complete CDU logics moved to Nasal)
Line 1: Line 1:
= Nasal in XML files (command bindings) =
== Nasal in XML files (command bindings) ==
Note that Nasal scripts embedded in XML should be wrapped in <![CDATA[ ...  ]]> markup:
Note that Nasal scripts embedded in XML should be wrapped in <![CDATA[ ...  ]]> markup:
   <![CDATA[ print("Foo");  ]]>
   <![CDATA[ print("Foo");  ]]>
Line 24: Line 24:
--[[User:Hcc23|Hcc23]] 22:16, 2 December 2010 (UTC)
--[[User:Hcc23|Hcc23]] 22:16, 2 December 2010 (UTC)


== 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 [http://gitorious.org/fg/fgdata/blobs/master/Nasal/io.nas $FG_ROOT/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 42: Line 42:
--[[User:Hooray|Hooray]] 23:14, 3 December 2010 (UTC)
--[[User:Hooray|Hooray]] 23:14, 3 December 2010 (UTC)


= Implementing LSK logics =
== Implementing LSK logics ==
  "The most cumbersome buttons are the '''line select keys'''. As their function depends on the current state of the [[CDU]],  
  "The most cumbersome buttons are the '''line select keys'''. As their function depends on the current state of the [[CDU]],  
   the corresponding [[XML]] requires some conditional checks."
   the corresponding [[XML]] requires some conditional checks."
Line 57: Line 57:
[[User:Scotth1|Scotth1]] 13:16, 4 December 2010 (UTC)
[[User:Scotth1|Scotth1]] 13:16, 4 December 2010 (UTC)


= Implementing a finite state machine in Nasal =
== Implementing a finite state machine in Nasal ==
I think, the right thing to do would be creating a new "fsm.nas" module, so that it can be used by aircraft developers to create their own state machines based on a generic fsm module. This would make it possible to implement all sorts of advanced instruments without using the bloated XML syntax for this.
I think, the right thing to do would be creating a new "fsm.nas" module, so that it can be used by aircraft developers to create their own state machines based on a generic fsm module. This would make it possible to implement all sorts of advanced instruments without using the bloated XML syntax for this.


Line 65: Line 65:
--[[User:Hooray|Hooray]] 22:53, 2 December 2010 (UTC)
--[[User:Hooray|Hooray]] 22:53, 2 December 2010 (UTC)


= Generality of the CDU =
== Generality of the CDU ==


CDUs differ from aircraft type to aircraft type. [[User:Gijs|Gijs]] started the [[CDU]] for a Boeing 747-400 based upon the documentation he had for that airplane. I personally have access to a '''B777 FMS PILOT'S GUIDE''' which I will use to guide me in my decisions.... Hopefully people can live with a "mixed up" CDU for the moment (as compared to ''no'' CDU) and interested parties can separate the internal workings later...  
CDUs differ from aircraft type to aircraft type. [[User:Gijs|Gijs]] started the [[CDU]] for a Boeing 747-400 based upon the documentation he had for that airplane. I personally have access to a '''B777 FMS PILOT'S GUIDE''' which I will use to guide me in my decisions.... Hopefully people can live with a "mixed up" CDU for the moment (as compared to ''no'' CDU) and interested parties can separate the internal workings later...  
Line 75: Line 75:
--[[User:Hooray|Hooray]] 23:22, 3 December 2010 (UTC)
--[[User:Hooray|Hooray]] 23:22, 3 December 2010 (UTC)


= 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 [http://gitorious.org/fg/fgdata/blobs/master/Docs/README.osgtext osgText animations]:


Line 167: Line 167:




== Bottom up design for virtual screen implementation (params) ==
=== Bottom up design for virtual screen implementation (params) ===


Using XML parameters, it would for example be possible to develop a fully property driven virtual screen like this:
Using XML parameters, it would for example be possible to develop a fully property driven virtual screen like this:
Line 183: Line 183:
--[[User:Hooray|Hooray]] 01:49, 4 December 2010 (UTC)
--[[User:Hooray|Hooray]] 01:49, 4 December 2010 (UTC)


= XML conditions remark =
== XML conditions remark ==


  (Hcc23 wonders if the condition on the page could be put somewhere else in order to keep things
  (Hcc23 wonders if the condition on the page could be put somewhere else in order to keep things
Line 192: Line 192:
--[[User:Hooray|Hooray]] 18:00, 3 December 2010 (UTC)
--[[User:Hooray|Hooray]] 18:00, 3 December 2010 (UTC)


= XML "params" tag =
== XML "params" tag ==
   Hcc23: I do not yet understand what the <params>...</params> block inside display-text.xml  
   Hcc23: I do not yet understand what the <params>...</params> block inside display-text.xml  
   (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.  
Line 206: Line 206:


--[[User:Hooray|Hooray]] 23:06, 3 December 2010 (UTC)
--[[User:Hooray|Hooray]] 23:06, 3 December 2010 (UTC)
==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 ;)
[[User:Gijs|Gijs]] 06:56, 30 January 2011 (EST)

Navigation menu