1
0
Fork 0

autochecklist.nas: support <group>ing checklists

This commit is contained in:
Delta Echo 2021-03-16 10:41:22 +01:00 committed by James Turner
parent 2d4eaa03d7
commit 665d95cb69
2 changed files with 14 additions and 2 deletions

View file

@ -62,6 +62,9 @@
# <index n="0">9</index> <!-- Parking -->
# </startup>
# </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
# the name of the checklist sequence you would like to run.
@ -216,9 +219,15 @@ var complete = func(node, wait, from = nil)
{
var previous_condition = 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")) {
var checklist = checklists.getChild("checklist", index.getValue());
var checklist = checklists_node.getChild("checklist", index.getValue());
foreach (var item; checklist.getChildren("item")) {
var condition = item.getNode("condition");
if (skipping) {

View file

@ -52,3 +52,6 @@ group. For example
</group>
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.