1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata into work

This commit is contained in:
Vivian Meazza 2011-09-21 23:59:10 +01:00
commit 9808ca5616
11 changed files with 1040 additions and 32 deletions

View file

@ -32,34 +32,41 @@ by a OpenGL Shader - a small program that is run on your graphics card.
The cloud is defined by the following properties:
<min-cloud-width-m> - minimum width of the cloud in meters (default 500)
<max-cloud-width-m> - maximum width of the cloud (default min-cloud-width-m)
<min-cloud-height-m> - minimum height of the cloud (default min-cloud-width-m)
<max-cloud-height-m> - maximum height of the cloud (default max-cloud-width-m)
<max-cloud-width-m> - maximum width of the cloud (default min-cloud-width-m*1.5)
<min-cloud-height-m> - minimum height of the cloud (default 400)
<max-cloud-height-m> - maximum height of the cloud (default min-cloud-height-m*1.5)
<texture> - texture file of sprites to use (default cl_cumulus.png)
<num-textures-x> - number of cloud textures defined horizontally in the
texture file (default 4)
<num-textures-y> - number of cloud textures defined vertically in the
texture file (default 4)
<height-map-texture> - whether to choose the vertical texture index based on
sprite height within the clouds (default false)
<num-sprites> - Number of sprite to generate for the cloud (default 20)
<bottom-shade> - Light multiplier for sprites at the bottom of the cloud
(default 1.0)
<min-sprite-width-m> - minimum width of the sprites used to create the cloud
(default 200)
<max-sprite-width-m> - maximum width of the sprites used to create the cloud
(default min-sprite-width-m)
(default min-sprite-width-m*1.5)
<min-sprite-height-m> - minimum height of the spites used to create the cloud
(default min-sprite-width-m)
(default 150)
<max-sprite-height-m> - maximum height of the sprites used to create the cloud
(default max-sprite-height-m)
(default min-sprite-height-m*1.5)
<z-scale> - vertical scaling factor to apply to to the sprite after
billboarding. A small value would create a sprite that
looks squashed when viewed from the side. (default 1.0)
The texture to use for the sprites is defined in the <texture> tag.
To allow some variation, you can create a texture file containing multiple
sprites in a grid, and define the <num-textures-x/y> tags. The code
decides which texture to use for a given sprite : randomly in the x-direction
and based on the altitude of the sprite within the cloud in the y-direction.
Therefore, you should put sprite textures you want to use for the bottom of
your cloud at the bottom of the texture file, and those you want to use for
the top of the cloud at the top of the texture file.
and based on the altitude of the sprite within the cloud in the y-direction
if <height-map-texture> is set. Therefore, you should put sprite textures
you want to use for the bottom of your cloud at the bottom of the texture
file, and those you want to use for the top of the cloud at the top of the
texture file.
For example, the following Nasal snippet will create a cloud immediately above the
aircraft at an altitude of 1000 ft above /environment/clouds/layer[0]/elevation-ft :
@ -92,14 +99,14 @@ Deleting Individual Clouds
Clouds may be deleted by using the "del-cloud" command. This takes the following
property arguments.
<layer> - The cloud layer number containing the cloud to delet. (default 0)
<layer> - The cloud layer number containing the cloud to delete. (default 0)
<index> - The unique identifier of the cloud to delete.
Global 3D Clouds
================
The global weather system uses sets of clouds defined in cloudlayers.xml
in your FG_ROOT.
The global weather system uses sets of clouds defined in
FG_ROOT/Environment/cloudlayers.xml
The file has 3 distinct sections: layers, cloud boxes and clouds,
described below.

View file

