20,741
edits
m (→Nasal in XML files (command bindings): fixed a copy paste mistake) |
|||
Line 42: | Line 42: | ||
I think, we actually talked about this previously on the forums. Instead of using lots of nested XML logics to model a CDU (or any complex instrument), it is actually better to just use the property tree for communicating "events" (e.g. button presses). This would then make it possible for a Nasal script to handle ALL logics (using a registered listener), so that a FSM (finite state machine) can be implemented in Nasal space, this is more flexible than a purely XML-based approach, and could also be more easily reused by other aircraft and developers. My personal suggestion would be to refrain from modeling advanced logics in XML space, while it is certainly possible to do so to a certain degree, the corresponding building blocks are relicts from an era where Nasal scripting was not yet available.--[[User:Hooray|Hooray]] 22:31, 2 December 2010 (UTC) | I think, we actually talked about this previously on the forums. Instead of using lots of nested XML logics to model a CDU (or any complex instrument), it is actually better to just use the property tree for communicating "events" (e.g. button presses). This would then make it possible for a Nasal script to handle ALL logics (using a registered listener), so that a FSM (finite state machine) can be implemented in Nasal space, this is more flexible than a purely XML-based approach, and could also be more easily reused by other aircraft and developers. My personal suggestion would be to refrain from modeling advanced logics in XML space, while it is certainly possible to do so to a certain degree, the corresponding building blocks are relicts from an era where Nasal scripting was not yet available.--[[User:Hooray|Hooray]] 22:31, 2 December 2010 (UTC) | ||
= 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. | |||
* http://en.wikipedia.org/wiki/Finite-state_machine | |||
* http://ai-depot.com/FiniteStateMachines/FSM.html | |||
--[[User:Hooray|Hooray]] 22:53, 2 December 2010 (UTC) | |||
= Generality of the CDU = | = Generality of the CDU = |