1
0
Fork 0

... and allow to specify several paths separated with comma. Of course,

multiple usage of --prop:display[*]=... is also supported.
This commit is contained in:
mfranz 2008-12-23 10:15:12 +00:00
parent 087494abf5
commit aff4cacf70

View file

@ -410,16 +410,20 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
# --prop:display=/sim/frame-rate ... adds this property to the property display # --prop:display=sim/frame-rate ... adds this property to the property display
# --prop:display=/position/ ... adds all properties under /position/ (ends with slash!) # --prop:display=position/ ... adds all properties under /position/ (ends with slash!)
# --prop:display=position/,orientation/ ... separate multiple properties with comma
# #
_setlistener("/sim/signals/fdm-initialized", func { _setlistener("/sim/signals/fdm-initialized", func {
foreach (var n; props.globals.getChildren("display")) { foreach (var n; props.globals.getChildren("display")) {
var prop = n.getValue(); foreach (var p; split(",", n.getValue())) {
if (size(prop) and prop[-1] == `/`) if (!size(p))
property_display.add(props.globals.getNode(prop, 1).getChildren()); continue;
else if (p[-1] == `/`)
property_display.add(prop); property_display.add(props.globals.getNode(p, 1).getChildren());
else
property_display.add(p);
}
} }
props.globals.removeChildren("display"); props.globals.removeChildren("display");
}); });