... and allow to specify several paths separated with comma. Of course,
multiple usage of --prop:display[*]=... is also supported.
This commit is contained in:
parent
087494abf5
commit
aff4cacf70
1 changed files with 11 additions and 7 deletions
|
@ -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");
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue