Checklist: Improve robustness
This commit is contained in:
parent
9e2ee8b969
commit
a60f5fd3fe
2 changed files with 12 additions and 3 deletions
|
@ -167,7 +167,7 @@
|
|||
|
||||
var values = item.getChildren("value");
|
||||
|
||||
if (size(values) == 0) {
|
||||
if ((size(values) == 0) or (values[0].getValue() == "")) {
|
||||
# Single name element with no values. Used as title
|
||||
t.getNode("halign", 1).setValue("center");
|
||||
t.getNode("row", 1).setValue(row);
|
||||
|
@ -196,7 +196,11 @@
|
|||
t.getNode("col", 1).setValue(1);
|
||||
}
|
||||
|
||||
t.getNode("label", 1).setValue(values[v].getValue());
|
||||
if (isscalar(values[v].getValue())) {
|
||||
t.getNode("label", 1).setValue(values[v].getValue());
|
||||
} else {
|
||||
t.getNode("label", 1).setValue("");
|
||||
}
|
||||
|
||||
# If there's a complete node, it contains a condition
|
||||
# that can be checked to ensure the checklist item is
|
||||
|
|
|
@ -108,6 +108,7 @@
|
|||
}
|
||||
|
||||
var dump = func {
|
||||
var s = "marker(";
|
||||
var v = props.globals.getNode("/sim/current-view", 1);
|
||||
print("<view>");
|
||||
foreach (var n; ["heading-offset-deg", "pitch-offset-deg", "roll-offset-deg",
|
||||
|
@ -120,8 +121,12 @@
|
|||
foreach (var v; values) {
|
||||
var tag = v.name == "scale" ? "scale" : v.name ~ "-m";
|
||||
print(sprintf(" <%s>%.4f</%s>", tag, v.valueN.getValue(), tag));
|
||||
s = s ~ sprintf("%.4f, ", v.valueN.getValue());
|
||||
}
|
||||
print("</marker>\n");
|
||||
print("</marker>");
|
||||
s = substr(s, 0, size(s)-2); # Trim off last ", "
|
||||
s = s ~ ");\n";
|
||||
print(s);
|
||||
}
|
||||
|
||||
var update = func(w) {
|
||||
|
|
Loading…
Add table
Reference in a new issue