1
0
Fork 0
Commit graph

4251 commits

Author SHA1 Message Date
mfranz
55cde5f160 - assign unique id to listeners
- let setlistener return id
- add removelistener(id) command
2006-02-28 14:55:37 +00:00
andy
97b75a79bf Inspired by a patch from Vivian, this adds a settable "WASTEGATE"
control to piston engines that allows external scripts to control the
turbo/supercharger boost programatically by setting this axis to
values in the range [0:1].  It also adds a "turbo-lag" attribute (a
time in seconds) to engines implementing turbocharger spooling delays.

This isn't terribly well tested, but doesn't seem to have broken
anything.
2006-02-27 23:35:02 +00:00
ehofman
9b33107551 Syn.c w. JSBSim. 2006-02-27 08:41:24 +00:00
david
e89194b42a Change from Dave Perry:
I am attaching a trivial patch that changes the normalization from 24 to
12 in turn_indicator.cxx.  With this change, the pa24 tc has a turn
indicator spin value in the property tree of 0.9996 and the same value
for the pa28-161 is 1.0, so there is no harm to a 24 volt electrical
system in this change.  Should the battery or alternator put out a lower
voltage than 12 volts, the spin value goes down and the tc shows a
negative turn that increases as the voltage gets less.  This file shows
you as the author.  If you are comfortable with this change, commit it
to cvs and the tc will be correct even for 12 volt systems.
2006-02-27 02:24:14 +00:00
david
86c3a3b5c4 Allow YASim flight models to override the hard-coded fine and coarse
propeller pitch stops for constant speed propellers.  The default
values are the same as the previous hard-coded values.  The new
attributes, "fine-stop" and "coarse-stop", are documented in the base
package, Docs/README.yasim.
2006-02-26 16:46:51 +00:00
durk
395ea07252 Bugfix: variable fp was deleted in both AIBase::~AIBase() and AIAircraft::AIAircraft(), resulting in a segmentation fault.
Here the delete fp; statement is removed from the AIAircraft() destructor.
2006-02-23 21:42:11 +00:00
mfranz
1ece476355 make abortion more efficient ;-) 2006-02-23 12:55:57 +00:00
mfranz
d33b6da077 catch string exceptions 2006-02-23 08:32:27 +00:00
daveluff
00ba5a853e Recent SimGear changes seem to require more additions of config.h to FG in order to compile on Cygwin 2006-02-22 21:04:47 +00:00
mfranz
4b23e2b131 disable old ATC display. This is now done via screen.log.write() messages.
(Decide after 0.9.10 if it should be replaced with a new C++ implementation,
or if the Nasal one is good enough.)
2006-02-21 21:29:19 +00:00
mfranz
f38f3aabcc new FSF address (see http://www.gnu.org/licenses/gpl.html) 2006-02-21 17:45:03 +00:00
mfranz
146298ad89 set new FSF address (the whole paragraph is taken from
http://www.gnu.org/licenses/gpl.html, so it drops the link)
2006-02-21 17:37:31 +00:00
mfranz
1fe9cce53b - remove unused pthread mutex and condition
- remove cleanup handler that unlocks unused mutex
- make the result_queue a locking queue (blocking is only done in the
  pop() anyway, and this isn't used in the thread at all)
- don't disallow thread cancelling in the request_queue's pop(), which
  is the only cancellation point in this thread
2006-02-21 13:19:33 +00:00
mfranz
c9813d1b5d new FSF address 2006-02-21 01:16:04 +00:00
daveluff
8765d770f8 The current_fixlist pointer is depreciated now that it is set in globals 2006-02-20 22:34:15 +00:00
fredb
c0f6257c18 Suppress a recurrent "no error" message, at least with MSVC 2006-02-19 19:04:21 +00:00
ehofman
5fe860750e Mathias Frhlich:
This patch makes use of the vectors now available in simgear with that past
patch. And using that it simplyfies the carrier code somehow.

- Small additional factory's to the quaternion code are done in the simgear
  part. Also more explicit unit names in the factory functions.
- The flightgear part makes use of them and simplyfies some computations
  especially in the carrier code.
- The data part fixes the coordinate frames I used for the park positions in
  the carrier to match the usual ones. I believed that I had done so, but it
  was definitly different. Also there are more parking positions avaliable now.
2006-02-19 17:28:31 +00:00
mfranz
f928df6caf display deposit depths < 1mm correctly (although this is rather a
theoretical problem :-)
2006-02-19 13:59:39 +00:00
mfranz
dc1cf77804 make sure the dialog property tree can't disappear until we wrote the
last position back
2006-02-19 08:48:30 +00:00
fredb
3d66aa6175 Fix line endings 2006-02-18 17:06:08 +00:00
fredb
578ee0229d Fix line endings 2006-02-18 16:54:35 +00:00
fredb
b6009f1dae Not missing but at the wrong place 2006-02-18 15:29:13 +00:00
mfranz
1f6e343a7b automatically unlock mutex, because wait is a cancel point 2006-02-18 14:29:22 +00:00
mfranz
db89cf202a wasn't missing 2006-02-18 14:12:49 +00:00
fredb
72d3e86b76 Add missing include files needed by the new math code under windows 2006-02-18 14:05:47 +00:00
fredb
36e4045810 Add missing include files needed by the new math code under windows 2006-02-18 13:58:09 +00:00
fredb
f0c7c0112d Define NOMINMAX 2006-02-18 13:38:51 +00:00
mfranz
cf2dbec963 noise reduction (flooding the terminal isn't exactly informative) 2006-02-18 00:18:20 +00:00
fredb
e9e38eb77a Remove occurence of _USE_MATH_DEFINES 2006-02-17 22:13:18 +00:00
fredb
ef62644c96 MSVC fix 2006-02-17 21:53:22 +00:00
ehofman
b136477b71 MIPSpro fix. 2006-02-17 10:40:59 +00:00
ehofman
39f5689567 Remove unused files. 2006-02-17 09:58:07 +00:00
ehofman
da6568ad50 Mathias Frhlich:
The new multiplayer patch with an extension to transmit some properties with
the base package. The properties are transmitted in a way that will not
immediately brake the packet format if we need new ones.
Even if the maxmimum number needs to be limited somehow, that format might
work well until we have an improoved packet format which is even more compact
and that does not require to retransmit redundant information with each
packet.

That part is relatively fresh and based on that what Oliver provides on his
multiplayer server web page.

The properties are transferred to the client and I have modified the seahawks
rudder animation property to use a relative property path to verify that it
works appart from the fact that you can see it changing in the property
browser.

The movement is still a bit jerky, but that can be fixed/tuned later without
again braking the packet format.
2006-02-17 09:43:33 +00:00
ehofman
31621f50af Olaf Flebbe:
This patch makes FlightGear at least compile on MSVC. I hope I have removed
reference of my other local changes. DSP and DSW files are included for
reference. They have been reconstructed with am2dsp.pl. I had to introduce a
change to am2dsp because of the need of filenames with embedded spaces. (Yuck)

The major direction is to remove clutter like the _USE_MATH_DEFINES and have it
on the compiler command line sice there is no central include file. You will
have to put it on the command line for your locale Project files, if it not
there, already. I added the _CRT_SECURE_NO_DEPRECATE define for 2005, since it
does no harm to other VC version.
2006-02-17 08:54:22 +00:00
mfranz
8e8b2bba04 in fgWarpMouse() we need to flush all mouse motion events before we can set
the mouse pointer to a new position. Otherwise it can happen that the new
position is first set, but then come a few still unprocessed events for the
old position. This makes ugly jumps in mouse view mode.
2006-02-16 21:02:09 +00:00
ehofman
bcb193f38b Add support for emissive layers. 2006-02-16 18:59:48 +00:00
david
85707f1e49 The "constrained" property for a mouse mode now actually constrains
the mouse rather than wrapping it.  Wrapping around to the other side
of the screen has very bad consequences when using the mouse for
flying or viewing -- it can result in sudden jumps in the controls or
the viewpoint when the mouse jumps to another side of the screen.

Right now, the mouse is constrained to stay between 25% and 75% of the
screen on both the X and Y axis -- whenever it hits an edge, it jumps
back to the centre of the screen again (which causes no control or
view jump).
2006-02-16 01:30:28 +00:00
mfranz
2aedb080d7 noise reduction 2006-02-15 22:03:15 +00:00
mfranz
94aca555e9 whoops :-} 2006-02-15 08:34:42 +00:00
mfranz
ff9b7ebd64 cleanup 2006-02-15 08:25:23 +00:00
mfranz
470dc1b363 geo coords on button *down*. Noise reduction. 2006-02-15 08:15:28 +00:00
mfranz
9f227bf837 reduce noise 2006-02-14 22:24:53 +00:00
mfranz
034e39dba5 screenPrint() is obsolete. Use screen.log.write() for the same purpose,
or write to the color properties in /sim/screen/. If this Nasal/GUI
implementation turns out to be too slow, we'll write a generic OpenGL/plib
version simliar to the ATCdisplay code.  (OK'ed by Andy and Stuart)
2006-02-13 20:08:04 +00:00
mfranz
a9228ee582 screenPrint() is obsolete. Use screen.log.write() for the same purpose,
or write to the color properties in /sim/screen/. If this Nasal/GUI
implementation turns out to be too slow, we'll write a generic OpenGL/plib
version simliar to the ATCdisplay code.  (OK'ed by Andy and Stuart)
2006-02-13 19:59:07 +00:00
mfranz
3a2148828e screenPrint() is obsolete. Use screen.log.write() for the same purpose,
or write to the color properties in /sim/screen/. If this Nasal/GUI
implementation turns out to be too slow, we'll write a generic OpenGL/plib
version simliar to the ATCdisplay code.  (OK'ed by Andy and Stuart)
2006-02-13 19:46:03 +00:00
mfranz
3b047b1831 set /sim/fg-home in analogy to /sim/fg-root. This is useful for various
scripts that load/write user specific data that shouldn't go to PWD, and
can't go to $FG_ROOT (due to permissions and clean separation of 'official'
data and local modifications)
2006-02-13 16:49:18 +00:00
mfranz
2385e5d387 Just a gimmick: make background color configurable. Maybe some dark color
might look nicer for certain aircraft specific splash screens. Test with:
$ fgfs --prop:/sim/gui/colors/splash-screen/blue=0.35
2006-02-12 20:37:57 +00:00
fredb
cc27909e6f Catch sound exceptions at the earliest, report problem has an alert, and continue without segfaulting ( hopefully ) 2006-02-12 19:57:57 +00:00
mfranz
f5469ba9fe only user specified negative coords are interpreted as relative to the upper
right corner, not those that are result of centering a dialog if no x/y are
given. This centers screen.log messages correctly. But maybe we have to
rethink that special meaning of negative coords altogether.
2006-02-12 19:43:53 +00:00
mfranz
35eb03bc68 Remove old festival code. 2006-02-12 17:17:15 +00:00
ehofman
5045b936a2 Remove old festival code." 2006-02-12 17:11:07 +00:00
ehofman
975887eac8 Remove old festival code. 2006-02-12 17:04:22 +00:00
mfranz
b4572711fa replace 'innovative' clamping method with something more traditional 2006-02-12 14:17:30 +00:00
fredb
1a74b726d0 Unused local variable removed 2006-02-11 14:51:20 +00:00
fredb
852c98aadd Portability fix - use SimGear when available 2006-02-11 14:43:48 +00:00
ehofman
3894dc75a7 Remove empty files. 2006-02-11 13:57:40 +00:00
ehofman
4bfd1722df Mathias Froehlich:
This patch removes some useless indirection when creating AIModels. It
obsolets AIScenario*.

AIEntities are just an intermediate copy of an other intermediate copy of an
xml file on the way from the ai scenario configuration file to the AIModels.
As such the AImodels can now be created directly from the property tree read
from the scenario file.

This reduces the amount of work needed to add an other AIModel and reduces the
amount of copy operations done during initialization.

It also moves internal knowledge of special AI models into these special AI
models class instead of spreading that into the whole AIModel subdirectory
which in turn enables to use carrier internal data structures for carrier
internal data ...

Also some unused variables are removed from the AIModel classes.
I believe that there are still more of them, but that is what I stumbled
accross ...

Tested, like the other splitouts these days in a seperate tree and using the
autopilot for some time, and in this case with a carrier start ...
2006-02-11 13:16:56 +00:00
mfranz
13c923fcc5 start "voice" subsystem 2006-02-11 12:02:40 +00:00
mfranz
ea49db6c4f add voice subsystem. This is a generic socket interface with a special
mode for communication with the "Festival" speech synthesis system.
2006-02-11 11:58:17 +00:00
mfranz
4010611300 rename user preferences.xml' to autosave.xml'. The former name lead to
problems because a lot of people already have their *real* preferences
set in ~/.fgfs/preferences.xml (and don't want fgfs to stomp over them),
because the name doesn't tell people that their data aren't save there
(comments!), and because this is inconsistent with the global preferences.xml
file, where user changes *are* respected.
2006-02-11 11:51:20 +00:00
daveluff
0bac52705b Implement some of the inner-knob-out scan functionality. The waypoints of the active flightplan can now be scanned on the NAV4 page, and will become the default direct-to waypoint if dto is pressed whilst scan in on on the NAV4 page. Scan functionality on the waypoint pages is still TODO. 2006-02-10 23:19:45 +00:00
daveluff
21387a636f Remove some debugging output 2006-02-10 23:10:57 +00:00
mfranz
af7cd434cf Vivian wants: s/with the ATIS/with ATIS/ 2006-02-10 21:26:36 +00:00
mfranz
3957e26234 preliminary fix for the "golf foxtrot sierra follow the golf foxtrott sierra"
problem; Of course, this needs to respect the /sim/user/callsign settings
as a next step.
2006-02-10 20:15:01 +00:00
mfranz
effecbd8ef don't set the callsign, but use the set one 2006-02-10 19:57:46 +00:00
mfranz
2a8111cc11 Don't send repeating messages (ATIS) to the /sim/messages/atc property. 2006-02-09 19:15:49 +00:00
mfranz
a5fa24a586 one line sooner would be wise :-) 2006-02-09 17:27:37 +00:00
mfranz
e254d4e76d remove the subsystem in the destructor that was added in the constructor.
This prevents nasty crashes on "environment" subsystem removal.
2006-02-09 17:21:58 +00:00
ehofman
5bd2ef1edb Vivian Meazza:
This patch is a combined effort by Gregor Richards, Oliver Schroeder, and
Vivian Meazza (and code cleanups and improvements by Erik Hofman). It corrects
the bug in which a Multiplayer model responds to local inputs, and the view
number bug which caused certain aircraft to appear as cockpit only models. It
passes remote properties over the net, and all major control surfaces and gear
are now animated correctly, providing that the local ~model.xml file contains
no leading "/" in the <property></property> data entries. MP objects
are now extrapolated using 1st and 2nd derivatives to make their movement
appear more smooth. The sim is now halted while a new client joins the net.

Known problems with MP are non-display of the remote client under certain
circumstances of starting/resetting, and a freeze on starting. These bugs are
long standing, and are not addressed by this patch.

Special thanks must go to AJ Macleod for his patient testing of this patch over many evenings.

We have also moved part of multiplayer into AIModels as part of the ongoing
development of MP.
2006-02-09 12:29:05 +00:00
mfranz
179e5c587d make sure the index is in the array, which isn't necessarily the case,
because a dialog button can get pressed when its callback isn't available
any more. Ideally, we would close the dialog or update its buttons when
this happens. But this requires bigger changes.
2006-02-08 17:18:24 +00:00
ehofman
a47725e92f Mathias Frhlich:
Make use of the automatic reference counting class for ssg* data in flightgear.
2006-02-08 10:25:56 +00:00
ehofman
ae77c7d75a Sync. w. JSBSim CVS. 2006-02-08 09:15:57 +00:00
mfranz
3cdea0705d emit to different message properties:
/sim/messages/{atc,pilot,ai-plane,ground,approach}
These can the be used for differenct screen.log colors and for different
voices. (Aircraft & tutoruals may want to write to /sim/messages/copilot)
2006-02-07 22:35:22 +00:00
mfranz
5bd1ba0d59 Vivian MEAZZA:
"Bug fix - ensure all TACAN channels are included"
2006-02-05 11:33:08 +00:00
mfranz
4d757f28d3 export ATC message to /sim/messages/atc 2006-02-04 16:55:05 +00:00
mfranz
d1fa3f9c7e store garbage collector id (again) in the listener class, and free the
handler on destruction. There's no explicit Nasal command for removing
a listener, but deleting the node should fully remove them.
2006-02-04 16:37:25 +00:00
mfranz
e51cd8eaf5 make room for more font specifications in style files 2006-02-04 13:06:47 +00:00
mfranz
940d1aa8df typo 2006-02-04 01:03:41 +00:00
fredb
c210cf509a Remove unused local variables 2006-02-03 21:04:37 +00:00
mfranz
38d44f2c01 only write coordinates on button press, and not again on release 2006-02-03 11:39:04 +00:00
mfranz
f9bf9fd073 fix for deadlock problem (as suggested by Andy) 2006-02-02 18:03:07 +00:00
ehofman
c695e7c788 Vassilii Khachaturov:
Fix the current buggy rain orientation behaviour for the views attached to the
aircraft (while still inheriting bugs with the views attached to anything else).
2006-02-02 09:57:33 +00:00
ehofman
8141bfe2da Prevent a warning. 2006-02-02 09:40:27 +00:00
ehofman
6849328fea Sync. w. JSBSim CVS 2006-02-02 09:35:25 +00:00
mfranz
9968dfd814 cosmetics 2006-02-02 00:47:30 +00:00
mfranz
beff0cef60 better use zero sensitive area to detect a missing (or inoperable) button,
because a missing <button> default to 0, which makes a lot of sense
2006-02-02 00:00:27 +00:00
mfranz
1c27be1cb4 panel_io.cxx: if an action doesn't have a button, fire its bindings
immediately and then throw it away; this is useful for initialization
    purposes (see dme.xml)

cockpit.cxx: warnings--; typos--
2006-02-01 23:52:36 +00:00
mfranz
c5f1ffaf64 fix 2D compass 2006-02-01 20:54:17 +00:00
ehofman
c90596b8ec Tie the sun halo texture to point sprites. 2006-01-31 15:14:45 +00:00
mfranz
d1ad73558f Vivian MEAZZA:
"Implement the repeat function for submodels. Default value is 'false' "
2006-01-30 22:08:53 +00:00
ehofman
7e46303195 Olaf Flebbe:
I had massive problems with tower.cxx, so I decided to doublecheck all
containers and iterators in order and found lot of potential problems.

Now I can fly with "debug on" of KSFO for minutes without problems.

The fix for AIMgr is from Mathias, but I reworked it. So blame me, not him.
2006-01-30 13:44:56 +00:00
ehofman
bd1f711b51 Durk Talsma:
- Feet to meter conversion mistake (in AI getGround elev)
- Improved ground following code (not yet perfect, but for now no one will
  notice it within the marginal altitiude differences at the taxitrack or
  runway)
- Exclusion of the "AI" directory witihin data/Aircraft in
  main/init/fgSearchAircraft, to prevent AI aircraft to be picked up by the
  aircraft search function
2006-01-30 13:29:49 +00:00
mfranz
9efe35b86a support optional setlistener() arg to fire callback function initially 2006-01-30 12:29:58 +00:00
ehofman
ca462fa546 Mathias Frhlich:
Jon Stockill wrote:
> I've just discovered that when using the null fdm I'm not getting
> updates to /position/ground-elev-m any more. So I can't actually
> retrieve the terrain elevation. Is there somewhere else in the property
> tree I could read this from?

The attached patch fixes this problem.
2006-01-30 10:54:10 +00:00
ehofman
6bdaa05351 Mathias Frhlich:
This patch limits the maximum simtime we do simulation computations for.
That is highly sensible if you run flightgear in valgrind or some realy slow
debug build. In such a case it is possible that flightgear gets totally
unresponsible, because simulation time might increase slower than real time.
That patch introduces a maximum simulation time per rendered frame to limit
that effect.

If the property /sim/max-simtime-per-frame is set to something strictly
positive, the simulation time is limited to that value.
The default is unchanged - no limit.

Anyway, from the point of view of gui responsiveness and responsiveness to
realtime controls like joystick inputs it might be a good idea to limit that
by default to say 1 second. If you have less than 1fps, flightgear is
unplayable anyway and I believe we do not longer need to care for realtime
correctness for that case ...
2006-01-30 10:50:28 +00:00
mfranz
aec1d580c2 on closing a dialog write the last position back, so that the caller can
open it there again next time
2006-01-29 21:21:56 +00:00
mfranz
eb69ef592e make it consistent 2006-01-29 20:33:33 +00:00
mfranz
810d7b2297 another signal for listener callback functions:
setlistener("/sim/signals/quit", func { print("I'm called on exit.")});
2006-01-29 20:11:10 +00:00
mfranz
129813e0aa set the /sim/signals/reinit property on reinit, so that aircraft code can
attach listeners. Other relevant stuff should go here, too. (/sim/crashed
could be one.)
2006-01-29 16:20:31 +00:00
mfranz
ebe5fc3092 don't set zero width or height 2006-01-29 14:58:52 +00:00
mfranz
267e558bd2 the const-ness wasn't such a good idea :-) 2006-01-28 22:41:20 +00:00
mfranz
dc7cc2015b restore the uglyness: call the resize callback every frame again, even
though the window wasn't resized. I'm just not adventurous enough for
a cleaner solution in the light of the upcoming release. At least the
xsize/ysize properties aren't set each frame any more, so listeners
work now properly.
2006-01-28 16:06:03 +00:00
mfranz
8f9d8cab03 now that the renderer doesn't resize the window for every frame, we need
to do it manually here
2006-01-28 13:38:28 +00:00
mfranz
bae5d4e92b write to /sim/startup/xsize only if the size really changed; likewise for
ysize. This is useful for listeners, e.g. the one that will re-position the
FPS dialog.
2006-01-28 10:40:47 +00:00
mfranz
a4bbb31927 Resizing is done when fg_os{,_sdl}.cxx says so, not in every single frame.
(This defeats the purpose of the resize callback and makes "listening" to
the xsize useless.)
2006-01-28 00:10:39 +00:00
mfranz
6de1f56f2c make it const 2006-01-27 22:26:47 +00:00
mfranz
ffc8c4d3d0 export scenery click geo coords 2006-01-27 21:14:40 +00:00
mfranz
0b136fa66b getChild(): add optional "create" flag (like in the c++ version) 2006-01-27 20:43:40 +00:00
mfranz
0d48631e3a cosmetics: subc isn't really a sub-context here (it was where I copied it
from)  -->  s/subc/c/
2006-01-27 19:59:25 +00:00
mfranz
32968d81f3 we need a way to specify other contexts than _context; idea & OK by Andy 2006-01-27 19:51:25 +00:00
ehofman
0f448cb4ca Melchior FRANZ:
gui colors and material animation use "red", "green", "blue".
Would be nice if these light colors would use the same standard.
2006-01-27 13:54:35 +00:00
mfranz
cabf53537a allow top level <font> definition that applies to text in the whole dialog
and makes the layouter use this font's metrics
2006-01-27 12:57:13 +00:00
ehofman
6c331a55a8 Tie the scene ambient,diffuse end specular red,green and blue components to a property under /rendering/scene 2006-01-27 12:35:15 +00:00
mfranz
54ee68291b fonts are now delivered by FGFontCache (except for the splash screen,
because this comes way before the gui subsystem is ready)
2006-01-27 08:01:31 +00:00
mfranz
f729ec6013 cosmetics 2006-01-26 22:22:37 +00:00
mfranz
e2016f9568 fix FGFontCache and make use of it (this allows to assign bitmap fonts
in dialogs)
2006-01-26 21:40:37 +00:00
ehofman
5441622a28 Add support for point sprites. 2006-01-26 09:37:32 +00:00
mfranz
f0996fa47d create a new context for listener functions to avoid context corruption
(caused a crash when a timer triggered a listener) ... Idea and OK by Andy
2006-01-26 00:18:27 +00:00
curt
1729d15cdd White space updates. 2006-01-24 17:13:48 +00:00
curt
fdd47f4b56 Newest data file format includes range for each transmitter. Load that data
and use it instead of our own hard coded defaults.
2006-01-24 17:13:28 +00:00
ehofman
0895721e68 Mathias Frhlich:
Incorporating the shared ptr code:
- All scenegraph references from SimGear
- SGMaterial which already had a reference counter uses now that common
  infrastructure.
- SGMatModel is now counted.
- SGSoundSample from SimGear
- And the corresponding change for the sound samples in flightgear which fixes
  a latent crash if FGBeacon would evern be deleted.
2006-01-24 14:45:13 +00:00
ehofman
907b99a669 Use smooth (aliased) lines and points when available in hardware. 2006-01-21 12:07:40 +00:00
ehofman
ea177f6744 Olaf Flebbe: MSVC fix. 2006-01-21 10:11:08 +00:00
ehofman
919ccdb96a Remove a leftover from a previous patch. 2006-01-21 10:03:36 +00:00
ehofman
31e3caa4f6 Sync. w. JSBSim 2006-01-20 17:50:45 +00:00
ehofman
619226e9d0 Integrate a large part of John Wojnaroski's 747 cockpit project.
Erik Hofman:
This patch contains an update to net_ctrls.hxx that adds an extra 100 bytes
(or an equivalent of 25 (u)int32_t types) of reserved space. This could be
used to make the protocol forward and backward compatibel within a certain
scope. Be sure to read the instructions at the begining of the header file
when addinf new variables.
2006-01-20 17:19:01 +00:00
daveluff
3d5afec340 Fix the crashes on mini-panel and panel-reload with the KLN89, by removing the multiple inheritance and using an empty shell instrument to forward draw commands from the panel to the complex gps subsystem. 2006-01-13 22:07:50 +00:00
fredb
28b5a6d8bd Remove the filtersjb left over 2006-01-13 14:33:07 +00:00
fredb
17d20cf606 Remove the filtersjb left over 2006-01-13 14:00:13 +00:00
ehofman
f73f2f7254 Hide some user generated files. 2006-01-13 09:50:58 +00:00
ehofman
587fd0937e Remove a bunch of unneede files. 2006-01-13 09:49:09 +00:00
fredb
d0618685a2 Typo 2006-01-12 21:35:59 +00:00
fredb
bcc8339c4f Variable 'thrust' used before being initialized 2006-01-12 21:35:32 +00:00
fredb
4303c2b9a6 Redundant loop variable declaration 2006-01-12 21:35:08 +00:00
fredb
5d5a58de80 Don't declare functions that are not implemented 2006-01-12 21:34:36 +00:00
ehofman
932b38a87e sync. with JSBSim v. 2.0 2006-01-12 15:04:22 +00:00
ehofman
fcfe5d2010 Don't display the menubar in e highres screenshot. 2006-01-11 10:53:04 +00:00
curt
c3cf810562 Another attempt at fixing a cygwin compiler error. 2006-01-10 15:23:10 +00:00
curt
ac5e874523 Fix a compiler warning (member initialization order in constructor.) 2006-01-10 15:06:17 +00:00
curt
311b85a11d Small change to avoid dangling audio resources. 2006-01-10 14:51:12 +00:00
curt
5329ed10a7 Cygwin fix. 2006-01-10 02:49:52 +00:00
curt
691f096c68 Add an srand() function to nasal (hooked into sg_srandom_time()).
This helps avoid the problem of always getting the same random number
sequence every time you run a script.
2006-01-09 15:29:24 +00:00
curt
71d0001f3d Add a directory listing command to nasal. Given a directory name, return
the file list as an array.
2006-01-09 03:48:14 +00:00
curt
ee065ee6ef Write 'fg_root' in the property tree at /sim/fg-root 2006-01-09 03:47:33 +00:00
curt
e475a50ead Expose the "play-audio-command" through the props/telnet interface. 2006-01-09 02:23:50 +00:00
curt
3ed73e16b6 Add a do_play_audio_message() function which is tied to the
"play-audio-function" command.  This function can be called from internal
code, from nasal scripts, or from external scripts to play a single one-off
wav file.  File/audio data is loaded and unloaded on the fly automatically.
2006-01-09 02:23:02 +00:00
curt
4132b41470 Additional functionality added to the FlightGear sound fx manager.
Create a queue of one-off wav files.  Calling layer can request the system
to play any wav file.  The request is thrown at the end of a play queue.
The queue is serviced sequentially so that queued wav files will no longer
overlap.  When a sample is finished playing. It is removed from the queue
and deleted from memory.  The next remaining request in the queue is then
played.
2006-01-09 02:21:04 +00:00
ehofman
0e16419f0d Stuart Buchanan:
- Provide a Nasal interface to display simple text messages on the screen
  like the ATC display. In fact, I copied the code from the ATCDisplay.cxx
  and simply shifted it further down the screen.


Erik:

TODO: Integrate the two pieces of code.
2006-01-06 09:50:58 +00:00
ehofman
0b3164c312 Try to prevent a potential buffer overflow for WIN33. 2006-01-04 13:25:56 +00:00
ehofman
2080773f37 Cygwin fixes. 2006-01-04 12:49:07 +00:00
curt
9bc3a56cd2 Minor oops, committed this file before saving the final version in my
editor.
2006-01-02 23:08:45 +00:00
curt
a24ebc6958 - Add an "is-valid" property node so other modules can do a quick check if
anything in the nav tree is valid or not.
- Fix an order problem between caching data values and searching for a new
  station that could cause odd and unexpected and hard to reproduce results.
2006-01-02 23:01:45 +00:00
ehofman
713ddd05dd Olaf Flebbe: Make sure the model gets deleted when it's not referenced anymore. 2005-12-30 09:34:29 +00:00
curt
d4f56af242 Remove some left over debugging output. 2005-12-29 16:50:03 +00:00
curt
880a43bdbf John Ellson:
Changes require to compile with a Fedora-Core Development system running
on an X86_64 platform with gcc-4.1.0.
2005-12-29 16:22:38 +00:00
ehofman
4be621fbe9 Durk Talsma, Olaf Flebbe & Mathias Frhlich:
Split up simple.cxx
2005-12-29 13:58:21 +00:00
curt
c3f1331e52 Better estimate of cross track heading error. Also, make sure it is
computed correctly when flying outbound from a vor.
2005-12-29 04:07:49 +00:00
curt
1ae9849062 More reorg and refactoring of the code.
Added a convenience function to estimate the time to intercept the selected
radial give the current heading and speed.  This can be useful to a flight
directory to compute the point to switch from armed to coupled mode at just
the right time so the pilot can roll out onto the desired heading on the
desired radial.

Add a first whack at estimating a ground track heading error (difference
between aircraft heading and ground track directon.)  This needs more work
and testing.
2005-12-28 21:45:43 +00:00
curt
ce08000a96 Cache some property values locally to reduce unnecessary property system
calls.
2005-12-28 19:11:30 +00:00
curt
ccddc99e73 More naming cleanups. 2005-12-28 18:05:03 +00:00
curt
3bacacfb5c Clean up some of the member data naming. 2005-12-28 17:26:57 +00:00
curt
c694fe43ee Step #1 of some code refactoring and cleanups. The nav radio code was
written very early in the project and has grown and evolved and been added
onto many times.  It is long overdue for a code cleanup/reorg pass.
2005-12-28 16:53:19 +00:00
ehofman
d11df8fcc8 Remove a debugging cout. 2005-12-27 14:30:56 +00:00
ehofman
7b1f1d73e6 Detect the hostname as early as possible to prevent a segmentation fault (and an unknown exception in the main loop situation. 2005-12-27 14:02:38 +00:00
mfranz
a67cb7d6fb no more "Aborting ...\nPossible cause: Success" 2005-12-22 23:32:23 +00:00
ehofman
faf91ae9e9 Revert to the previous version, this is just a glimps of the future. 2005-12-22 15:13:50 +00:00
ehofman
62c6063fa1 Only test for --fg-root and --aircraft in ~/.fgfsrc et all if it wasn't specified at the command line. 2005-12-22 14:14:08 +00:00
ehofman
b788a204c4 Add an option to enable or disable the save-on-exit option. Add a season commandline option. 2005-12-22 13:51:11 +00:00
ehofman
ffa92dfe4b Put the user configuration file sequence into it's own function. This will slightly tidy up the code but more importantly will make it consistant across the program. 2005-12-22 10:25:07 +00:00
fredb
653f063bcf Fix a typo and an unitialized variable 2005-12-22 06:42:00 +00:00
ehofman
49ba607726 Get the environment variables HOME and HOSTNAME only once. 2005-12-21 13:36:04 +00:00
ehofman
e0db27eb6f Vassilii Khachaturov:
clean up some build warnings caught with gcc-4.0.
2005-12-19 13:15:09 +00:00
ehofman
9090fb5bf4 Olaf Flebbe:
The prototype of update_metar_properties does not match overridden func.
trafficmgr: iterators below begin() and after end().
tower.cxx : iterator incrementing beyond end().
2005-12-19 13:03:19 +00:00
ehofman
2d4ffc0dce Vassilii Khachaturov:
clean up some build warnings caught with gcc-4.0.
2005-12-19 12:53:21 +00:00
ehofman
3986347f37 MSVC fix. 2005-12-18 09:35:01 +00:00
ehofman
f6174d2bf0 Stefan Seifert: implement persistent dialog options, so changes in rendering, static LOD and sound settings dialogs are made permanent. 2005-12-17 15:34:37 +00:00
mfranz
96c0a7bbc1 add _setlistener() function, so that slow property polling loops can be
replaced with efficient listener callbacks. One use is the new FPS display.
This is reviewed and OK'ed by Andy, relatively trivial and separated from
the rest of Nasal, so problems are quite unlikely and confined to users of
this function.

The callback is executed whenever the property is written to -- even if
the value didn't change. The triggering Node is available via cmdarg().

Examples:  _setlistener("/sim/crashed", func {print("haha!")});
           _setlistener("/foo/bar", func { print(cmdarg().getPath() ~ " changed")})
2005-12-16 19:11:03 +00:00
curt
249a1264ff Remove the old hardcode fps display. This is now replaced with a nasal/gui
display that can be dragged around the screen to an unobtrusive location.
2005-12-15 22:18:06 +00:00
mfranz
f6225f5cb7 remove a few unused vars
menubar: cosmetics of the day
2005-12-15 20:07:14 +00:00
mfranz
98081d9243 don't check for subsequent indices (n), but for child positions; This way
it's also possible to enable/disable menu/item entries with higher numbers.
This can be useful for adding entries from other config files (aircraft
specific or local). I'd say aircraft files can use indices starting with
[100] and local files starting with [1000]. Such high number will never
collide with an entry in menubar.xml, even if entries are added/removed
there.
2005-12-14 07:45:47 +00:00
curt
7c0cf9dff9 Mathias Fröhlich's code, Curt Olson's comments:
Display the ground intersection point on mouse click (if click not consumed
by the gui or the panel.)  This should eventually get stuffed into the
property tree.
2005-12-12 22:22:28 +00:00
curt
bbb8b066eb Mathias Fröhlich:
Computes the pick direction and starting point.  This is code that translates
a screen coordinate into a vector in the FlightGear world (between the eye and
the on-screen coordinate.)  Armed with this vector in FG world coordinates,
you could call a scenery intersection routine and lookup the lon/lat/elev of
the point in the world that was clicked on.
2005-12-12 21:15:20 +00:00
ehofman
90a149ffa3 Vassilii Khachaturov:
* in some cases more specific sg exception types were used in place
  of the more generic one, e.g., sg_io_exception instead of sg_exception
  when the context of the error was an IO error
* in some cases, the error message was made more specific
* minor style fix for exception rethrowing --- using throw; whenever
  a re-throw is made; sometimes optimizing away the exception symbol name
  in the catch handler at all
* more specific catch handlers added in some places -- e.g.,
  an sg_io_exception caught ahead of sg_exception
2005-12-11 13:37:06 +00:00
ehofman
04f7175fd0 The most important part is that it fixes possible
memory corruption with that iterator decrement past the erase call.
2005-12-11 13:17:20 +00:00
ehofman
6773bf9571 Additional checks to io arguments. This prevents fg from crashing on invalid
arguments.
2005-12-11 13:12:26 +00:00
ehofman
4c395bf7a6 MSVC8 fixes. 2005-12-11 12:53:54 +00:00
mfranz
688bcb579f final cosmetics (s/_entries/_objects/ and comments) 2005-12-09 10:43:09 +00:00
mfranz
1caefda2a0 - fix typos
- fix indentation (there were 2, 3, 4, 7(!) space indents as well as tab
  indents, all mixed together)
- no code changes, except one "if (foo) {}" changed to "if (!foo) return; ..."
2005-12-08 15:03:08 +00:00
curt
ec7f73a5bb Make UFO honor elevator trim so it will respond to autopilot. This allows
you to do altitude hold mode and fly automated ILS approaches.
2005-12-07 23:26:38 +00:00
mfranz
1990db9ca5 yet more cleanup; clearer warning messages 2005-12-06 21:03:15 +00:00
mfranz
c10f583c11 removal of yet more stuff, left over from development; further simplification;
requires to remove some constness, though (we are adding listeners!);
If I continue like that, nothing will be left.  :-)
2005-12-06 19:51:31 +00:00
ehofman
e35911e45a Vivian: downgrade log levels from ALERT to INFO, tidy up the code. 2005-12-06 18:48:56 +00:00
mfranz
eb68e9ad36 remove two checks that were only useful during development; fix typo 2005-12-06 18:46:39 +00:00
ehofman
5956ade90c Mathias: silence some valgrind warnings so that you can concentrate better on the real problems. 2005-12-06 18:32:07 +00:00
mfranz
ac2c1fcd43 allow disabling/enabling of menu entries via "enabled" property;
Unfortunately, we don't have an easy way to access the puObjects
only by knowing the respective XML property node, because the
menu structure was built by plib from string lists. That's why
we walk the puMenuBar tree and store {property node}->{puObject*}
pairs in a map. With this infrastructure in place we can now
easily enable/disable entries, but we can also make other changes
to menu buttons as we see need. The structure of puMenuBar is
described in the pui documentation, so it's less of a hack than
it looks.  :-)
2005-12-06 17:56:17 +00:00
mfranz
435d874e35 Mathias FROEHLICH:
remove a hack and do it properly: if the requested elevation is for some
reason below the surface and the intersection test fails (as it appears
to be the case in EGLL), try again from 10000m ASL

mf: typos
2005-12-04 10:43:49 +00:00
mfranz
72f46a4a6f globals.cxx -- FGGlobals::set_fg_scenery():
Insert empty string as marker between FG_SCENERY path elements.
    FG_SCENERY=A:B expands to [A/Terrain, A/Objects, "", B/Terrain, B/Objects, ""]
    (assuming that both A/ and B/ have Terrain/ and Objects/ subdirs).

tileentry.cxx -- FGTileEntry::load():
    Check all tile dirs in FG_SCENERY from left to right: add all objects
    to the scenery until a terrain tile was found: In this case read the
    rest of that group (i.e. the Objects/ twin dir) and then stop scanning.

    Better structuring of log messages & fix warnings.
2005-12-03 10:20:35 +00:00
daveluff
24e9bb6ce8 Alex Romosan: Pass strings by reference not value 2005-12-02 22:52:09 +00:00
daveluff
1de61c8afd Alex Romosan: Make GpsPage::GetId() pure virtual, and pass strings by reference not value 2005-12-02 22:50:10 +00:00
mfranz
00e0546cab FGTileEntry::load(): store objects in a vector, then generate terrain or
sea tile, and finally process the objects. This guarantees that all objects
are placed relative to a valid tile center, rather than to the origin (0/0/0).
This is important for objects in sea tiles, and allows to display objects
of *.stg files that came sooner in FG_SCENERY.
2005-12-02 21:46:33 +00:00
mfranz
ca96f2b3a4 Mathias FROEHLICH: fix strange gcc 4.0.* strict aliasing problem 2005-12-02 16:43:50 +00:00
mfranz
b716c6d15b returning addresses of auto vars is *dangerous* (ask Vasilii! :-)
This was the reason why some people (especially SuSE10.0/gcc 4.0.2
users) couldn't see others in MP. I don't even know why I'm committing
that. It's less important than taxi lights ...
2005-12-02 00:10:25 +00:00
andy
d71a541837 Swap signs of the twist and incidence values to match the
documentation and author expectations.  Positive just wants to mean
"up", no matter what the axis conventions have to say.
2005-12-01 21:06:25 +00:00
daveluff
c92bcb4126 Ignore generated files 2005-11-30 21:31:50 +00:00
daveluff
a3890d1253 Add support for a special-instrument xml attribute, which triggers loading of a know c++ hard-coded instrument. This has some ugliness that will need removing at some point. In particular, panel reload is broken for panels that include a special-instrument, since this triggers subsystem reload which is a fatal error. Note that this *only* affects panels that use a special-instrument - all other panels are unaffected 2005-11-30 01:21:45 +00:00
daveluff
4be8a31d4b Build the KLN89 stuff... 2005-11-30 00:50:07 +00:00
daveluff
c94072c417 Track added files 2005-11-30 00:48:01 +00:00
daveluff
0dbe9a4c38 Code to extend FGs current GPS functionality to allow the simulation of a specific approach capable GPS. Eventually this file should be broken up and the code removed to other files, such as FGs current gps files 2005-11-30 00:47:41 +00:00
daveluff
3a6cadf628 2D polygon drawing routines for a GPS instrument 2005-11-30 00:46:11 +00:00
daveluff
2af78ec168 kln89 GPS unit simulation 2005-11-30 00:21:25 +00:00
daveluff
d176715284 kln89 user interface logical pages 2005-11-30 00:18:42 +00:00
daveluff
f44ed9716a kln89 symbol table 2005-11-30 00:16:45 +00:00
daveluff
999613dc36 Allow the nav radios to be slaved to a gps unit 2005-11-29 22:46:07 +00:00
daveluff
a7e6a0e294 Add a method to return a const pointer to the raw airport data, plus a couple of whitespace cleanups 2005-11-29 20:24:32 +00:00
daveluff
49b6bef6bb General tidy up - add an extra ctor method, remove surplus defined constants, remove cout and iostream 2005-11-29 19:58:37 +00:00
mfranz
9c28ed0257 Vivian MEAZZA:
"Remove redundant code, tidy up and improve output properties"
make elevator work
2005-11-29 16:38:49 +00:00
david
fbd53e772e Correct conditional so that FlightGear will compile without
special-purpose FDMs.
2005-11-29 03:12:24 +00:00
daveluff
81797885ce Add a lower-bound type navaid lookup, and the ability to specify navaid type in the find nearest lookup, for the GPS code 2005-11-28 22:42:23 +00:00
mfranz
03bf631765 ban not so informative message 2005-11-28 10:18:39 +00:00
daveluff
21c48ba67c Remove nav.hxx, which has been superceded by navrecord.hxx and is no longer used except by some old non-working test code 2005-11-27 23:48:04 +00:00
daveluff
808ac4784e Add a lower-bound search function for fixes for GPS units with next-match database search capabilities 2005-11-27 20:19:00 +00:00
mfranz
5d522e4784 Vivian MEAZZA: use coords of tuned in carrier, not of the first one 2005-11-27 17:25:39 +00:00
ehofman
e80e60ab7e Use the prefered GLUT game_mode_string format and add the posibility to match the screen refresh rate and the framerate. 2005-11-27 10:27:55 +00:00
ehofman
388ddb244f Mathias Frhlich:
While digging in flightgears lost memory, I found that endless loop.
2005-11-27 09:50:26 +00:00
daveluff
0db0e1992e Fix property typo 2005-11-26 23:56:28 +00:00
mfranz
f323c2e7ea cosmetics -- NO CODE CHANGE!
remove trailing spaces
fix very liberal indentation (logical block not indented at all, 5 spaces, ...)
removed commented out code
2005-11-25 19:07:24 +00:00
mfranz
85b93d8347 Vivian MEAZZA:
bugfix: don't always refer to carrier #0
2005-11-25 18:55:29 +00:00
andy
6a614dba49 Josh wanted a compression-m value exported for gear, so he can animate
them more accurately.
2005-11-24 17:35:42 +00:00
mfranz
a56e35ef74 of course I should have known that it would only work in tests *before*
committing, and would instantly break afterwards. Causes endless loops.
Re-uglify. Sorry for the noise.  :-/
2005-11-23 12:48:09 +00:00
mfranz
f93bb8eedc remove a few if's to make the ugly fix a little less ugly; they only save
a few CPU cycles but are really redundant
2005-11-23 12:28:27 +00:00
andy
e97c053cdd AJ found a typo 2005-11-22 23:25:25 +00:00
curt
e807c7f95c A long, long time ago, a bug was inadvertently introduced into the threaded
metar fetcher.  Effectively this caused the metar thread and the main
thread to both attempt to fetch weather data.  This could lead to long pauses
when the main thread decided to fetch the weather, and introduced a race
condition that could cause a segfault/crash.

Investigating this issue, I discovered that even longer ago, someone confused
#defines and #ifdef symbols with C/C++ variables.  If I #define XYZ 0 it is
defined so #ifdef XYZ is true, not false like a variable.  Our thread
detection made this mistake and there were follow up patches to work around
it.

So I fixed the configure script (ahhh, reading the autoconf manual is highly
recommended excercise for people editing the configure.ac file.)  I also
discovered that we were hardwiring with_threads=yes with no way via configure
options to disable threads from the build so I fixed that.

Then I patched up the #ifdef's scattered through the code to match the
configure script changes, oh and by the way, I stumbled upon a past typo
that led to the race condition in the metar fetching thread and fixed that.
2005-11-22 17:02:31 +00:00
curt
eca17c0dd8 Final updates for v0.9.9 2005-11-17 22:54:46 +00:00
curt
ae5cf05827 Clock also able to report local time. 2005-11-17 22:07:27 +00:00
curt
40bd985d36 Expose local timezone offset in the property tree. 2005-11-17 15:47:01 +00:00
ehofman
9df7af3924 David Culp:
Here's a fix for a bug I introduced when I updated the AIStorm with
turbulence.  The change I made to the FGAIEntity struct was overriding the
thermal <strength-fps> data.
2005-11-16 15:23:18 +00:00
curt
ff0d55fd4a Update 'magic' for more consistant cross platform padding. 2005-11-15 19:15:13 +00:00
mfranz
624ca31263 number one reason for lots of stale METAR reports is wrongly set system time 2005-11-14 21:59:13 +00:00
mfranz
6a3be655d2 Prevent download of thousands of METAR reports if all are for some reason
too old (wrong system time or broken proxy): stops after 10 stale reports
were fetched in a row. This should simply stop further fetching, but due
to a bug in the threading system(?) it does currently lead to abortion,
just like any other exception in the fetcher.
2005-11-14 17:18:27 +00:00
ehofman
496dd14e21 This section was accidentally committed togetehr with another patch, it turned out it needed a fix since env was already declared. 2005-11-13 10:20:15 +00:00
ehofman
a76bbbd23f Use the new clouds3d-enable property instead. 2005-11-13 10:07:23 +00:00
ehofman
5d07f52389 Use the new clouds3d-enable property instead. 2005-11-13 10:05:58 +00:00
ehofman
65d24ffbb8 Start the HTML documentation in the default browser on Mac OS X 2005-11-12 14:46:00 +00:00
ehofman
da5d0ffc28 Cygwin fix. 2005-11-12 14:40:17 +00:00
ehofman
9a7bbf3db5 Sync with SimGear. 2005-11-12 12:31:11 +00:00
mfranz
8d681fd6de "nine" (via IRC):
don't crash if gui subsystem isn't available yet
2005-11-12 11:40:57 +00:00
mfranz
0eef853caa This is an ugly fix for an ugly problem. And no, the two uglies don't cancel
each other out. The problem is this: if we press, for example, "Ctrl-a", but
release the "Ctrl" modifier button *before* the "a" button (which nobody does
intentionally, but which happens all the time), then we don't get the RELEASE
signal on "Ctrl-a" (keycode 1), but on the "a" (79). But "a" hasn't been
pressed, so the signal is dropped. And who releases "Ctrl-a"? Nobody!
So the next PRESSED signal for "Ctrl-a" is ignored, too. It is still
"pressed" after all, isn't it? That's the reason for the occasional
non-functioning of keys.

Due to the nearing 0.9.9 release, I only commit a crude last-minute fix.
It's not as intrusive as it looks, and shouldn't be "dangerous" at all.
It only makes sure that when we get an unexpected RELEASE for one letter
key ("a") that the two twins "A" and "Ctrl-A" are released if they are
still in "pressed" state.

The proper fix will be to let fg_os{,_sdl}.cxx always report presses on the
same key ("a", "Shift-a", "Ctrl-a", "Alt-a", and other combinations of
modifiers) as the *same* key (97), only with modifiers appropriately set.
2005-11-12 10:51:58 +00:00
ehofman
e5d3c3134b Make use of the new sound_sample function arrangement. 2005-11-12 10:27:05 +00:00
curt
60aaadad3f Downgrade some debugging output to the SG_DEBUG log level. 2005-11-12 02:51:18 +00:00
andy
dddbc2e74c Oops again -- forgot that the solver needs fuel too. :) 2005-11-11 18:02:16 +00:00