From 658b1fe6ced8f08802ee5fca3b38dfc4d789b66f Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Wed, 1 May 2013 22:41:15 +0100 Subject: [PATCH] Add support for tags on checklist items. These are then attached to buttons on the checklist dialog allowing the user to ask the computer to execute the checklist step, which they can observe. --- Aircraft/c172p/c172-checklists.xml | 152 ++++++++++++++++++++++++++++- gui/dialogs/checklist.xml | 21 ++++ 2 files changed, 171 insertions(+), 2 deletions(-) diff --git a/Aircraft/c172p/c172-checklists.xml b/Aircraft/c172p/c172-checklists.xml index 9f59b2bfa..d4a2ec9d8 100644 --- a/Aircraft/c172p/c172-checklists.xml +++ b/Aircraft/c172p/c172-checklists.xml @@ -25,9 +25,14 @@ /controls/gear/brake-parking - 1 + 1 + + property-assign + /controls/gear/brake-parking + 1 + Avionics Power Switch @@ -62,6 +67,16 @@ + + property-assign + /consumables/fuel/tank/selected + 1 + + + property-assign + /consumables/fuel/tank[1]/selected + 1 + @@ -87,6 +102,11 @@ 0 + + property-assign + /controls/anti-ice/engine[0]/carb-heat + 0 + Throttle @@ -109,6 +129,12 @@ + + property-interpolate + /controls/engines/engine[0]/throttle + 0.25 + 0.2 + Mixture @@ -125,6 +151,12 @@ 0.9 + + property-interpolate + /controls/engines/engine[0]/mixture + 1.0 + 0.5 + Propellor Area @@ -150,6 +182,11 @@ 3 + + property-assign + /controls/engines/engine[0]/magnetos + 3 + Ignition Switch @@ -185,6 +222,16 @@ + + property-assign + /controls/lighting/nav-lights + 1 + + + property-assign + /controls/lighting/beacon + 1 + Radios @@ -207,6 +254,18 @@ + + property-interpolate + /instrumentation/comm[0]/volume + 1.0 + 0.5 + + + property-interpolate + /instrumentation/comm[1]/volume + 1.0 + 0.5 + @@ -228,6 +287,11 @@ 1 + + property-assign + /controls/gear/brake-parking + 1 + Seats, Seat Belts, Shoulder Harnesses @@ -264,6 +328,12 @@ 0.9 + + property-interpolate + /controls/engines/engine[0]/mixture + 1.0 + 0.5 + Fuel Selector Valve @@ -286,6 +356,16 @@ + + property-assign + /consumables/fuel/tank/selected + 1 + + + property-assign + /consumables/fuel/tank[1]/selected + 1 + Elevator Trim @@ -308,6 +388,12 @@ + + property-interpolate + /controls/flight/elevator-trim + -0.1 + 0.1 + Throttle @@ -326,10 +412,16 @@ /engines/engine/rpm - 1700 + 1800 + + property-interpolate + /controls/engines/engine[0]/throttle + 0.69 + + Magnetos @@ -383,6 +475,18 @@ -0.1367 3.9167 + + + /engines/engine/rpm + 1050 + + + + property-interpolate + /controls/engines/engine[0]/throttle + 0.1 + + Throttle Friction Lock @@ -464,6 +568,11 @@ 0.5 + + property-assign + /controls/flight/flaps + 0 + Carburetor Heat @@ -480,6 +589,11 @@ 0 + + property-assign + /controls/anti-ice/engine[0]/carb-heat + 0 + Mixture @@ -497,6 +611,12 @@ 0.9 + + property-interpolate + /controls/engines/engine[0]/mixture + 1.0 + + Throttle @@ -513,6 +633,12 @@ 0.95 + + property-interpolate + /controls/engines/engine[0]/throttle + 1.0 + + Elevator Control @@ -550,6 +676,11 @@ + + property-assign + /controls/flight/flaps + 0.333333 + Carburetor Heat @@ -566,6 +697,11 @@ 0 + + property-assign + /controls/anti-ice/engine[0]/carb-heat + 0 + Brakes @@ -598,6 +734,12 @@ 0.95 + + property-interpolate + /controls/engines/engine[0]/throttle + 1.0 + + Mixture @@ -615,6 +757,12 @@ 0.9 + + property-interpolate + /controls/engines/engine[0]/mixture + 1.0 + + Brakes diff --git a/gui/dialogs/checklist.xml b/gui/dialogs/checklist.xml index dc2dbafb0..00b460d03 100644 --- a/gui/dialogs/checklist.xml +++ b/gui/dialogs/checklist.xml @@ -185,6 +185,27 @@ marker.getNode("z-m", 1).getValue() ~ ", " ~ scale ~ ");"); } + + # If there's one or more binding nodes we display a + # small button that executes the binding. Used to + # demonstrate the checklist item + var bindings = item.getChildren("binding"); + + if ((v == 0) and (size(bindings) > 0)) { + var btn = table.getChild("button", btncount, 1); + btncount += 1; + btn.getNode("row", 1).setValue(row); + btn.getNode("col", 1).setValue(3); + btn.getNode("pref-width", 1).setValue(20); + btn.getNode("pref-height", 1).setValue(20); + btn.getNode("padding", 1).setValue(1); + btn.getNode("legend", 1).setValue(">"); + + forindex (var bdg; bindings) { + var binding = btn.getChild("binding", bdg, 1); + props.copy(bindings[bdg], binding); + } + } row = row + 1; }