Thanks to tied functions, this is only executed when the node is read. This
will be done by the old & new HUD code, the latter of which won't have a
special lon/lat mode at all. Instead it will be regular labels that point
to these properties for displaying lon/lat.
I would have liked to avoid the duplication of code (lon and lat being
basically the same thing), and to avoid using static buffers and all, but
... if anyone wants to make it prettier, go ahead.
The format is controlled by /sim/lon-lat-format (will be changed if I
find a better place).
AI aircraft are out of range or the piloted aircraft has no radar system.
These computation include range, bearing, and angular offset relative to the
piloted aircraft. This gives some external script the control the behavior
of the AI aircraft relative to the piloted aircraft without requiring a radar
system, and without requiring the AI aircraft to be within radar range.
flightplan. Such aircraft are given some initial conditions that they
fly with. They proceed on in "freeflight" mode indefinitely. For example,
there is a refueling demo where the tanker starts at 3000', 280 kts, and
in a 15 degree bank, and then continues to orbit indefinitely.
For these aircraft with no flightplan, I have added several control nodes in
controls/flight that allow a script or menu or external application to set
heading, altitude, bank angle, and speed. This permits some level of interactive
or scripted control over AI aircraft.
are taken down by the C++ runtime environment. This will later be done
with runlevels. Why would we want to run nasal code in subsystem
destructors? We don't really. But some data structures may use nasal,
which are normally created/destroyed during runtime. And these will
also be destroyed at fgfs exit. In the past things like these didn't
happen, because someone had disabled all subsystem destructors ...
src/AIModel/AIAircraft.cxx src/ATC/AILocalTraffic.cxx
src/FDM/flight.cxx src/FDM/flight.hxx src/FDM/groundcache.cxx
src/FDM/groundcache.hxx src/Main/fg_init.cxx src/Main/main.cxx
src/Scenery/hitlist.cxx src/Scenery/hitlist.hxx
src/Scenery/scenery.cxx src/Scenery/scenery.hxx
Make use of the attached SGMaterial reference userdata on scenegraph
leafs. Make the SGMaterial pointer available to the ground query
routines.
SGPropertyNode to guarded ones. This is also done for JSBSim/JSBSim.hxx,
for which JSB had given explicit permission a while ago. I postponed that
back then, but now is the time.
color group /sim/hud/palette/color[*]/ to the active group /sim/hud/color/
if they really exist. (Parameters like <antialiased> can be set in the
active group and be left alone, or set by each <palette> color group.)
into the <color> group, but that's because on HUD color changes a whole
"color" set from /sim/hud/palette/color[*] is copied to /sim/hud/color/, and
antialiasing needs to be considered with that. (I'm not entirely happy
with the property names yet.)
there's a bug that I had copied: update() checks each list node: if it
has no children, then a listener is attached. Later, when freeing the
children list, it assumed again that each node without children would
have a listener attached. This caused a crash when a node had children
before, but lost them in the meantime. Now we tried to remove a listener
where there never was one.
with an invalid path, as in getprop("/sim/model/737") or x.getNode("f:1").
Forward sg's error message to the Nasal runtime error function instead, so
you get something like:
Nasal runtime error: name must begin with alpha or '_'
at /home/m/fgfs/Base.local/Nasal/props.nas, line 30
Unfortunately, the location points to the line where the ghost wrapper
sits, rather than the offending script line.
*many* years, so the property browser always leaked memory. I activated
this line in property_list.cxx and ... got a crash right there. So this
was the reason for it being commented out? Doing the same for now, until
I know the exact reason and can really fix it.
"Bug Fix - amend the code so that JSBSIm can have more than one tanker in
the environment at the same time. A nasal script has to be added to each
aar-capable JSBSim model to complete this fix."
- backport submissions for plib 1.8.5:
* set slider size correctly
* remove slider/arrow when all entries fit into the view
* don't allow to scroll off the list
Unfortunately, there's no simple way to distinguish them. plib has no
user defined widget classes, and getTypeString() -- which could be used
for that -- isn't virtual. Sigh. I'll discuss the problem on the plib list.
For now I can only offer an ugly workaround. (Don't look closely!)
from plib's file-picker, where it made some sense to keep the current path as
string, and to chop off elements when leaving a dir, and adding them when
entering. But it doesn't make the least sense in SGPropertyNode space, where
we already have everything to move in a tree.
- add R & W flags for TRACE_READ and TRACE_WRITE. Remember: lower case letters:
disabled (rw ... reading/writing), upper case letters: enabled (RWAUT)
- remove some verbosity & further cleanup ... to make further work easier :-)
"Add Air to Air TACAN and User-User refuelling over the Multiplayer Network.
With this change, your TACAN instrument can be tuned to the channel of a
Multiplayer ac. It also activates fuel flow between User and User aircraft
when they are less than 50 ft apart. To participate in multiplayer as a
tanker, all you require to do is to use the callsign MOBIL* (where * is some
number) on the net. Only MOBIL1, MOBIL2 and MOBIL3 have been assigned TACAN
channels, but any MOBIL callsign will be able to give fuel."
- PropertyObject: remove additional "values" member again
- don't create entry lists for <list>, <select>, and <combo> at dialog
creation and delete them on dialog close, but let a separate class
fgValueList handle this. The three widgets are now subclassed and the
derived widget lets fgValueList manage the lists
- make <select> consistent with <list>. This breaks backwards
compatibility, but not a single dialog in fgfs uses it and did so
since ... forever. (Shoot me!)
Rationale: now that dialogs are a bit more dynamic than they used to be
(thanks to embedded Nasal), we have to delete and recreate entry lists
during dialog use. Deleting only at dialog closing doesn't cut it anymore.
Especially list widgets that are updated several times per second would
use up a lot of memory otherwise. The route-manager doesn't update that
often, but it did already leak. One TODO less. :-)
"Preparations for an upgrade to Air-to-Air Refuelling to allow more than one
tanker in the environment at a time. This will only work with YASim models.
JSBSim models are unaffected by this change."
The ufo sets this to a very low value, "serious" aircraft (which don't want this
unrealistic automatism at all) set it to a very high value, and those that don't
care ... don't need to care.
signals, this is meant for attaching listeners. The ufo will use that to
hide/reveal the status line in screenshots. The following signal properties
are now available:
/sim/signals/exit ... set to 1 right before quitting
/sim/signals/reinit ... set to 1 on re-init (Shift-Esc)
/sim/signals/screenshot ... set to 1 before and to 0 after screenshot
/sim/signals/click ... set to 1 after mouse clicks at terrain, signalling
that the geo coords in /sim/input/click/ were updated
I've got some updates for the soaring scenario that will make for a more
realistic (and fun) experience. They are:
1) A cap cloud, which will sit atop each thermal
2) A thermal scenario with wide coverage around KSFO, and using cap clouds
3) A one-line change to AIThermal.cxx to position cap cloud properly
4) Schweizer 2-33 set file change to match cloud coverage with thermal
heights.
files:
1) data/Models/Geometry/thermalcap.ac
2) data/Models/Geometry/thermalcap.xml
3) data/Models/Geometry/thermal_cap.rgb
4) data/AI/thermal_demo.xml
5) data/Aircraft/sgs233/sgs233-set.xml
6) source/src/AIModel/AIThermal.cxx
*** or, if you prefer diffs ***
7) aimodel.diff
only used by the <list> widget. It allows to "dialog-update" the list,
which rescans the <value> children and redraws the list widget with new
contents. The old contents are only freed at dialog close, which should
eventually get changed.
two almost identical functions for these methods. It only forces to repeat
the redundancy for every small change to either.
- abstract out generation and destruction of plib string arrays
- abstract out generation of lists from <value> children
used in dialog.cxx to allow XML dialogs access to their own prop tree via
Nasal's cmdarg(). That way dialogs can generate dynamic content, such as
list entries.
- only call globals->set_initial_waypoints() if the waypoints list address
has actually changed, that is: if it has just been initialized
- remove trailing spaces
- fix indentation
but got changed so that Nasal listeners wouldn't be triggered needlessly.
Doesn't make sense, though, as Nasal will never be available before the
video size is set, and it prevents the window interface from setting the
startup size.)
"Add Air to Air TACAN. With this facility TACAN equipped aircraft can
measure the range and bearing of TACAN equipped AI Aircraft. ATM there is
only one assigned - callsign ESSO1 on TACAN channel 039X, but this can be
easily expanded to include other c/s channel # pairs - just ask me if you
want more."
list) and the arrows are clicked (patch sent to plib; workaround it to
be removed once fgfs officially depends on a plib version that includes
the fix)
- fix (very unlikely) crash in case the widget is redrawn between list
destruction and setting of the new list.
even be more than once in the same list. We need to remove all such instances,
or the a pointer to TowerPlaneRec may become invalid and cause crashes.
The proper fix would, of course, be to be careful with state changes and
to prevent *any* duplication of entries. [OK'ed by David]
colors: <color-{{back,fore}ground,highlight,label,legend,misc,editfield}>
<input-misc>, for example, sets the input field cursor color, <input-legend>
the input field text color. (This feature was always planned as part of the
'theming' capabilities, and most code is already in place. Only this line
was apparently fogotten. :-)
a crash when using the model manager from XML files (which apparently
nobody does, anyway ;-) Now those models work (again), but have no
shadows. Those placed at runtime (e.g. via ufo) still have a shadow.
<property>, except if they are activated, in which case the user input
should, of course, not get overwritten. But if such an input was active and
the user selected a different widget, then its contents were dropped.
Fix that by setting the "DownCallback" for live input fields.
Here is one patch that to make FlightGear run without floating point
exceptions on FreeBSD. Apparently, if we do not ignore floating point
exceptions per this patch, there is some occasional condition where the
nvidia driver is involved in delivering spurious floating point exceptions
to the fgfs process, causing it to core-dump occasionally without the patch.
With only this patch, FlightGear will compile and run properly on
FreeBSD 6.X as long as the nvidia accelerated driver is installed,
modulo proper switches to the SimGear and FlightGear configure script
executions.
Again, kudos to your team for the great work on the big release
push; it is super to see things come together like this!
- reduce it to 20 (30 is excessive and didn't match the property brower look)
- call puSlider with this size explicitly (otherwise its size is derived
from the font size, unlike the arrow buttons!)
respected, and black text on dark grey is a bit hard to read).
TODO: - submit that for inclusion in plib's puAuxList
- drop custom version and use plib's (after 0.9.10)
I had inadvertently terminated a data line when reaching a tab character after
initial data was supplied. I tested the lightning file and it now appears to
read in correctly.
entry was selected. Return 0 in this case, not an invalid string address
(causing segfaults).
dialogs.cxx: don't set property if no list entry was chosen.
When AIFlightPlanCreateTaxi() function is called with the firstFlight
argument set to true, this is supposed to handle situations where the
the aircraft's timetable indicates it should have left between about 5 to
20 minutes earlier. In the previous version, all these aircraft started
taxiing from the first parking location available in the network, due
to the fact that the variable gateId was not assigned a value. In this
patch, route tracing starts from an assigned gate and the network node
following code is fast forwarded to a random location along the taxiways
to give a more realistic and natural distribution of taxiing aircraft
after startup.
This patch further addresses some weird ballet-dancing behavior that
aircraft were showing just prior to/right after parking and which was
related to a number of more or less duplicate waypoints in the transition
from createTaxi() to createParking() to createPushBack() to createTaxi().
Finally, a blatant typing error in the getParking() function was fixed.
at (lon, lat) coordinates -1000,0. This patch fixes the AIModels/Traffic
Manager side of things. The AIModels subsystems allowed the creation of
AIAircraft with non-existent 3D models. If such a model didn't exist, the
aip class didn't get initialized, resulting in the above-mentioned bogus
position information. Here I circumvent this problem by a) only interacting
with the tile loader if the model is visible (and hence has succesfully been
initialized) and b) by disallowing the traffic manager to create AIAircraft
objects if the path to the 3D model doesn't exist.
bunch of memory leaks that had accumulated over the years. FlightGear
doesn't currently bother to destroy and recreate a YASim context, but
at least it can do so now without worry.
groundcache addition -- the ground callback doesn't do anything at
solution time, so the ground plane was unset. Valgrind was whining
about this; it's not clear that it was actually causing a problem.
a race condition ending in warping twice and having huge increments for the
second warp.
I am not aware of such a flush function in glut. So we emulate that by
ignoring mouse move events between a warp mouse and the next frame.
That should make glut behavour aequivalent to sdl behavour.
This isn't the case if the model is destroyed on fgfs exit. To make <unload>
work under these circumstances, one would have to reorder subsystem removal,
but this doesn't seem overly useful, so we'll do it when we really need it.
aircraft models this is only called if they are loaded as AI, not if they
are the model flown by the human pilot. This has technical reasons (too
soon for Nasal/fg), but is useful to distinguish AI and non-AI use, for
example to set a different livery for AI models, or to set different
animation properties.
implement FGNasalModelData class for execution of XML <load> and <unload>
scripts. modelLoaded() is called by the model loader, and the destructor
on branch removal.
modelmgr.cxx:
tilemgr.cxx:
tileentry.[ch]xx:
make scenery and custom objects run their Nasal scripts on loading
and unloading. Let OBJECT_STATIC object not be cached.
<nasal>
<open>print("I'm called on dialog open")</open>
<close>print("I'm called on dialog close")</close>
</nasal>
All Nasal runs in a dialog namespace, so that variables and functions
defined in the <open> block can be used in <binding>s, etc. This is
especially useful for <radio> button handling. See "location-in-air.xml".
mf:
pthread_cancel doesn't seem to work correctly on all supported platforms.
It apparently causes SGBlockingQueue::pop() to correctly leave the thread on
the cancellation point pthread_wait(), but the SGGuard() destructor isn't
called, so the queue mutex remains locked. This triggered an assert() on
pthread_join(). This patch uses an empty ICAO request as signal for the
thread to terminate itself.