system-failures false vbox # Code to populate the engine entries. var groups = cmdarg().getChildren("group"); var group = groups[1].getChildren("group")[2]; var engines = props.globals.getNode("/engines"); var row = 4; var engine = 0; var i = 0; group.removeChildren("checkbox"); group.removeChildren("input"); group.removeChildren("text"); # Copy in the labels. var target = group.getNode("text[" ~ i ~ "]", 1); props.copy(group.getNode("engine-label"), target); i += 1; target = group.getNode("text[" ~ i ~ "]", 1); props.copy(group.getNode("mtbf-label"), target); i += 1; foreach (var e; engines.getChildren("engine")) { if (((e.getChild("starter") != nil) and (e.getChild("starter") != "")) or ((e.getChild("running") != nil) and (e.getChild("running") != "")) ) { row = row + 1; # Set up the label target = group.getNode("text[" ~ i ~ "]", 1); props.copy(group.getNode("text-template"), target); target.getNode("row").setValue(row); if (size(engines.getChildren("engine")) == 1) { target.getNode("label").setValue("Engine"); } else { # Engines are indexed from 1 in the GUI. target.getNode("label").setValue("Engine " ~ (engine + 1)); } # Now the checkbox target = group.getNode("checkbox[" ~ i ~ "]", 1); props.copy(group.getChild("checkbox-template"), target); target.getNode("row").setValue(row); var failure = "/sim/failure-manager/engines/engine[" ~ engine ~ "]/serviceable"; target.getNode("property").setValue(failure); # Finally the MTBF target = group.getNode("input[" ~ i ~ "]", 1); props.copy(group.getChild("input-template"), target); target.getNode("row").setValue(row); i += 1; var mtbf = "/sim/failure-manager/engines/engine[" ~ engine ~ "]/mtbf"; target.getNode("property").setValue(mtbf); engine += 1; } } hbox 1 1 left hbox left table center top 0 0 0 2 1 0 right 1 1 /systems/vacuum/serviceable 1 2 /sim/failure-manager/systems/vacuum/mtbf 2 0 right 2 1 /systems/static/serviceable 2 2 /sim/failure-manager/systems/static/mtbf 3 0 right 3 1 /systems/pitot/serviceable 3 2 /sim/failure-manager/systems/pitot/mtbf 4 0 right 4 1 /systems/electrical/serviceable 4 2 /sim/failure-manager/systems/electrical/mtbf 5 0 right 5 1 /sim/failure-manager/controls/flight/aileron/serviceable 5 2 /sim/failure-manager/controls/flight/aileron/mtbf 6 0 right 6 1 /sim/failure-manager/controls/flight/elevator/serviceable 6 2 /sim/failure-manager/controls/flight/elevator/mtbf 7 0 right 7 1 /sim/failure-manager/controls/flight/rudder/serviceable 7 2 /sim/failure-manager/controls/flight/rudder/mtbf table center top 0 0 0 2 1 0 right 1 1 /gear/serviceable 1 2 /sim/failure-manager/controls/gear/gear-down/mcbf 2 0 right 2 1 /sim/failure-manager/controls/flight/flaps/serviceable 2 2 /sim/failure-manager/controls/flight/flaps/mcbf 3 0 right 3 1 /sim/failure-manager/controls/flight/speedbrake/serviceable 3 2 /sim/failure-manager/controls/flight/speedbrake/mcbf table center top 0 0 0 2 0 right 1 2 hbox