1
0
Fork 0
Commit graph

192 commits

Author SHA1 Message Date
mfranz
11dc7c5bcd - let Input class use Lowpass class
- preparation for configurability
- documentation/cleanup
2006-08-22 10:06:46 +00:00
mfranz
f3d14c408a - only allow dynamic view on some fdms, and disable menu entry on others
- decrease heading-due-to-sideslip
2006-08-21 09:45:48 +00:00
mfranz
8ecfdb2a96 add HUD manager class. The old and new HUD code is a bit tedious to handle
in keyboard.xml. Better concentrate that on one place.
2006-08-21 08:35:53 +00:00
curt
a6ebef1d0a Make lead aircraft behavior more uniform/predictable/repeatable. 2006-08-20 00:54:53 +00:00
mfranz
07f5dd24f3 use sideslip for heading offset in-air, and heading change rate on-ground.
Unfortunately, this is quite jittery on some aircraft, so it uses a slower
lowpass filter. I'd like to fix that, but don't even know what causes it.
Considering /sim/time/delta-realtime-sec didn't help.  :-/
2006-08-19 22:24:24 +00:00
mfranz
28a7b8cb6b - initialize a few properties that can be nil at startup
- start script at settimer(..., 0)
- fix heading mistake
- cleanup
2006-08-18 17:00:16 +00:00
mfranz
3f9bdb62ab fix property name (I had changed that in the environment files, and
apparently missed this instance when I searched for its use)
2006-08-18 15:50:53 +00:00
mfranz
8a31fbaae4 simpler & faster 2006-08-17 22:58:06 +00:00
mfranz
4099269ab3 using printlog() wasn't a good idea, as we don't know if globals.nas was
already initialized. Commenting the messages out.
2006-08-17 18:56:22 +00:00
mfranz
94835bb4e4 move the listener settings into the timer, as we don't know at that time
if globals.nas was already loaded
2006-08-17 18:53:44 +00:00
mfranz
8b77679c06 - don't update view as long as mouse button 0 is pressed (otherwise closing
the A-10 canopy is a bit difficult :-)
- reduce pitch-due-to-z-accel a bit
2006-08-17 16:42:00 +00:00
andy
591c72f5b4 Comments about -lbs and -gal_us were mixed up. Pounds are the
writable property.  Gallons are a read-only convenience.
2006-08-17 16:32:41 +00:00
mfranz
1a6a1a6436 first stab at generic dynamic view handling; can be turned on/off via menu
entry "View->Toggle Dynamic Cockpit View" entry; state saved to autosave.xml;
there are no configuration parameters yet, but the default values work for
most aircraft; exceptions: ground steering effect of jsbsim aircraft is
jittery; yawing effect on big aircraft is too abrupt. This needs to be
configurable.
Suggestions for improvements are welcome if they are bundled with a
working diff that actually proves the claimed advantages.   :-)
2006-08-17 15:59:44 +00:00
mfranz
ae6108de80 add n/N key binding (is it really called "finer" and "coarser"?) 2006-08-09 14:01:53 +00:00
mfranz
4f90536ea6 shut up 2006-08-09 13:55:48 +00:00
curt
7faa7a1edf Make one small path change (doesn't include Melchior's optimization fixes.) 2006-07-27 04:02:12 +00:00
curt
0ac3b042c2 Also set target true heading along with magnetic heading. 2006-07-26 14:43:22 +00:00
curt
3833703808 Rename to avoid "-" in class name. 2006-07-24 17:53:46 +00:00
mfranz
0246507821 fix indentation 2006-07-20 17:52:55 +00:00
mfranz
ac2225a65f add function that loads dialogs from XML files
(aircraft may prefer to use such dialogs to Nasal-generated ones)
2006-07-14 16:03:43 +00:00
mfranz
1c7e2b404a remove workaround for broken continue 2006-07-03 05:59:24 +00:00
curt
25edaaa068 Initial revision of target tracking script, see script code for operating
instructions.
2006-06-29 00:52:51 +00:00
mfranz
f491fd5291 add interface function for selecting weapons 2006-06-24 12:31:58 +00:00
mfranz
c39b82a4a4 add trigger interface function, to be used by all armed aircraft, so that
there's a unified way for joysticks/kbd bindings to activate weapons
2006-06-09 20:52:03 +00:00
mfranz
249dbd3303 the harrier triggers a Nasal bug: "continue" doesn't execute the "for"
loop's reinitialization part. We have to do that manually for now, or
get caught in an endless loop, until fgfs has mercy and segfaults.
2006-05-25 18:31:00 +00:00
mfranz
af04d04e79 fix rarely occurring bug: if the node isn't initialized, then cap is nil
and can't be compared with a scalar, but only with nil itself
2006-05-12 06:54:16 +00:00
mfranz
35f76bab96 delay menu disabling a bit for props.nas to be able to catch up (?)
(sometimes the AP menu entry didn't get enabled when it should)
2006-04-06 09:49:49 +00:00
mfranz
4a0b56deb3 - now that XML dialogs run their own Nasal namespace and have <open> and
<close> block, remove autopilot helper file autopilot.nas and (re)implement
  its functionality in autopilot.xml
- make AP dialog "bidirectional" and "live": all input fields are <live>
  (i.e. they are updated as the autopilot settings are changed, for example
  by panel actions or property browser changes)
- dialog input is only forwarded to the AP; no direct checkbox/radiobutton
  handling through widget operation, instead:
- changes to the AP properties operate checkboxes/radiobuttons

This makes the AP dialog always reflect the AP state. If the AP refuses
one setting and sets it back to something else, then the dialog will
immediately react and show the actual setting.
2006-04-05 20:24:21 +00:00
mfranz
357dfb3934 move gui styles from /sim/gui[n] to /sim/gui/style[n] to make /sim/gui
free for other gui related properties
2006-03-09 23:05:08 +00:00
mfranz
9d2216d5bc Stuart BUCHANAN: make adjEngControl() only work for selected engines
mf:
- some minor modifications to Stuart's version  :-)
- select all engines per default. This may seem less realistic (who starts
  all engines on the b29 at once?), but it'll prevent oodles of bug reports.
  And those who want it realistic shouldn't rely on engine 1 being selected
  by default, anyway, but rather actively select every single engine.
  Also: this new behavior is in line with the original intentions (see cvs
  log to preferences.xml -r1.51)
2006-03-04 18:21:06 +00:00
mfranz
e8f6224875 add resetFOV function 2006-03-02 16:23:05 +00:00
mfranz
157ae984dc - apply/release brakes smoothly by default
- let applyParkingBrake() return current state
2006-03-01 18:33:46 +00:00
mfranz
7e81d93f28 use wrappers for brakes/parking brake
(js files are to be converted)
2006-03-01 17:04:20 +00:00
mfranz
db731ee480 store listener ids in module hash, so that other modules can remove them:
removelistener(screen.listener["pilot"]);   # try in the Nasal console
2006-02-28 15:25:26 +00:00
mfranz
3e98f8353c cosmetics 2006-02-24 15:54:45 +00:00
mfranz
fa37af573c - let menuEnable() consider all <name>s
- always disable tutorial-stop; enable tutorial-start if tutorial available
- don't call the tutorial selector "Wizard 1/2". There is only one tutorial
  selector, the next dialog is already part of the tutorial. Also, the dialogs
  don't guide you through multi-dialog setup, which is what "wizards" normally
  stand for.
- use tutorial name as dialog title
- set button shortcuts (default == return, esc)
- make esc go back to select dialog
- beautify sliders & some other tweaks
2006-02-24 11:11:09 +00:00
mfranz
783256433a if a tutorial is running, let the '+' make the instructor repeat his
last message; otherwise ATC
2006-02-24 11:05:13 +00:00
mfranz
156de8e0c3 Stuart BUCHANAN: set /sim/tutorial/running; make last message available
mf: add isRunning() function to enable/disable "Stop Tutorial" menu
2006-02-24 11:03:22 +00:00
mfranz
d9bbddfe3d - make menuEnable() operate on all menus/items with that name (don't stop
when the first was found)
- disable tutorial entries if no tutorial is available
2006-02-23 18:52:32 +00:00
mfranz
c1e9de96c7 add "sticky" bool member that make the window class remember its last pos 2006-02-22 17:26:06 +00:00
mfranz
ceeb9503f8 Stuart BUCHANAN:
Nasal/XML based tutorial system
2006-02-22 17:03:42 +00:00
mfranz
3ee8f31785 simplification 2006-02-21 21:38:59 +00:00
mfranz
ba5d916dcb split multiline messages into separate lines;
move default window slightly up
2006-02-21 21:26:49 +00:00
mfranz
bd327892d6 let getBoolValue() actually return a bool 2006-02-20 10:59:52 +00:00
mfranz
cde64c8543 use __ for static variables (one underscore is too handy for use in other
modules to waste it here)
2006-02-18 00:12:09 +00:00
mfranz
f9089e95d6 noise reduction: only print file names if --log-level is at least "info" 2006-02-17 22:20:15 +00:00
mfranz
dc6ab58eaf allow printlog() to be used with variable arg list (like print()):
printlog("warn", "Monty", "Burns");
2006-02-17 22:05:32 +00:00
mfranz
003ae0986f add printlog() function that works like SG_LOG(). It takes two arguments:
a --log-level and a scalar. Example: printlog("info", "I want more noise");
2006-02-17 21:24:08 +00:00
mfranz
7a60fdc1e4 don't map ATC messages to screen and voice interface if /sim/screen/nomap
is "true"; Currently there's no way to remove Nasal listeners, and people
may not have write access to $FG_ROOT/Nasal/screen.nas. Tidy up, too.
2006-02-13 19:52:45 +00:00
mfranz
03c0dee1dc write ATC messages to the screen.log, and map them to the voice interface
properties
2006-02-11 12:05:50 +00:00
mfranz
6462caf7a4 help dialogs: add '+' keydef (let ATC repeat last message) 2006-02-11 10:33:16 +00:00
mfranz
c486d15803 "export" show(); don't add empty lines 2006-02-05 20:43:14 +00:00
mfranz
7dd2f271db use low window font if set, else the <message-display> theme font if set,
else the gui font
2006-02-04 13:31:16 +00:00
mfranz
41000cc513 various fixes; added color message properties 2006-02-03 00:02:26 +00:00
mfranz
5b4067a327 class for creating displays of automatically scrolling log messages;
one is created in the file and can be used as screen.log.write("message")
2006-02-02 23:34:16 +00:00
mfranz
525abca88d use setlistener()'s 3rd argument to open the fps display initially 2006-02-02 18:04:59 +00:00
mfranz
1ee5cea2f9 revert for now: there's one nasal interpreter problem left to solve first 2006-01-30 15:35:00 +00:00
mfranz
40621a028f use optional setlistener() arg 2006-01-30 15:04:42 +00:00
mfranz
714504b548 support optional setlistener() arg to fire callback function initially;
copy arg checking from interpolate()
2006-01-30 12:37:34 +00:00
mfranz
a1746e9f77 re-position FPS display on window resizing 2006-01-28 11:17:04 +00:00
curt
2c9ff12c17 Make ATC chatter script less verbose, especially when chatter turned off. 2006-01-14 17:30:55 +00:00
curt
a3c96d105c Be smarter about only attempting to play .wav files. 2006-01-10 02:57:32 +00:00
curt
7230b22fed Make it easy to adjust the pacing interval for ATC chatter messages. 2006-01-09 19:11:04 +00:00
curt
9d271d7e7c Add better protection against trying to play "." and ".." after scanning a
directory listing.
2006-01-09 15:18:16 +00:00
curt
5c6a9d76f0 Initial revision. 2006-01-09 14:39:33 +00:00
mfranz
e6ba63050e open fps dialog initially 2005-12-21 10:41:22 +00:00
mfranz
06fa115d86 add function that recursively copies property tree branches (ignoring aliases);
reviewed and OK'ed by Andy
2005-12-16 20:25:52 +00:00
mfranz
523b81e317 globals.nas: add _setlistener wrapper (needs to be used in INIT style
functions when used in $FG_ROOT/Nasal/*.nas, because it
             depends on props.nas being available; no restrictions in
             aircraft files, where it will proof most useful

gui.nas:     replace inefficient FPS display polling loop with listener
             callback
2005-12-16 19:15:08 +00:00
mfranz
df6d7171a6 - fps.xml: revive the traditional font color (a bit brighter than pure red)
- gui.nas: use 4-space indents like the rest of the file; waste slightly less
           cycles: checking for the property shouldn't be done in a loop at
           all, it only serves as a temporary solution
2005-12-16 12:14:43 +00:00
mfranz
fbd735408d implement frame rate display as transparent & draggable dialog
(ordered by Curt as Christmas present :-)
2005-12-15 22:00:31 +00:00
mfranz
defedcc961 use <hrule> instead of fake line; clean-up 2005-12-11 15:38:35 +00:00
mfranz
b8886814ec Access menu entries by their name. This way we can avoid fragile absolute
paths. (The label text isn't suitable for this, because it's subject to
translation.)
2005-12-09 10:34:43 +00:00
mfranz
7e982f91c2 disable "Autopilot" menu when using KAP140 2005-12-08 22:51:23 +00:00
mfranz
9af4695c3c - enable "Fuel & Payload" menu entry when YASim FDM is used
- indentation fix
2005-12-06 17:57:41 +00:00
andy
8a3d81fe0e Architectural fix allowing the "tip" popups (FOV, view name, etc...)
to pop themselves down while the simulator is paused.

The problem was with the "real time" queue in the event manager,
causing the third argument of Nasal's settimer() (a flag for "sim
time") to be ignored.  Inverts the default sense of the argument, as
there are lots of uses of settimer() in the current code, almost none
of which want to use real time.

Note this fix introduces a header file incompatibility in SimGear --
be sure to update.
2005-11-09 20:35:07 +00:00
mfranz
7a3799a241 use gui-redraw fgcommand 2005-11-09 17:17:51 +00:00
mfranz
a3984ccabd make <Esc> key close/cancel/dismiss dialogs; some material.nas tweaking
(Reminder: --aircraft=bo105 ... press Ctrl-C  :-)
2005-11-05 14:19:53 +00:00
mfranz
7f25352610 add support for removeChildren(): takes one name as optional argument
and removes all children with this name; if no name is given, removes
all children
2005-10-23 16:09:51 +00:00
mfranz
8c1e2a6499 make hrule thickness consistent with all other dialogs 2005-10-21 15:36:33 +00:00
andy
ca5982c16c From Vassilii Khachaturov: pop up a user-visible dialog when the FDM doesn't
support dynamic fuel/W&B.
2005-10-18 20:15:04 +00:00
curt
4100dc0f7b gearDown() expects a number either < 0 or > 0 to specify the direction of
gear movement.  gearToggle() was sending either a 0 (not handled) or a 1.
Change gearToggle() so it sends either -1 and 1 so gearToggle() will work
again.
2005-09-09 01:41:08 +00:00
mfranz
dc45f751bf - consider F10/F9 key changes in help screens
- put hrule under titlebar
2005-07-13 11:30:32 +00:00
mfranz
02ca61961d allow to cycle through available styles 2005-07-13 10:56:42 +00:00
mfranz
0f97cfccdf slightly more effective stop() method 2005-06-30 00:18:20 +00:00
andy
f1c70da6d4 Fix interpolate() so that interpolate("/prop/name") freezes the
interpolation at the current value.  This was always a feature of the
C++ code, but the Nasal wrapper couldn't handle the empty argument
list.
2005-06-29 23:58:58 +00:00
mfranz
17166921c0 - rename controls.stepFlaps() to controls.flapsDown(), because:
- to support "old-style" gear/flap control (operation as long as button
  pressed/lever pushed -> b29/hurricane), let bindings not only report
  up/down, but up (-1), stop (0), down (1).
- let controls.flapsDown() ignore "stop" so as to remain compatible with
  prior behavior
- adapt all joysticks/aircraft (sigh)
- some minor cosmetics in joystick configs, such as indentation fixes
2005-06-22 13:08:01 +00:00
mfranz
1988fbb089 Jim Campbell: add carb-heat axis support 2005-06-20 16:52:58 +00:00
mfranz
f4a90a615e add controls.gearToggle() convenience function; adapt all joystick files
to new controls function
2005-06-16 07:59:33 +00:00
mfranz
7cc31829a3 add one level of indirection for gear down/up and use that in all bindings,
so that aircraft with special requirements (hurricane) can simply redefine
controls.gearDown() without breaking all joystick setups
2005-06-16 07:36:54 +00:00
andy
57eea1be61 Melchior needs an equivalent of Perl's defined() function to test for
double-initialization of joystick blocks.  So here it is.
2005-06-12 18:17:00 +00:00
mfranz
b2348ece53 consider changed "material" animation syntax, ignoring the transparency's
new factor/offset properties for now
2005-05-24 12:11:31 +00:00
mfranz
4d185f250c - add gui.Widget.setFont(name, size=13, slant=0) method, and use it in
material.nas (fly the bo105 and press Ctrl-c to see font & color changes)
- use new Nasal feature:  i=i+1 --> i+=1
2005-05-03 13:45:33 +00:00
mfranz
c1be4e53b2 add gui.Widget.setColor() method: takes red/green/blue as mandatory, and
alpha value as optional argument (default: 1)
2005-05-02 16:00:13 +00:00
mfranz
7cecba5024 add 'condition' setter, analogous to 'mixture' etc. 2005-04-21 14:39:00 +00:00
mfranz
da9b28ea6e consider new keys: w/W is now +/- warp, while m/M is richer/leaner mixture 2005-04-20 12:19:27 +00:00
ehofman
ec8742bd65 Melchior FRANZ:
Implement simple help system with global and aircraft specific dialogs:

The gui.nas changes have been discussed with Andy. All ac have a help dialog,
but some are empty. (This wouldn't have been necessary, as the system falls
back to the "Common Aircraft Keys" if an aircraft has no help defined, but an
empty dialog is less confusing and encourages to be filled with interesting
information.   :-)    I scanned all aircraft files for interesting performance
data and added some to the dialogs (stall speed, etc.) The Concorde and the
p51d have (over?)complete dialogs and can serve as examples. The format is
documented in $FG_ROOT/Nasa/gui.nas.

There is also a couple of other, minor fixes.

The following files have ugly MSDOS line endings:

  $FG_ROOT/Aircraft/Hunter/hunter{-2tanks,}-set.xml
  $FG_ROOT/Aircraft/A380/A380-set.xml


The Concorde-jsbsim.nas file is a useless copy of the real */nas file, which is
in Nasal/. I'was debugging the Concorde and wondered why changes to this file
had no effect ...
(Fixed Concorde in the help-ac.diff patch: don't use "interpol" keyword as
variable.)
2005-04-19 13:43:44 +00:00
ehofman
ca224d0ea3 Melchior FRANZ:
- lights are by default off (what was I thinking?!?)
- setters return "me" reference by default, for easier code obfuscation:
  foo = aircraft.light.new("/foo").prop().switch(1);    :-)
- a few mebmers renamed; light.set() -> light.switch(); nodes are named *N
  to avoid collisions and to show relations (switch() <-> switchN)
- yet more (too much?) documentation
2005-04-06 08:18:06 +00:00
curt
b2efcab662 Take advantage of a recent nasal change to simplify a boolean condition. 2005-03-30 19:04:53 +00:00
curt
b0862aa5db A small fix to track latest nasal changes. 2005-03-30 17:00:50 +00:00
ehofman
a978a79d16 Melchior FRANZ:
- light class added (for lights and other pulsing/blinking objects)
- fixed and improved documentation
- all property args may be path strings or nodes
- existing nodes aren't overwritten any more
- better naming of class vars (for outside access)

Tested with the bo105 (which I fully ported to use aircraft.nas) and
the fokker70 (which are the only aircraft using the new classes  :-)
2005-03-30 09:53:00 +00:00