From 7922658b2208aac38f60d9b5abb269644a6c0ee2 Mon Sep 17 00:00:00 2001 From: BARANGER Emmanuel Date: Thu, 8 Sep 2011 02:07:44 +0200 Subject: [PATCH 01/15] Merge branch 'master' of git://gitorious.org/fg/fgdata From 558c321f9439eee30605889749c68cb0490e6d1e Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Thu, 8 Sep 2011 19:34:15 +0200 Subject: [PATCH 02/15] Fix problem with the A320 family not starting up correctly. --- Nasal/aircraft.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/aircraft.nas b/Nasal/aircraft.nas index 7c88f8d3d..a8c2b08bc 100644 --- a/Nasal/aircraft.nas +++ b/Nasal/aircraft.nas @@ -846,7 +846,7 @@ var tyresmoke = { }, update: func { var rollspeed = me.get_rollspeed(); - var vert_speed = (me.vertical_speed) ? me.vertical_speed.getValue() : -999; + var vert_speed = (me.vertical_speed) != nil ? me.vertical_speed.getValue() : -999; var groundspeed = me.speed.getValue(); var friction_factor = me.friction_factor.getValue(); var wow = me.wow.getValue(); From ea0c72494d275a0a0f71ef1c4b4ade530fa518a8 Mon Sep 17 00:00:00 2001 From: Melchior FRANZ Date: Fri, 9 Sep 2011 16:23:35 +0200 Subject: [PATCH 03/15] first draft of Thrustmaster HOTAS Warthog js config (WIP) --- .../Joysticks/ThrustMaster/Warthog-Stick.xml | 182 ++++++++++ .../ThrustMaster/Warthog-Throttle.xml | 338 ++++++++++++++++++ 2 files changed, 520 insertions(+) create mode 100644 Input/Joysticks/ThrustMaster/Warthog-Stick.xml create mode 100644 Input/Joysticks/ThrustMaster/Warthog-Throttle.xml diff --git a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml new file mode 100644 index 000000000..60a7e68e8 --- /dev/null +++ b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml @@ -0,0 +1,182 @@ + + + + + Thustmaster Joystick - HOTAS Warthog + + + + + + + X-axis + aileron + 0.0001 + + property-scale + /controls/flight/aileron + + + + + Y-axis + elevator + 0.0001 + + property-scale + /controls/flight/elevator + -1.0 + + + + + Trim Coolie Left/Right + aileron trim + + true + + nasal + + + + + true + + nasal + + + + + + + Trim Coolie Down/Up + elevator trim + + true + + nasal + + + + + true + + nasal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml b/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml new file mode 100644 index 000000000..fcef23493 --- /dev/null +++ b/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml @@ -0,0 +1,338 @@ + + + + + Thrustmaster Throttle - HOTAS Warthog + + + + + + + Mouse Horizontal + mouse horizontal + + true + + nasal + + + + + true + + nasal + + + + + + + Mouse Vertical + mouse vertical + + true + + nasal + + + + + true + + nasal + + + + + + + Right Throttle + right throttle (odd engines) + 0.0001 + + nasal + + + + + + Left Throttle + left throttle (even engines) + + 3 + 3 + 5 + + 0.0001 + + nasal + + + + + + Friction Wheel + rudder trim + + 4 + 4 + 6 + + + property-scale + /controls/flight/rudder + -1 + + + + + Coolie Switch Horizontal + + 5 + 5 + 3 + + + + nasal + + + + + + nasal + + + + + + + Coolie Switch Vertical + + 6 + 6 + 4 + + + + nasal + + + + + + nasal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 820323e8545a849f2bc4f1d7b1ceaa35a603897f Mon Sep 17 00:00:00 2001 From: Melchior FRANZ Date: Sat, 10 Sep 2011 00:03:11 +0200 Subject: [PATCH 04/15] warthog: add js overlay support This allows to have generic axis/button definitions with aircraft specific or aircraft class specific modification overlays. These are also found in $FG_HOME, where they override global files. This mechanism is desirable, because the Warthog is an A-10 replica, and it should be possible to have an automatically loaded (1:1 mapped) A-10 joystick config when flying the A-10, while using generic layouts otherwise, or a specific helicopter overlay for helicopters etc. Overlay files look exactly like joystick config files, except they have no and only specify actually differing elements. Axes with *need* a property index (e.g. ), which usually corresponds to the value (i.e. n'th axis def in file). Overlay files can contain a block which is executed on load. The files are to be named {$FG_ROOT,$FG_HOME}/Input/Joysticks/\ ThrustMaster/Warthog/{Joystick,Throttle}/{generic,helicopter,}\ .xml. --- .../Joysticks/ThrustMaster/Warthog-Stick.xml | 28 ++++++++++++- .../ThrustMaster/Warthog-Throttle.xml | 40 +++++++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml index 60a7e68e8..35ce2a9a4 100644 --- a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml +++ b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml @@ -8,11 +8,35 @@ Thustmaster Joystick - HOTAS Warthog + nasal diff --git a/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml b/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml index fcef23493..e943f35c3 100644 --- a/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml +++ b/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml @@ -8,9 +8,42 @@ Thrustmaster Throttle - HOTAS Warthog + nasal From 587993138c10b5c0f046b450887283ab08bef5ff Mon Sep 17 00:00:00 2001 From: Melchior FRANZ Date: Sat, 10 Sep 2011 14:18:37 +0200 Subject: [PATCH 05/15] warthog: simplify overlay handling, more bindings --- .../Joysticks/ThrustMaster/Warthog-Stick.xml | 79 +++++++--- .../ThrustMaster/Warthog-Throttle.xml | 149 +++++++++++++++--- 2 files changed, 180 insertions(+), 48 deletions(-) diff --git a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml index 35ce2a9a4..7cc8db36d 100644 --- a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml +++ b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml @@ -12,31 +12,25 @@ @@ -72,38 +70,58 @@ Trim Coolie Left/Right - aileron trim + adjust aileron trim, +mod: reset aileron trim true nasal - + true nasal - + Trim Coolie Down/Up - elevator trim + adjust elevator trim, +mod: reset elevator trim true nasal - + true nasal - + @@ -133,6 +151,19 @@ From a6c2cfa172db0a0c6072fbee96b616f1f4ffcc4e Mon Sep 17 00:00:00 2001 From: Melchior FRANZ Date: Sun, 11 Sep 2011 08:52:04 +0200 Subject: [PATCH 06/15] warthog: add first aircraft specific overlay file These files take complexity out of the main joystick file, while not adding much code. They also update the description () used by the Help->Joystick information dialog. All code is executed in the joystick's namespace, so variables and funtions of the main file (popup()) can be accessed. --- .../Joysticks/ThrustMaster/Warthog-Stick.xml | 18 +++++----- .../ThrustMaster/Warthog-Throttle.xml | 18 +++++----- .../ThrustMaster/Warthog/Throttle/harrier.xml | 35 +++++++++++++++++++ 3 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 Input/Joysticks/ThrustMaster/Warthog/Throttle/harrier.xml diff --git a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml index 7cc8db36d..416f43c6f 100644 --- a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml +++ b/Input/Joysticks/ThrustMaster/Warthog-Stick.xml @@ -27,11 +27,6 @@ } } - load_overlay("generic.xml"); - if (is_helicopter) - load_overlay("helicopter.xml"); - load_overlay(getprop("/sim/aircraft") ~ ".xml"); - foreach (var b; this.getChildren("button")) { if (b.getAttribute("children") == 1) { var name = b.getNode("name", 1).getValue() or "??"; @@ -44,13 +39,18 @@ setlistener(_, func(n) mod = n.getValue()); var trimstep = 0.75; + + load_overlay("generic.xml"); + if (is_helicopter) + load_overlay("helicopter.xml"); + load_overlay(getprop("/sim/aircraft") ~ ".xml"); X-axis aileron - 0.0001 + 0.00001 property-scale /controls/flight/aileron @@ -60,7 +60,7 @@ Y-axis elevator - 0.0001 + 0.00001 property-scale /controls/flight/elevator @@ -127,7 +127,7 @@ diff --git a/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml b/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml index c535f1589..8b5dbc672 100644 --- a/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml +++ b/Input/Joysticks/ThrustMaster/Warthog-Throttle.xml @@ -40,12 +40,6 @@ var left_engines = [0, 2, 4, 6, 8, 10]; var right_engines = [1, 3, 5, 7, 9, 11]; - var viewstep = 0.5; - var viewdir = props.globals.getNode("/sim").getChildren("view"); - forindex (var i; viewdir) { - var t = viewdir[i].getNode("type"); - viewdir[i] = t != nil and t.getValue() == "lookat" ? 1 : -1; - } load_overlay("generic.xml"); if (is_helicopter) @@ -56,40 +50,10 @@ Mouse Horizontal - mouse horizontal - - true - - nasal - - - - - true - - nasal - - - Mouse Vertical - mouse vertical - - true - - nasal - - - - - true - - nasal - - - @@ -129,58 +93,60 @@ property-scale /controls/flight/rudder-trim -1 + 2 Coolie Switch Horizontal + adjust mixture: left = leaner, right = fatter 5 5 3 + true nasal - + + true nasal - + Coolie Switch Vertical + adjust propeller pitch: forward = increase, backward = decrease 6 6 4 + true nasal - + + true nasal - + + + + + Zoom %d + /gui/map/zoom + true + + + + + + From 798fd6f0d901055926e0b34914ead6f837c5dcee Mon Sep 17 00:00:00 2001 From: BARANGER Emmanuel Date: Tue, 20 Sep 2011 01:45:28 +0200 Subject: [PATCH 14/15] Merge branch 'master' of git://gitorious.org/fg/fgdata From eca0b604014aa0901a8916604460e1602cd6b3b6 Mon Sep 17 00:00:00 2001 From: BARANGER Emmanuel Date: Tue, 20 Sep 2011 23:54:52 +0200 Subject: [PATCH 15/15] Merge branch 'master' of git://gitorious.org/fg/fgdata