1
0
Fork 0
Commit graph

64 commits

Author SHA1 Message Date
david
807bcfb8e0 Removed debug statement.
Added return statement.
2003-04-05 00:30:38 +00:00
david
7543355d17 Add new property-randomize command.
Set a random value for a numeric property

Params:

  <property> - the name of the property to randomize
  <min> - the minimum allowed value
  <max> - the maximum allowed value
2003-04-04 22:38:35 +00:00
ehofman
4b62426109 Move current_panel to globals 2003-03-30 12:46:08 +00:00
ehofman
37c427558a A first stab at an aircraft selection dialog 2003-03-29 15:04:52 +00:00
curt
db46791c48 Don't start paused for in air starts. 2003-03-29 03:19:35 +00:00
ehofman
ef37b45dc7 Frederic Bouvier's assorted set of MSVC fixes 2003-03-23 09:59:46 +00:00
ehofman
0782e877a9 Add runtime log level support 2003-03-22 10:38:15 +00:00
david
58adf467bf Add a new <power> property to allow raising an axis to a power other
than 1 or 2 (<squared/> still works as well, and is equivalent to
<power>2</power>).
2003-03-01 21:28:51 +00:00
david
9679c7da15 Changed 'exit' command to quit immediately, rather than displaying a
built-in dialog (use an XML dialog instead).

Added an fgExit() function to simplify exit and cleanup.
2003-01-24 03:08:23 +00:00
david
e0c7b29aa7 Added reinit, suspend, and resume commands. 2003-01-21 02:07:29 +00:00
david
40bed0a3f1 Change GUI method names.
Do not delete GUI objects directly; let the GUI manager do it instead.

Simplify some code for readability.
2003-01-20 16:03:48 +00:00
david
6205d5eb1a Do an update after apply to see what really got into FlightGear. 2003-01-19 17:22:05 +00:00
david
013c322dd3 Added the property-cycle command. 2003-01-18 21:13:11 +00:00
david
c10ce7bd26 Renamed GUIWidget to FGDialog. 2003-01-18 15:57:51 +00:00
david
04f1dc4837 Make all PSL support conditional, because it's not included in plib
1.6.  The macro is HAVE_PLIB_PSL.
2003-01-17 12:41:47 +00:00
david
9bbe8a78b6 Added simple proof-of-concept support for running PSL scripts from
input bindings.  They will work only with the latest CVS; otherwise,
./configure will disable them.  There is a new command, 'script',
which takes a single argument, also called 'script', containing PSL
code (currently PSL requires a main() function).

Erik Hofman has written some more elaborate code for triggering PSL
code from drop-down menus and scheduling events; I will look at
integrating that next.
2003-01-11 16:30:32 +00:00
curt
be703a92b4 Add support for in-air preset starts relative to a VOR, NDB, or Fix. 2003-01-05 00:10:36 +00:00
curt
30dc5aab90 Ooops, the presets_commit command was lost going from the 1.8 -> 1.9 version
(Sun Dec 22 19:58:34 2002 UTC)
2003-01-04 21:22:43 +00:00
david
1ec788b6da Patch from Julian Foad to fix wrapping behaviour for property-adjust
and property-multiply:

Firstly, change back to wrapping modulo the interval, with "min <= x <
max" semantics.  I believe the previous implementation did that.  The
inline function that Norman mentioned also does that.

Secondly, make it snap to the nearest value (min + N*resolution) when a
"resolution" tag is present, taking special care of floating-point
precision.  Or perhaps specify "number of divisions in the interval" as
an integer, instead of "resolution" by which I meant a floating-point
"size of a division".

[also fixed]

While working on this file I noticed some potentially serious warnings:

