1
0
Fork 0
Commit graph

192 commits

Author SHA1 Message Date
mfranz
7d0fe51b9f first stab at nasal debugging helper module (nicks parts for files from
the Nasal repository :-)
2007-01-28 12:20:18 +00:00
mfranz
04de5c67c8 - add all entries in /sim/aircraft-data/path[*] to the save-list, so that one
can also write

      <sim>
          <aircraft-data>
              <path>/sim/author</path>
              <path>/sim/description</path>
              <path>/sim/rtatus</path>
          </aircraft-data>
      </sim>

  in a *-set.xml file instead of using Nasal (aircraft.data.add("/sim/author", ...)
- s/timeN/node/ to match the pattern described in the head comment
- make listener on-shot
2007-01-26 23:33:25 +00:00
mfranz
e3d90ee46c - don't prepend underscore to aircraft names (this was a leftover from
versions that wrote that name to the property tree)
- move HUD part to the bottom. It isn't really part of the library
- cleanup
2007-01-23 17:29:41 +00:00
mfranz
b47d2e2204 respect /sim/startup/save-on-exit 2007-01-22 19:05:35 +00:00
mfranz
97771b69ae - save aircraft data before the aircraft's Nasal files are executed
- make 0 a valid saving interval, and 'nil' or no arg stop the loop
  (this is for consistency with settimer() or aircraft.timer() intervals
- smaller fixes, cleanup
2007-01-22 16:49:28 +00:00
mfranz
f376ea5adb use /sim/signals/nasal-dir-initialized signal to simplify things 2007-01-22 00:03:07 +00:00
mfranz
bf7731c0af use /sim/signals/nasal-dir-initialized signal for library initialization;
this makes it possible to use screen.log.write() everywhere in aircraft
nasal files, not only after settimer(func{}, 0) were triggered
2007-01-21 20:56:25 +00:00
mfranz
977910c258 we can't use the setlistener() wrapper here, but need the real thing 2007-01-21 20:44:55 +00:00
mfranz
f61969ed01 add timer class that optionally saves time in the aircraft data file,
restores this time at next run and continues from this value. This is
meant for operation hour counters (Hobbs meters) for turbines, etc.
2007-01-21 20:06:05 +00:00
mfranz
722f35903d only save before the reset is executed, so we can save e.g. the Hobbs time 2007-01-21 00:21:53 +00:00
mfranz
ec18defa4c the dummy entry is no longer needed; files get only written if they
actually contain aircraft settings
2007-01-20 23:13:54 +00:00
mfranz
a73972512d add class for saving data into aircraft specific files
in ~/.fgfs/aircraft-data/ or %APPDATA%\flightgear.org\aircraft-data\
2007-01-20 20:15:06 +00:00
mfranz
51712052e1 this file is broken by design. Fixing the Nasal error apparently
overstrains it, so here's the error back. Have fun!  :-|
2007-01-13 22:37:38 +00:00
mfranz
4690b3c2c3 totally pointless mini-optimization 2007-01-13 21:46:07 +00:00
mfranz
f58fcdd492 make sure the property doesn't only exist, but is actually initialized 2007-01-13 18:35:22 +00:00
mfranz
7b6205d37b add props.Node.getAttribute() and props.Node.setAttribute() methods.
Examples:
  var tied = foo.getAttribute("TIED");
  foo.setAttribute("USERARCHIVE", 1);

Both methods accept attribute strings "READ", "WRITE", "ARCHIVE",
"TRACE_READ", "TRACE_WRITE", and "USERARCHIVE". getAttribute() does
additionally accept "TIED" (although this isn't an SGPropertyNode::Attribute).
Attribute "REMOVED" is not supported.
2007-01-12 18:06:50 +00:00
mfranz
41a756a6ba light class: make the first time-value always "on", even for odd numbered
light pattern. This is more robust and doesn't need the reinit listener.
2006-12-13 16:15:27 +00:00
mfranz
923f2b7299 - fix index and restart loop on reinit
- cosmetics
2006-12-12 22:42:52 +00:00
mfranz
30ce4f68c2 - make register() method more tolerant
- cosmetics
2006-12-11 18:37:10 +00:00
mfranz
ddc4b4c8e5 fix lookat() method (didn't consider unmanaged view "goals") 2006-12-10 23:09:42 +00:00
mfranz
bfacf76538 change per-aircraft configuration to a single function object that is
registered with dynamic_view.register() and is called in the main loop,
replacing the default plane/helicopter function. This has access to
all class functions/members and sets me.heading_offset, me.pitch_offset,
and me.roll_offset, which are then used as new view offsets.
The function can also do other things, such as call the lookat() method
to temporarily set heading and pitch. See the bo105 for an example.

While further minor changes are to be expected, the configuration method
seems to be the way to go.
2006-12-10 21:50:59 +00:00
mfranz
0529f66842 - first stab at making dynamic view parameters configurable on a per-aircraft
basis; see bo105.nas for an example; expect some changes, though
- move "lookat" feature here from bo105.nas (used by "flaps up" bindings)
2006-12-09 22:42:13 +00:00
mfranz
354a0f59ff make if-branch for helicopters (bo105 settings) and for everything else;
this *really* needs to be made configurable and less hackish
2006-12-07 22:38:07 +00:00
mfranz
28323bcec8 new light.new() arguments with light pattern array; error message for old
style args
2006-12-06 15:58:03 +00:00
mfranz
cb9361b067 showHelpDialog: automatically split the contents of a <line> block at
newlines
2006-12-06 00:24:48 +00:00
mfranz
a5aae32cc1 whoops; fix return value 2006-12-05 19:32:44 +00:00
mfranz
2cb4354814 - fix switch() method
- optimization (and code obfuscation ;-)
2006-12-05 19:17:17 +00:00
mfranz
eff0eecb8f lowpass: add set() method to set current average
light: - only trigger switch action if switch state actually changed
       - simplify loop
2006-12-04 10:42:05 +00:00
mfranz
c5ac5639a0 reset view after reinit (slowly, because the lowpass filters need to catch up) 2006-12-03 23:59:50 +00:00
mfranz
89710547ec Use a listener to watch the aircraft.light switch. This is slightly more
efficient and there's no more potential 0.5 s delay.
2006-12-03 22:20:16 +00:00
mfranz
4ae3ab11df don't silently fix bad user input -- complain loudly 2006-11-04 11:33:08 +00:00
mfranz
2145558999 documentation fix 2006-11-03 19:39:08 +00:00
mfranz
dabf3f300c - aircraft.nas: add variable-interval EWMA lowpass filter class
- dynamic_view.nas: use aircraft.lowpass() class

This makes the dynamic view independent of the frame rate. Currently,
each filter instance reads out dt on its own, which is a bit inefficient.
I'll change that to just one read for all instances later (when Nasal
implemented predictable module loading order. :-)
2006-11-03 17:38:32 +00:00
mfranz
0ff3f5da2b boring cleanup 2006-11-02 21:06:36 +00:00
mfranz
07e3e2b05b - minor fix
- add info/debug messages
2006-10-31 13:59:50 +00:00
mfranz
ae1df38643 better atc-message repetition (Remember: '+'-key) 2006-10-31 12:19:42 +00:00
mfranz
76e6f5247a disable joystick info dialog if no js available 2006-10-21 10:19:24 +00:00
mfranz
82c4dd05ed - replace indentation tabs with spaces
- fix sliders: revisions 1.43/1.44 had introduced a mandatory <min-lb>;
  if that was missing, a slider without handle was generated, and a click
  on the slider lead to a crash.
  -> check for both <min-lb> and <max-lb> and set default values
     0, respectively 100

  var min = w.getNode("min-lb", 1).getValue();
  var max = w.getNode("max-lb", 1).getValue();
  slider.set("min", min != nil ? min : 0);
  slider.set("max", max != nil ? max : 100);
2006-10-17 19:22:36 +00:00
frohlich
9c52cbf4ac Modified Files:
preferences.xml gui/menubar.xml gui/dialogs/rendering.xml
Added Files:
	Nasal/multiplayer.nas gui/dialogs/chat.xml
	gui/dialogs/chat_full.xml:
	the data part of Stuarts multiplayer/chat patch
2006-10-10 05:23:38 +00:00
mfranz
aad61698ff fix property_browser() 2006-08-27 19:27:21 +00:00
andy
d9ff131805 Oops, wrong sense of create predicte. Melchior was peeved. 2006-08-27 16:45:54 +00:00
andy
e2de2b4093 Melchior discovered an interpreter bug that is fixed (or seems to be
-- I need to verify) in current Nasal CVS.  Commit a workaround for
now.  Basically: don't return a tail call from a foreach.
2006-08-27 16:22:06 +00:00
mfranz
1f57ea72b4 a global symbol must not only *contain* __dlg:property_browser, but
start with it. ("__dlg:" is the namespace prefix for Nasal embedded
in XML dialogs. Subsequent property browsers get a random number added.)
2006-08-26 13:23:06 +00:00
mfranz
74b5436cde call Dialog.load() from the new() constructor already 2006-08-25 20:13:58 +00:00
andy
b6fb9d031a Further augment the weight subsystem so that weights can be tagged with
tank indices, so that changing drop tanks automatically modifies the
corresponding FDM tank capacity (and load, if it is too high).

Add the new tank stuff to the harrier config, along with a few new
items (e.g. AMRAAMs on the outboard pylons) that aren't in the 3D
model yet, but correspond to actual usage.
2006-08-25 19:59:05 +00:00
andy
3e268e394c [Yes, Andy's writing code again. The world is ending.]
An IRC discussion about shavlir's (really nice) harrier model showed
that it had its own version of something like the Fuel & Weight
dialog, developed because the existing subsystem only supported
sliders and not "combo box" style selection for specific external
stores.  That seemed sub-optimal, so I spent a few hours extending the
F&W dialog to do this and forward-ported the harrier to use it.

Check the harrier-set.xml file for an example.  Basically, the weight
dialog reads a list of options for each weight listed under
/sim/weight[n] and manages a "selected" proprty telling us which one
is in use.  The FDM code can then read out the weight-lb property as
before, and the model animations can use the selected option to
predicate drawing the appropriate 3D content.  It seems to work pretty
well.
2006-08-24 22:29:16 +00:00
mfranz
d27df588a6 reduce slip effect speed (harrier VTOL) 2006-08-24 20:55:18 +00:00
mfranz
b5863d9cad use gui.Dialog() class instead of gui.loadXMLDialog() function (which has
been removed)
2006-08-24 16:32:58 +00:00
mfranz
8aa5947e7a - move bo105's Dialog class here; replaces gui.loadXMLDialog()
- fix indentation
2006-08-24 16:32:09 +00:00
mfranz
d583bbcb4f - add property browser opening function
- open browser for each /browser[] property
- add Widget.setBinding() function to simplify dialog generation, and
  convert the dialogs to use it
2006-08-24 12:44:14 +00:00