Configurable auto-gen of tutorials from checklists
Previously tutorials were generated from all checklists. Now <auto-tutorial>false</auto-tutorial> can be set at any level of the checklist heirarchy to disable generation of tutorials for a given checklist, group, or for all checklists.
This commit is contained in:
parent
88788dc6ab
commit
09dca7d3f0
2 changed files with 18 additions and 3 deletions
|
@ -12,10 +12,12 @@ or /sim/checklists/group[n]/checklist[m]
|
|||
with the following tags
|
||||
|
||||
<title> - Name of the checklist
|
||||
<auto-tutorial> - Whether a tutorial should be automatically generated (true, default)
|
||||
or not (false).
|
||||
<page> - Zero or more pages for the checklist containing:
|
||||
<item> - One or more checklist items containing:
|
||||
<name> - name of the checklist item (e.g. Carb Heat), to appear on the left
|
||||
<value> - One or more values for the checklist item, to appear on the right
|
||||
<value> - One or more values for the checklist item, to appear on the right
|
||||
hand side
|
||||
<marker> - A tutorial marker (displayed when the user presses the ? button)
|
||||
This can be easily placed using the Help->Display Tutorial Marker.
|
||||
|
@ -29,16 +31,21 @@ with the following tags
|
|||
The <page> tag may be omitted for single-page checklists, with the <item> tags
|
||||
immediately under the <checklist[n]> node.
|
||||
|
||||
Tutorial auto-generation of all checklists can be disabled by setting
|
||||
/sim/checklists/auto-tutorials=false.
|
||||
|
||||
Checklists may be grouped under <group> nodes with a <name> tag decribing the
|
||||
group. For example
|
||||
|
||||
<group>
|
||||
<name>Emergency</name>
|
||||
<auto-tutorial>false</auto-tutorial>
|
||||
<checklist>...
|
||||
<checklist>...
|
||||
</group>
|
||||
<group>
|
||||
<name>Normal</name>
|
||||
<auto-tutorial>true</auto-tutorial>
|
||||
<checklist>...
|
||||
<checklist>...
|
||||
</group>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
var convert_checklists = func {
|
||||
|
||||
if (props.globals.getNode("/sim/checklists") == nil) return;
|
||||
var autoTutorials = props.globals.getNode("/sim/checklists/auto-tutorials");
|
||||
if (autoTutorials != nil and !autoTutorials.getBoolValue()) return;
|
||||
|
||||
var tutorials = props.globals.getNode("/sim/tutorials", 1);
|
||||
var groups = props.globals.getNode("/sim/checklists").getChildren("group");
|
||||
|
@ -11,6 +13,9 @@ var convert_checklists = func {
|
|||
|
||||
if (size(groups) > 0) {
|
||||
foreach (var grp; groups) {
|
||||
var allowed = grp.getNode("auto-tutorial");
|
||||
if (allowed != nil and !allowed.getBoolValue()) continue;
|
||||
|
||||
var checks = grp.getChildren("checklist");
|
||||
foreach (var chk; checks) {
|
||||
append(checklists, chk);
|
||||
|
@ -21,10 +26,13 @@ var convert_checklists = func {
|
|||
}
|
||||
|
||||
if (size(checklists) == 0) return;
|
||||
|
||||
foreach (var ch; checklists) {
|
||||
var name = ch.getNode("title", 1).getValue();
|
||||
var tutorial = tutorials.getNode("tutorial[" ~ size(tutorials.getChildren("tutorial")) ~ "]", 1);
|
||||
|
||||
var allowed = ch.getNode("auto-tutorial");
|
||||
if (allowed != nil and !allowed.getBoolValue()) continue;
|
||||
|
||||
var tutorial = tutorials.addChild("tutorial");
|
||||
|
||||
# Initial high level config
|
||||
tutorial.getNode("name", 1).setValue("Checklist: " ~ name);
|
||||
|
|
Loading…
Add table
Reference in a new issue