* Curtis L. Olson -- Friday 04 March 2005 05:33:
> When configuring a 2d instrument, there is a concept of property 
> aliases.  The README.xmlpanel example uses absolute property paths, but 
> the real world instruments I've seen use relative paths with a lot of 
> ../../../../../params/etc.

You just count all hierarchy levels back to the <params> level (whereby
the name "params" is not hardcoded, and you can use anything else there,
as long as it doesn't clash with existing keywords like "animation").

<PropertyList>

<!-- ### parameter section ### -->

        <params>
                <A>123</A>
                <B trace-read="true">456</B>
        </params>

        <yet-more-params>
                <foo>
                        <bar>whoops</bar>
                </foo>
        </yet-more-params>


<!-- ### animation section ### -->

        <animation>
                <condition>
                        <value alias="../../../params/A"/>
                </condition>
        </animation>

        <L1>
                <L2>
                        <L3>          <!-- L4-L3-L2-L1 -->
                                <L4 
alias="../../../../yet-more-params/foo/bar"/>
                        </L3>
                </L2>
        </L1>

</PropertyList>



Note the the level of the node that defines the alias ("value" and L4) is
also to be counted when backing out, and demands an extra "../". Of course
this is much easier with sane tab indentation, instead of braindead and
impolite one-space indents.  :-P



> Are there any tricks to debugging parameter aliases to make sure you are 
> pointing to the right thing?  

Nothing special, I guess. But you could always set the node's "trace-read"
property (see simgear/props/props_io.cxx:191) I hope this wasn't too confusing. 
:-)

m.

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to