@ -0,0 +1,35 @@
("Master files") Warthog-Stick.xml and Warthog-Throttle.xml support
configuration overlay files. These are optional and can be used to
modify the default configuration. Warthog-Stick.xml searches for
overlay files in
{$FG_HOME,$FG_ROOT}/Input/Joysticks/ThrustMaster/Warthog/Stick/
and Warthog-Throttle.xml in
{$FG_HOME,$FG_ROOT}/Input/Joysticks/ThrustMaster/Warthog/Throttle/
Available files are loaded in the following order, where <x> is replaced
by the contents of property "x":
- generic.xml
- helicopter.xml (only helicopters)
- </sim/type>.xml (some aircraft set this property to "seaplane")
- </input/joysticks/overlay>.xml (not used by the system; meant to
be set on the command line or in wrapper scripts,
for example: --prop:input/joysticks/overlay=modern_jet)
- </sim/aircraft>.xml (aircraft name, for example "harrier.xml")
If a file is found under $FG_HOME, then an equally named file under
$FG_ROOT will be ignored.
Overlay files are like stripped down joystick driver files, but shall
not have a <name> entry. They only need to define what should differ
from the already loaded joystick configuration. Make sure that an
axis definition uses the same index as the master file. The n-th
<axis> in an XML config file usually has index n, even if the axis
uses <number><unix> etc. Nasal blocks are properly executed in the
namespace of the master file, so you can access all its functions
and variables.

View file

@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!-- left throttle: control thrust vector -->
<PropertyList>
<nasal>
<script>
var thrust_display = func {
var thv = getprop("/controls/engines/engine/mixture");
popup("Thrust vector %d", thv * 120 - 20 + 0.5);
}
</script>
</nasal>
<axis n="2">
<name>Right Throttle</name>
<desc>throttle</desc>
<binding>
<command>nasal</command>
<script>controls.throttleAxis()</script>
</binding>
</axis>
<axis n="3">
<name>Left Throttle</name>
<desc>thrust vector</desc>
<binding>
<command>nasal</command>
<script>
controls.mixtureAxis();
thrust_display();
</script>
</binding>
</axis>
</PropertyList>

View file

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<PropertyList>
<axis n="5">
<name>Hat Switch Horizontal</name>
<desc>adjust engine balance</desc>
</axis>
<axis n="6">
<name>Hat Switch Vertical</name>
<desc>adjust engine power</desc>
</axis>
</PropertyList>

View file

