From 35ec004c5fcff4f22acc9ac927d32e1f7d826325 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 23 Dec 2003 17:31:08 +0000 Subject: [PATCH] Nasal bindings for Saitek X45. Misc. fixes to Nasal command bindings. --- Input/Joysticks/Saitek/X45.xml | 290 +++++++-------------------------- Nasal/props.nas | 4 +- Nasal/view.nas | 4 +- 3 files changed, 64 insertions(+), 234 deletions(-) diff --git a/Input/Joysticks/Saitek/X45.xml b/Input/Joysticks/Saitek/X45.xml index 0633de34d..ea1e7f4d0 100644 --- a/Input/Joysticks/Saitek/X45.xml +++ b/Input/Joysticks/Saitek/X45.xml @@ -78,104 +78,43 @@ $Id$ property-scale /controls/flight/rudder + - - /input/joysticks/js[0]/locks/m3 - - property-scale - /controls/gear/wheel[0]/brake - -1.0 - 0.0 - 1.0 - - - - /input/joysticks/js[0]/locks/m3 - - property-scale - /controls/gear/wheel[1]/brake - 0.0 - 1.0 + nasal + Throttle - property-scale - /controls/engines/engine[0]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[1]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[2]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[3]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[4]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[5]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[6]/throttle - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[7]/throttle - -1.0 - -0.5 + nasal + Mixture - property-scale - /controls/engines/engine[0]/mixture - -1.0 - -0.5 - - - property-scale - /controls/engines/engine[1]/mixture - -1.0 - -0.5 + nasal + Propeller Advance - property-scale - /controls/engines/engine[0]/propeller-pitch - - - property-scale - /controls/engines/engine[1]/propeller-pitch + nasal + @@ -186,17 +125,15 @@ $Id$ true - property-adjust - /sim/current-view/goal-heading-offset-deg - 1.0 + nasal + true - property-adjust - /sim/current-view/goal-heading-offset-deg - -1.0 + nasal + @@ -206,79 +143,41 @@ $Id$ true - property-adjust - /sim/current-view/goal-pitch-offset-deg - 1.0 + nasal + true - property-adjust - /sim/current-view/goal-pitch-offset-deg - -1.0 + nasal + - - - - - - - @@ -294,91 +193,28 @@ $Id$ - - - - - - - @@ -388,9 +224,8 @@ Mode 3 - Taxi Mode Elevator trim down true - property-adjust - /controls/flight/elevator-trim - 0.0015 + nasal + @@ -398,9 +233,8 @@ Mode 3 - Taxi Mode Aileron trim right true - property-adjust - /controls/flight/aileron-trim - 0.0015 + nasal + @@ -408,9 +242,8 @@ Mode 3 - Taxi Mode Elevator trim up true - property-adjust - /controls/flight/elevator-trim - -0.0015 + nasal + @@ -418,9 +251,8 @@ Mode 3 - Taxi Mode Aileron trim left true - property-adjust - /controls/flight/aileron-trim - -0.0015 + nasal + @@ -429,18 +261,16 @@ Mode 3 - Taxi Mode @@ -450,9 +280,8 @@ Mode 3 - Taxi Mode Rudder trim right true - property-adjust - /controls/flight/rudder-trim - 0.0015 + nasal + @@ -460,9 +289,8 @@ Mode 3 - Taxi Mode Rudder trim left true - property-adjust - /controls/flight/rudder-trim - -0.0015 + nasal + diff --git a/Nasal/props.nas b/Nasal/props.nas index a48c99ef6..0e2bcf47c 100644 --- a/Nasal/props.nas +++ b/Nasal/props.nas @@ -146,6 +146,6 @@ setAll = func { if(node == nil) { return; } children = node.getChildren(); foreach(c; children) { - c.getNode(arg[1], 1).setValue(arg[2]); - } + if(c.getName() == name) { + c.getNode(arg[1], 1).setValue(arg[2]); }} } diff --git a/Nasal/view.nas b/Nasal/view.nas index 44bb895ea..0e0def088 100644 --- a/Nasal/view.nas +++ b/Nasal/view.nas @@ -86,8 +86,10 @@ resetView = func { getprop("/sim/current-view/config/heading-offset-deg")); setprop("/sim/current-view/goal-pitch-offset-deg", getprop("/sim/current-view/config/pitch-offset-deg")); + setprop("/sim/current-view/goal-roll-offset-deg", + getprop("/sim/current-view/config/roll-offset-deg")); setprop("/sim/current-view/field-of-view", - getprop("/sim/current-view/config/field-of-view-deg")) + getprop("/sim/current-view/config/default-field-of-view-deg")) } ##