fg_commands.cxx: In function `bool do_property_adjust(const
SGPropertyNode*)':
fg_commands.cxx:435: warning: control reaches end of non-void function
fg_commands.cxx: In function `bool do_property_multiply(const
SGPropertyNode*)':
fg_commands.cxx:465: warning: control reaches end of non-void function
/usr/local/include/simgear/misc/props.hxx: At top level:
fg_commands.cxx:600: warning: `bool do_presets_commit(const
SGPropertyNode*)' defined but not used
2003-01-04 18:47:25 +00:00
david
71f08e795d Patches from Erik Hofman for SGI compatibility:
Some more cmall changes to the SimGear header files and removed the
SG_HAVE_NATIVE_SGI_COMPILERS dependancies from FlightGear.

I've added a seperate JSBSim patch for the JSBSim source tree.
2002-12-31 18:26:02 +00:00
david
e4409c5222 Add the 'offset' and 'factor' arguments back into property-adjust;
they're needed for the mouse.
2002-12-31 12:08:32 +00:00
david
ea6448c956 Modify the property-assign command to optionally copy a value from
another property (suggested by Jim Wilson).
2002-12-31 03:05:38 +00:00
david
0d12c4d83d Removed the (apparently unused) 'factor' and 'offset' arguments from
property-adjust.

Modified property-adjust and property-multiply so that they always
work with double values, to simplify the code.

Factored out some common code.

Added a 'mask' argument to the property-adjust and property-multiply
commands.  If mask is set to "all" (the default), then the command
works as before; if mask is set to "integer", it works only to the
left of the decimal point; and if mask is set to "decimal", it works
only to the right of the decimal place.  This functionality is useful
for tuning VHF COM and NAV radios.
2002-12-30 19:50:17 +00:00
david
a7e56cf399 Added new commands:
- dialog-open
- dialog-close
- dialog-update
- dialog-apply

The last two can copy a value from a property to a GUI field or
vice-versa either individually or across the whole dialog.
2002-12-22 19:58:34 +00:00
curt
1feedec8d1 - Change the global_tile_mgr to a globals->get_tile_mgr() which is
dynamically created at run time.
- Further clean ups to the FGTileMgr class interface.
2002-12-06 22:29:46 +00:00
curt
ebc2fbd684 Exposed the fg_commands though the httpd interface.
Added a built in command to preset to what ever values are in /sim/presets/
Twiddling with preset code.
2002-11-30 20:10:16 +00:00
curt
bcf9fa3695 Massaging the FGTileMgr->update() interface towards using FGLocation. 2002-11-30 03:05:34 +00:00
david
2de88f278b Started new, XML-configurable GUI subsystem. 2002-11-07 16:27:47 +00:00
david
0de065b0ec Added fgLoadProps to load properties from a path relative to FG_ROOT. 2002-11-06 18:57:31 +00:00
david
fa87fe5c1d Modified for simpler command-manager interface. 2002-10-26 01:19:23 +00:00
david
d43dfa54df Major code simplification. 2002-10-25 22:19:51 +00:00
curt
df6989a37a Bernie Bright:
Here is a FGIO class derived from FGSubsystem that replaces the fgIOInit()
and fgIOProcess() functions.  The FGIO::update(double delta) doesn't use the
delta argument yet.  I suspect it could be used as a replacement for the
calculated interval value but I'm not familiar enough with that piece of code
just yet.

I've also added two "command properties" to fg_commands.cxx that select the
next or previous view.  Writing any value to these properties triggers the
corresponding action.  As an example I modified my keyboard.xml:

 <key n="118">
  <name>v</name>
  <desc>Next view</desc>
  <binding>
   <command>property-assign</command>
   <property>/command/view/next</property>
   <value type="bool">true</value>
  </binding>
 </key>

 <key n="86">
  <name>V</name>
  <desc>Prev view</desc>
  <binding>
   <command>property-assign</command>
   <property>/command/view/prev</property>
   <value type="bool">true</value>
  </binding>
 </key>

And of course these actions can also be triggered from external scripts via
the props server.
2002-08-25 20:56:16 +00:00
david
ee8c5d0a3a Patch from Julian Foad:
The present sets of bindings result in the throttle being "squared"
about its centre, which is silly.  This is because the "squared"
parameter is not set by the throttle binding, but the default is
"true".  We discussed this before and I think there was general
agreement that the default should be "false" on the basis of
generality.
2002-07-06 18:02:06 +00:00
curt
8ae364a220 Jim Wilson:
This is a small fix for what turned out to be a major bug.  Ground elevation
was calculated incorrectly when distant from one of the view locations. This
resulted in several problems including bizarre gear trimming, mid air
"crashes" (as in thinking we hit the ground) and so on when close to or on the
ground.

Unfortunately it does require a second ssg traversal when in tower view
(only), but the increased load isn't all that noticable.  For the time being
this really is the best solution.  In a future update I will be eliminating
the unecessary per frame traversals for the static views (without having to
maintain multiple ssgRoots).

When we go to multiple FDM instances we will perhaps need to put the ssg
traversal and ground elevation queries for the FDMs into an event timer that
updates the FDMs ground elevation in a round robin fashion (maybe every 1/n
seconds where n is the number of FDM instances running).
2002-05-20 16:13:37 +00:00
david
56473dc28d Mac OS X fixes and MSVC warning fixes from Jonathan Polley. 2002-05-10 23:35:06 +00:00
david
6e5d22789b Patches from Norm Vine to improve framerate and add a new
#ifdef'ed-out mode for syncing fullscreen with user settings in
Windows.
2002-04-07 15:24:32 +00:00
david
8d9b59314a More cleanups. Removed the pui-* commands, and added a pass-through
property to indicate when mouse events should be offset to PUI and the
panel first.
2002-03-26 17:14:48 +00:00
david
db7013c83a More work on the configurable mouse. Mouse motion is now configurable
as well as mouse clicks.  You must configure with --with-new-mouse to
get this.
2002-03-26 13:45:44 +00:00
curt
0a035c7f36 Oops, in the latest property manager rewrite, a typo crept in on
somewhat of a global scale.  This commit should fix all these up.
2002-03-26 02:38:11 +00:00
david
9709dcb307 First steps towards configurable mouse input. Soon, this new code
(mainly in src/Input/input.cxx) will make src/GUI/mouse.cxx obsolete
and bring the mouse into the same input system as the joystick and
keyboard.  This is just preliminary work allowing, covering mouse
clicks (no motion yet), and it actually crashes on a middle or right
click.

The new mouse support is disabled by default until it become stable;
to try it out, you need to configure --with-new-mouse.
2002-03-23 23:16:13 +00:00
david
d0d3b2bd7a Use !strcmp for all property string-value comparisons. 2002-03-20 22:15:22 +00:00
david
4d4cd16012 Major viewer-code overhaul from Jim Wilson:
Description:

This update includes the new viewer interface as proposed by David M. and
a first pass at cleaning up the viewer/view manager code by Jim W.

Note that I have dropped Main/viewer_lookat.?xx and Main/viewer_rph.?xx and
modified the Makefile.am accordingly.


Detail of work:

Overall:
The code reads a little easier.  There are still some unnecessary bits in
there and I'd like to supplement the comments in the viewer.hxx with a tiny
bit on each interface group and what the groupings mean (similar but briefer
than what you emailed me the other day).  I tried not to mess up the style,
but there is an occasional inconsistency.  In general I wouldn't call it done
(especially since there's no tower yet! :)), but I'd like to get this out
there so others can comment, and test.

In Viewer:
The interface as you suggested has been implemented.  Basically everything
seems to work as it did visually.  There is no difference that I can see in
performance, although some things might be a tiny bit faster.

I've merged the lookat and rph (pilot view) code into the recalc for the
viewer.  There is still some redundancy between the two, but a lot has been
removed.  In some cases I've taken some code that we'd likely want to inline
anyway and left it in there in duplicate.  You'll see that the code for both
looks a little cleaner.  I need to take a closer look at the rotations in
particular.  I've cleaned up a little there, but I suspect more can be done
to streamline this.

The external declaration to the Quat_mat in mouse.cxx has been removed.  IMHO
the quat doesn't serve any intrinsic purpose in mouse.cxx, but I'm not about
to rip it out.  It would seem that there more conventional ways to get
spherical data that are just as fast.  In any case all the viewer was pulling
from the quat matrix was the pitch value so I modified mouse.cxx to output to
our pitchOffset input and that works fine.

I've changed the native values to degrees from radians where appropriate.
This required a conversion from degrees to radians in a couple modules that
access the interface.  Perhaps we should add interface calls that do the
conversion,  e.g. a getHeadingOffset_rad() to go along with the
getHeadingOffset_deg().

On the view_offset (now headingOffset) thing there are two entry points
because of the ability to instantly switch views or to scroll to a new view
angle (by hitting the numeric keys for example).   This leaves an anomaly in
the interface which should be resolved by adding "goal" settings to the
interface, e.g. a setGoalHeadingOffset_deg(), setGoalPitchOffset_deg(), etc.

Other than these two issues, the next step here will be to look at some
further optimizations, and to write support code for a tower view.  That
should be fairly simple at this point.  I was considering creating a
"simulated tower view" or "pedestrian view" that defaulted to a position off
to the right of whereever the plane is at the moment you switch to the tower
view.  This could be a fall back when we don't have an actual tower location
at hand (as would be the case with rural airports).

ViewManager:
Basically all I did here was neaten things up by ripping out excess crap and
made it compatible as is with the new interface.

The result is that viewmanager is now ready to be developed.  The two
preexisting views are still hardcoded into the view manager.  The next step
would be to design configuration xml (eg /sim/view[x]/config/blahblah) that
could be used to set up as many views as we want.  If we want to take the easy
way out, we might want to insist that view[0] be a pilot-view and have
viewmanager check for that.
2002-03-20 17:43:28 +00:00
david
0cc3bed841 Major property-manager rewrite, using const char * throughout
interface instead of string.  This will result in a lot more
efficiency later, once I add in a simple hash table for caching
lookups, since it will avoid creating a lot of temporary string
objects.  The major considerations for users will be that they cannot
use

  node->getName() == "foo";

any more, and will have to use c_str() when setting a string value
from a C++ string.
2002-03-19 17:12:13 +00:00
david
45d64bef95 Centralized most view-management code in FGViewMgr. It's still a
mess, but the mess is all in one place now.
2002-03-14 00:29:20 +00:00
david
b9e866cfdd Added write-all parameter to save command. If set to true, the
command will save *all* properties, rather than just those marked as
archivable.  This feature was requested by Tony Peden to make it
easier to write documentation on the properties, but it should also be
useful for debugging.  There is currently no default binding for the
command with the write-all parameter set to true.
2002-03-03 22:48:40 +00:00
david
0296c04e32 For property-scale, apply the squared option before factor, etc. 2002-03-02 19:40:26 +00:00
david
a285ff5ea4 Added a new 'squared' subproperty for axis bindings. 2002-02-19 23:54:47 +00:00
curt
dea7284cc7 Restructured the 'freeze' property a bit. We now have
/sim/freeze/master      (implimented)
  /sim/freeze/fuel        (implimented)
  /sim/freeze/position    (not implimented)
  /sim/freeze/time-of-day (not implimented)

/sim/freeze/master is bound to the 'p' key via keyboard.xml, however,
/sim/freeze/fuel is not bound to anything at the moment so you must
change it via the external property interface, or specify an initial
value on the command line.
2002-01-20 03:52:36 +00:00
curt
f82b717c8b Norman's changes to display a scrolling "PAUSE" message when the simulation
is paused.
2001-12-11 22:40:14 +00:00
curt
f2e89407d2 For ADA fdm turn on hud for center channel. 2001-09-19 22:27:08 +00:00