Hi !

Having added a couple of new fgcommands recently I was now going to
refine some of the acceptable parameters, to allow more functionality.

And since Erik said that there could only be ONE parameter of type
SGPropertyNode be passed to a fgcommand, I was going to pass all
other parameters as additional subnodes/values of that particular
SGPropertyNode.

However, somehow I'm screwing things up now - because this works only
for a certain amount of nodes/values so far.

Without splitting parameters up, the whole things works, but it's then
of  course a rather static solution  - so I assume I simply didn't
take the right approach to deal with (=get) the subnodes, basically I'm
using constructs of the global pointer, like:

        globals->get_props()->getNode(...)

as well as the hasValue/hasChild methods in order to obtain the
values/childs of the SGPropertyNode pointer.

(Erik mentioned already some time ago that using the global pointer
wouldn't be the preferable way in most cases, but rather one should
use helpfer function)

But running the mentioned fgcommand directly via a simple
        
        <command>mycommand</command>

binding in menubar.xml works fine, however as soon as I either start
providing several parameters within one property node, OR as soon as I
try to run the very same fgcommand using Nasal, the whole thing doesn't
work anymore, the Nasal problem seems to be related to the calling
format:

        fgcommand("mycommand","/path/within/proptree/");

So, what's the correct way (method/function) to deal with the passed
SGPropertyNode pointer in order to obtain the values of several (kown)
subnodes within that pointer ?

As I said: it works sporadically :-/

Let's say I have half a dozen of parameters, all stored as values or
subnodes within the passed SGPropertyNode pointer, how do I actually
obtain the contents reliably - so that it doesn't matter whether the
fgcommand is executed directly via a <command> tag or using the Nasal
interpreter ?


Thanks


--------- Boris

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to