@ -0,0 +1,361 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2011 Melchior FRANZ mfranz # aon : at
This driver supports joystick overlay files (see ./Warthog/README).
TMS ... Target Management Switch (black, rippled cursor switch, left side)
DMS ... Data Management Switch (black cursor switch with flat cross on top, right side)
CMS ... Countermeasures Management Switch (grey)
-->
<PropertyList>
<name>Thustmaster Joystick - HOTAS Warthog</name>
<nasal>
<command>nasal</command>
<script>
var this = cmdarg().getParent();
var popup = func gui.popupTip(call(sprintf, arg));
var is_helicopter = (var _ = props.globals.getNode("rotors", 0)) != nil and _.getAttribute("children");
var aircraft_type = getprop("/sim/type");
var overlay = getprop("/input/joysticks/overlay");
var load_overlay = func(name) {
foreach (var dir; [getprop("/sim/fg-home"), getprop("/sim/fg-root")]) {
var file = dir ~ "/Input/Joysticks/ThrustMaster/Warthog/Joystick/" ~ name ~ ".xml";
if (io.stat(file) != nil) {
printlog("info", "WARTHOG: loading overlay " ~ file);
cmdarg().getNode("script").setValue("");
io.read_properties(file, this);
props.runBinding(cmdarg());
break;
}
}
}
foreach (var b; this.getChildren("button")) {
if (b.getAttribute("children") == 1) {
var name = b.getNode("name", 1).getValue() or "??";
b.setValues({binding: {command: "nasal", script: 'popup("' ~ name ~ '")'}});
}
}
var mod = 0;
var _ = props.globals.initNode("/devices/status/joysticks/warthog/modifier", mod, "INT");
setlistener(_, func(n) mod = n.getValue());
var trimstep = 0.75;
var viewstep = 0.5;
var reset_zoom = func setprop("/sim/current-view/field-of-view", 55);
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");
if (is_helicopter)
load_overlay("helicopter");
if (aircraft_type)
load_overlay(aircraft_type);
if (overlay)
load_overlay(overlay);
load_overlay(getprop("/sim/aircraft"));
</script>
</nasal>
<axis n="0">
<name>X-axis</name>
<desc>aileron</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/controls/flight/aileron</property>
</binding>
</axis>
<axis n="1">
<name>Y-axis</name>
<desc>elevator</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/controls/flight/elevator</property>
<factor type="double">-1.0</factor>
</binding>
</axis>
<axis n="2">
<name>Trim Hat Switch Left/Right</name>
<desc>adjust aileron trim, +mod: reset aileron trim</desc>
<low>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (mod)
setprop("/controls/flight/aileron-trim", 0);
else
controls.aileronTrim(-trimstep);
</script>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (mod)
setprop("/controls/flight/aileron-trim", 0);
else
controls.aileronTrim(trimstep);
</script>
</binding>
</high>
</axis>
<axis n="3">
<name>Trim Hat Switch Down/Up</name>
<desc>adjust elevator trim, +mod: reset elevator trim</desc>
<low>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (mod)
setprop("/controls/flight/elevator-trim", 0);
else
controls.elevatorTrim(trimstep);
</script>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (mod)
setprop("/controls/flight/elevator-trim", 0);
else
controls.elevatorTrim(-trimstep);
</script>
</binding>
</high>
</axis>
<button n="0">
<name>Trigger Button/Half Pushed</name>
<desc>camera oper</desc>
</button>
<button n="1">
<name>Weapons Release</name>
</button>
<button n="2">
<name>Nosewheel Steering Button</name>
</button>
<button n="3">
<name>Paddle Switch</name>
<desc>modifier button</desc>
<binding>
<command>property-assign</command>
<property>/devices/status/joysticks/warthog/modifier</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/devices/status/joysticks/warthog/modifier</property>
<value>0</value>
</binding>
</mod-up>
</button>
<button n="4">
<name>Master Mode Control Button</name>
</button>
<button n="5">
<name>Trigger Button/Fully Pushed</name>
<desc>gun trigger</desc>
<binding>
<command>nasal</command>
<script>controls.trigger(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.trigger(0)</script>
</binding>
</mod-up>
</button>
<button n="6">
<name>left black curosr (TMS) up</name>
<desc>zoom in, +mod: reset zoom</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (mod)
reset_zoom();
else
view.decrease(1);
</script>
</binding>
</button>
<button n="7">
<name>left black cursor (TMS) right</name>
<desc>next active view, +mod: next view</desc>
<binding>
<command>nasal</command>
<script>view.stepView(1, mod)</script>
</binding>
</button>
<button n="8">
<name>left black cursor (TMS) down</name>
<desc>zoom out, +mod: reset zoom</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (mod)
reset_zoom();
else
view.increase(1);
</script>
</binding>
</button>
<button n="9">
<name>left black cursor (TMS) left</name>
<desc>previous active view, +mod: previous view</desc>
<binding>
<command>nasal</command>
<script>view.stepView(-1, mod)</script>
</binding>
</button>
<button n="10">
<name>right black cursor (DMS) up</name>
<desc>brakes</desc>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(0)</script>
</binding>
</mod-up>
</button>
<button n="11">
<name>right black cursor (DMS) right</name>
<desc>brakes right</desc>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(1, 1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(0, 1)</script>
</binding>
</mod-up>
</button>
<button n="12">
<name>right black cursor (DMS) down</name>
<desc>toggle parking brake</desc>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
var i = controls.applyParkingBrake(1);
popup("Parking Brake %s", i ? "ON" : "OFF");
controls.applyBrakes(0);
</script>
</binding>
</mod-up>
</button>
<button n="13">
<name>right black cursor (DMS) left</name>
<desc>brakes left</desc>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(1, -1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(0, -1)</script>
</binding>
</mod-up>
</button>
<button n="14">
<name>grey cursor (CMS) up</name>
<desc>view up</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>view.panViewPitch(viewstep)</script>
</binding>
</button>
<button n="15">
<name>grey cursor (CMS) right</name>
<desc>view right</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>view.panViewDir(viewdir[view.index] * viewstep)</script>
</binding>
</button>
<button n="16">
<name>grey cursor (CMS) down</name>
<desc>view down</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>view.panViewPitch(-viewstep)</script>
</binding>
</button>
<button n="17">
<name>grey cursor (CMS) left</name>
<desc>view left</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>view.panViewDir(-viewdir[view.index] * viewstep)</script>
</binding>
</button>
<button n="18">
<name>grey cursor (CMS) push</name>
<desc>center view, +mod: centered cockpit view</desc>
<binding>
<command>nasal</command>
<script>
if (mod)
setprop("/sim/current-view/view-number", 0);
view.resetView();
</script>
</binding>
</button>
</PropertyList>

View file

@ -0,0 +1,472 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2011 Melchior FRANZ mfranz # aon : at
This driver supports joystick overlay files (see ./Warthog/README).
-->
<PropertyList>
<name>Thrustmaster Throttle - HOTAS Warthog</name>
<nasal>
<command>nasal</command>
<script>
var this = cmdarg().getParent();
var popup = func gui.popupTip(call(sprintf, arg));
var is_helicopter = (var _ = props.globals.getNode("rotors", 0)) != nil and _.getAttribute("children");
var aircraft_type = getprop("/sim/type");
var overlay = getprop("/input/joysticks/overlay");
var load_overlay = func(name) {
foreach (var dir; [getprop("/sim/fg-home"), getprop("/sim/fg-root")]) {
var file = dir ~ "/Input/Joysticks/ThrustMaster/Warthog/Throttle/" ~ name ~ ".xml";
if (io.stat(file) != nil) {
printlog("info", "WARTHOG: loading overlay " ~ file);
cmdarg().getNode("script").setValue("");
io.read_properties(file, this);
props.runBinding(cmdarg());
break;
}
}
}
foreach (var b; this.getChildren("button")) {
if (b.getAttribute("children") == 1) {
var name = b.getNode("name", 1).getValue() or "??";
b.setValues({binding: {command: "nasal", script: 'popup("' ~ name ~ '")'}});
}
}
var mod = 0;
var _ = props.globals.initNode("/devices/status/joysticks/warthog/modifier", mod, "INT");
setlistener(_, func(n) mod = n.getValue());
var left_engines = [0, 2, 4, 6, 8, 10];
var right_engines = [1, 3, 5, 7, 9, 11];
load_overlay("generic");
if (is_helicopter)
load_overlay("helicopter");
if (aircraft_type)
load_overlay(aircraft_type);
if (overlay)
load_overlay(overlay);
load_overlay(getprop("/sim/aircraft"));
</script>
</nasal>
<axis n="0">
<name>Mouse Horizontal</name>
</axis>
<axis n="1">
<name>Mouse Vertical</name>
</axis>
<axis n="2">
<name>Right Throttle</name>
<desc>right throttle</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>nasal</command>
<script>controls.perEngineSelectedAxisHandler(0)(right_engines)</script>
</binding>
</axis>
<axis n="3">
<name>Left Throttle</name>
<desc>left throttle</desc>
<number>
<unix>3</unix>
<mac>3</mac>
<windows>5</windows>
</number>
<tolerance>0.00001</tolerance>
<binding>
<command>nasal</command>
<script>controls.perEngineSelectedAxisHandler(0)(left_engines)</script>
</binding>
</axis>
<axis n="4">
<name>Friction Wheel</name>
<desc>rudder trim</desc>
<number>
<unix>4</unix>
<mac>4</mac>
<windows>6</windows>
</number>
<binding>
<command>property-scale</command>
<property>/controls/flight/rudder-trim</property>
<factor type="double">-1</factor>
<power type="int">2</power>
</binding>
</axis>
<axis n="5">
<name>Hat Switch Horizontal</name>
<desc>adjust mixture: left = leaner, right = fatter</desc>
<number>
<unix>5</unix>
<mac>5</mac>
<windows>3</windows>
</number>
<low>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.adjMixture(-1)</script>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.adjMixture(1)</script>
</binding>
</high>
</axis>
<axis n="6">
<name>Hat Switch Vertical</name>
<desc>adjust propeller pitch: forward = increase, backward = decrease</desc>
<number>
<unix>6</unix>
<mac>6</mac>
<windows>4</windows>
</number>
<low>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.adjPropeller(1)</script>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.adjPropeller(-1)</script>
</binding>
</high>
</axis>
<button n="0">
<name>Mouse Button</name>
</button>
<button n="1">
<name>MIC Switch Push</name>
<desc>Push To Talk (PTT)</desc>
<binding>
<command>nasal</command>
<script>controls.ptt(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.ptt(0)</script>
</binding>
</mod-up>
</button>
<button n="2">
<name>MIC Switch Up</name>
</button>
<button n="3">
<name>MIC Switch Forward</name>
</button>
<button n="4">
<name>MIC Switch Down</name>
</button>
<button n="5">
<name>MIC Switch Aft</name>
</button>
<button n="6">
<name>Speedbrake Forward</name>
</button>
<button n="7">
<name>Speedbrake Aft</name>
</button>
<button n="8">
<name>Boat Switch Forward</name>
</button>
<button n="9">
<name>Boat Switch Aft</name>
</button>
<button n="10">
<name>China Hat Forward</name>
</button>
<button n="11">
<name>China Hat Aft</name>
</button>
<button n="12">
<name>Pinky Switch Forward</name>
</button>
<button n="13">
<name>Pinky Switch Aft</name>
</button>
<button n="14">
<name>Left Throttle Button</name>
</button>
<button n="15">
<name>Engine Fuel Flow Left</name>
<desc>engine fuel flow left</desc>
<binding>
<command>nasal</command>
<script>
foreach (var i; left_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/fuel-pump", 1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
foreach (var i; left_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/fuel-pump", 0);
</script>
</binding>
</mod-up>
</button>
<button n="16">
<name>Engine Fuel Flow Right</name>
<desc>engine fuel flow right</desc>
<binding>
<command>nasal</command>
<script>
foreach (var i; right_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/fuel-pump", 1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
foreach (var i; right_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/fuel-pump", 0);
</script>
</binding>
</mod-up>
</button>
<button n="17">
<name>Engine Operate Left MOTOR</name>
<desc>engine operate left motor (magnetos)</desc>
<binding>
<command>nasal</command>
<script>
foreach (var i; left_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/magnetos", 1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
foreach (var i; left_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/magnetos", 0);
</script>
</binding>
</mod-up>
</button>
<button n="18">
<name>Engine Operate Right MOTOR</name>
<desc>engine operate right motor (magnetos)</desc>
<binding>
<command>nasal</command>
<script>
foreach (var i; right_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/magnetos", 1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
foreach (var i; right_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/magnetos", 0);
</script>
</binding>
</mod-up>
</button>
<button n="19">
<name>APU Start</name>
<desc>APU (auxiliary power unit) on/off</desc>
<binding>
<command>property-assign</command>
<property>/controls/electric/APU-generator</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/controls/electric/APU-generator</property>
<value>0</value>
</binding>
</mod-up>
</button>
<button n="20">
<name>Landing Gear Horn Silence Button</name>
</button>
<button n="21">
<name>Flaps Up</name>
<desc>flaps up</desc>
<binding>
<command>nasal</command>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="22">
<name>Flaps Down</name>
<desc>flaps down</desc>
<binding>
<command>nasal</command>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="23">
<name>EAC Switch</name>
</button>
<button n="24">
<name>RADAR ALT</name>
</button>
<button n="25">
<name>Autopilot (Dis)Engage</name>
</button>
<button n="26">
<name>Autopilot PATH</name>
<binding>
<command>nasal</command>
<script>popup("autopilot path")</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>popup("autopilot alt/hdg")</script>
</binding>
</mod-up>
</button>
<button n="27">
<name>Autopilot ALT</name>
<binding>
<command>nasal</command>
<script>popup("autopilot alt")</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>popup("autopilot alt/hdg")</script>
</binding>
</mod-up>
</button>
<button n="28">
<name>Right Throttle Idle Switch</name>
<desc>right engines cutoff</desc>
<binding>
<command>nasal</command>
<script>
foreach (var i; right_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/cutoff", 1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
foreach (var i; right_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/cutoff", 0);
</script>
</binding>
</mod-up>
</button>
<button n="29">
<name>Left Throttle Idle Switch</name>
<desc>left engines cutoff</desc>
<binding>
<command>nasal</command>
<script>
foreach (var i; left_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/cutoff", 1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
foreach (var i; left_engines)
setprop("/controls/engines/engine[" ~ i ~ "]/cutoff", 0);
</script>
</binding>
</mod-up>
</button>
<button n="30">
<name>Engine Operate Left IGN</name>
<desc>start left engines</desc>
<binding>
<command>nasal</command>
<script>call(controls.startEngine, [1] ~ left_engines)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>call(controls.startEngine, [0] ~ left_engines)</script>
</binding>
</mod-up>
</button>
<button n="31">
<name>Engine Operate Right IGN</name>
<desc>start right engines</desc>
<binding>
<command>nasal</command>
<script>call(controls.startEngine, [1] ~ right_engines)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>call(controls.startEngine, [0] ~ right_engines)</script>
</binding>
</mod-up>
</button>
</PropertyList>

View file

@ -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();

View file

@ -411,24 +411,29 @@ var OverlaySelector = {
m.sortprop = relpath(sortprop or nameprop);
m.mpprop = mpprop;
m.callback = callback;
m.title = title;
m.dialog_name = name;
m.result = data.initNode("result", "");
m.listener = setlistener(m.result, func(n) m.select(n.getValue()));
m.prop.getNode("group/text/label").setValue(title);
m.prop.getNode("group/button/binding/script").setValue('gui.Dialog.instance["' ~ name ~ '"].close()');
m.list = m.prop.getNode("list");
m.list.getNode("property").setValue(m.result.getPath());
if (m.mpprop != nil)
aircraft.data.add(m.nameprop);
m.rescan();
m.current = -1;
m.select(getprop(m.nameprop) or "");
m.reinit();
# need to reinit again, whenever the GUI is reloaded
m.reinit_listener = setlistener("/sim/signals/reinit-gui", func(n) m.reinit());
return m;
},
reinit: func {
me.prop.getNode("group/text/label").setValue(me.title);
me.prop.getNode("group/button/binding/script").setValue('gui.Dialog.instance["' ~ me.dialog_name ~ '"].close()');
me.list = me.prop.getNode("list");
me.list.getNode("property").setValue(me.result.getPath());
me.rescan();
me.current = -1;
me.select(getprop(me.nameprop) or "");
},
del: func {
removelistener(me.listener);
removelistener(me.reinit_listener);
},
rescan: func {
me.data = [];

View file

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!--
************************************************************************
Some things that ATC likes to know about.
Durk Talsma Sept-17, 2011.
************************************************************************
-->
<PropertyList>
<sim>
<atc>
<acradius type="double">41</acradius>
<flight-type type="string">gate</flight-type>
<airline type="string">NONE</airline>
</atc>
</sim>
</PropertyList>

18
Startup/c172p.xml Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!--
************************************************************************
Some things that ATC likes to know about.
Durk Talsma Sept-17, 2011.
************************************************************************
-->
<PropertyList>
<sim>
<atc>
<acradius type="double">5</acradius>
<flight-type type="string">ga</flight-type>
<airline type="string">NONE</airline>
</atc>
</sim>
</PropertyList>

View file

@ -182,6 +182,10 @@ command interface /autopilot/route-manager/input:
<vrule/>
<group>
<layout>vbox</layout>
<stretch>true</stretch>
<map>
<!-- <halign>fill</halign> -->
<valign>fill</valign>
@ -192,6 +196,46 @@ command interface /autopilot/route-manager/input:
<property>/gui/map</property>
</map>
<hrule/>
<group>
<layout>hbox</layout>
<button>
<legend>-</legend>
<pref-width>22</pref-width>
<pref-height>22</pref-height>
<binding>
<command>property-adjust</command>
<property>/gui/map/zoom</property>
<min>0</min>
<step>-1</step>
</binding>
</button>
<text>
<label>MMM</label>
<format>Zoom %d</format>
<property>/gui/map/zoom</property>
<live>true</live>
</text>
<button>
<legend>+</legend>
<pref-width>22</pref-width>
<pref-height>22</pref-height>
<binding>
<command>property-adjust</command>
<property>/gui/map/zoom</property>
<step>1</step>
<max>12</max>
</binding>
</button>
</group>
</group>
</group>
</PropertyList>