autochecklist.nas: support <group>ing checklists
This commit is contained in:
parent
2d4eaa03d7
commit
665d95cb69
2 changed files with 14 additions and 2 deletions
|
@ -63,6 +63,9 @@
|
||||||
# </startup>
|
# </startup>
|
||||||
# </checklists>
|
# </checklists>
|
||||||
#
|
#
|
||||||
|
# If you are using <group>-tags in your checklist definition, you need
|
||||||
|
# to add one <group-index> per sequence.
|
||||||
|
#
|
||||||
# 3. Define a menu item that calls the complete_checklists function with
|
# 3. Define a menu item that calls the complete_checklists function with
|
||||||
# the name of the checklist sequence you would like to run.
|
# the name of the checklist sequence you would like to run.
|
||||||
#
|
#
|
||||||
|
@ -217,8 +220,14 @@ var complete = func(node, wait, from = nil)
|
||||||
var previous_condition = nil;
|
var previous_condition = nil;
|
||||||
var skipping = from != nil;
|
var skipping = from != nil;
|
||||||
|
|
||||||
|
if( node.getChild("group-index") != nil ){
|
||||||
|
var checklists_node = checklists.getChild("group", node.getChild("group-index").getIntValue());
|
||||||
|
} else {
|
||||||
|
var checklists_node = checklists;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var index; node.getChildren("index")) {
|
foreach (var index; node.getChildren("index")) {
|
||||||
var checklist = checklists.getChild("checklist", index.getValue());
|
var checklist = checklists_node.getChild("checklist", index.getValue());
|
||||||
foreach (var item; checklist.getChildren("item")) {
|
foreach (var item; checklist.getChildren("item")) {
|
||||||
var condition = item.getNode("condition");
|
var condition = item.getNode("condition");
|
||||||
if (skipping) {
|
if (skipping) {
|
||||||
|
|
|
@ -52,3 +52,6 @@ group. For example
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
See the c172p for an example of this in action (Aircraft/c172p/c172-checklists.xml).
|
See the c172p for an example of this in action (Aircraft/c172p/c172-checklists.xml).
|
||||||
|
|
||||||
|
Checklists can be automatically executed, for example to implement autostart. For
|
||||||
|
more information, have a look at Aircraft/Generic/autochecklist.nas.
|
||||||
|
|
Loading…
Add table
Reference in a new issue