I refactored the XML loading code out of FGAirportDynamics and
FGRunwayPreference. I also added a new class XMLLoader, which serves as a
facade to the loader functions. Further I changed FGRunwayPreference to just
keep a FGAirport ref, which is more concise and closer to the right(tm)
solution than storing the airport data a second time ;-)
I refactored the XML loading code out of FGAirportDynamics and
FGRunwayPreference. I also added a new class XMLLoader, which serves as a
facade to the loader functions. Further I changed FGRunwayPreference to just
keep a FGAirport ref, which is more concise and closer to the right(tm)
solution than storing the airport data a second time ;-)
"This patch fixes the use of the keypad with numlock in the osgViewer
version of FlightGear."
"This also restores the handling of resize events while trying to stay
out of the way of the multiple display code."
parser. Advantages over xml.nas: (reviewed and OK'ed by Andy)
- faster (33% ... only. I had hoped for more.)
- more standards compliant
- should support UTF
- I don't have to support it. ;-)
Usage: parsexml(<path> [, <start-tag> [, <end-tag> [, <data> [, <pi>]]]]);
<path> is an absolute file path, the rest are optional callback functions.
Example:
parsexml("/tmp/foo.xml", nil, nil, func(d) { print("DATA FOUND: ", d) });
where type is one of string (default), double, float, long, int, bool
Using only the first letter works, too.
--prop:foo=123 ... sets property foo to string 123 (old behavior)
--prop:string:foo=123 ... verbose version of above
--prop:s:foo=123 ... slightly less verbose version of above
--prop:bool:foo=1 ... makes property a bool of value 'true'
I hope this isn't considered a silly gimmick. I need this often and maybe
other developers do, too. It's useful in cases where the difference really
matters. if (getprop("/foo")), for instance, is TRUE even when the property
contains string "false", as all strings are TRUE.
efficiently performing "Dijkstra algorithm".
Durk Talsma: Added the detection of "circular" wait situations in the AI
ground network. A circular wait is a situation where aircraft a waits for
b; b waits for c; and c (in turn) waits for a. The checkCircularWaits
function detects these situations.
The current "solution" to a circular wait is rather crude: Remove the
aircraft from the scene. A proper solution needs a lot more work, however,
and at least this patch stops the AI system from clogging up. in case of a
circular wait.
data for AI traffic. Default performance classes are still available as a
backup. This database will allow the calculation of aircraft-specific
take-off speed and estimate runway lenght requirements. Further added
rudimentary support for take-off and landing rotation of AIAircraft.
together -- there's only *one* instrument node now
- don't take "random" tacan, but <tacan-source> from the instrumentation
config (or /instrumentation/tacan[0] by default)
- don't take "random" display-controls from /instrumentation/tacan[0]
- default name is now "radar" (formerly "wxradar")
* it says it's a warning (while in fact it's just saying what it's doing)
* the user can't do much here (yes, flying slower, but it doesn't say that :-)
* scrolling those countless messages in the terminal puts stress on the CPU
in a time when it's apparently already struggling
- re-enable od_gauge ("owner drawn" render-to-texture instruments)
- implement radar in c++ (unlimited number of clouds/ai/mp/... objects,
better performance)
or nil if no terrain intersection could be made (tile not loaded yet).
<matdata> is a hash with information about the surface material, or nil
if no material is assigned (shouldn't really happen, but one never knows).
Example:
var ac = geo.aircraft_position();
var data = geoddata(ac.lat(), ac.lon());
debug.dump(data);
# which outputs
[ 294.5862574369132, { light_coverage : 0, bumpiness : 0, load_resistance : 1e+30,
solid : 1, names : [ "pc_taxiway", "dirt_rwytaxiway" ], friction_factor : 1,
rolling_friction : 0.02 } ]
With this information it can be determined how far an object would sink in,
if the coordinate is on a runway, etc.
foreach (var n; data[1].names)
if (string.match(n, "p[ac]_*"))
im_on_a_runway();
/sim/screneryloaded-override was "true". At least one subsystem (od_gauge)
waits for /sim/sceneryloaded to bypass CPU intensive code until the scenery
is up. This broke e.g. the RTT-radar when using /sim/screneryloaded-override
--prop:sim/sceneryloaded-override=true has the effect that fgfs
doesn't show the splash screen until the scenery is loaded, but shows
the OTW view (scenery/aircraft) at the earliest possible moment. This is
useful for developers who often need to run fgfs only to check some minor
detail, while not caring about stuttering caused by scenery loading.
simple SG_LOG instead. The user didn't call the fgcommand, so why should
s/he be bothered with that? And the actually caller of the command gets a
return value and can pop up a dialog if it thinks it's necessary.
Why /sim/fg-current at all? Because we have a file selector dialog
(still unfinished), and one might like to start it from the current
directory, to find saved flights/screenshots/whatever.
FGManipulator.*:
"This patch works around a bug in OSG's handling of modifier keys. The
symptom of the bug is that modifier keys don't appear to be released."
fg_os_osgviewer.cxx:
"This patch fixes the test for support of cursor changes in OSG 2.0."
because this allows to load from FG_HOME. To reduce security risks, always
append an ".xml" extension if there was none. Makes it hard to read /etc/secret
and to overwrite ~/.bashrc. :-)
IRC wanted this to be scritable) and add it back (as a tip popup) via
a little nasal in the keyboard handler. Also put the synthesis of
property nodes back into fgcommand(), because I got cold feet.
missing, for sanity. Note that this will pass the resulting NULL
pointer through into the underlying SGCommand handlers, some of which
may be unprepared for it. So basically this is now yet another way
you can use Nasal to exercise bugs and hose your sim; no biggie.
- if no <impact-reports> node is defined for a particular submodel, then
write the path to /ai/models/model-impact instead
- don't tie() properties that are only ever set a single time, if at all!
- better variable names
src/Scenery/tileentry.cxx: Jonathan Wagner:
Removes black dots by accounting for radius of nodes
when calculating visible nodes for traversal without removing the
optimization. Confirmed fix with a few people on IRC.
src/GUI/gui.h src/GUI/gui_funcs.cxx src/Main/fg_commands.cxx
src/Main/renderer.cxx src/Main/renderer.hxx: Tim Moore:
These patches implement a command to dump the entire OSG scene graph as
a .osg text file. While large, this allows debuggers to really see
what's happening in the scene graph.
configure.ac src/Main/Makefile.am src/Main/fg_os.cxx
src/Main/fg_os.hxx src/Main/fg_os_sdl.cxx src/Main/main.cxx
src/Main/renderer.cxx src/Main/renderer.hxx
src/Network/jpg-httpd.cxx
Added Files:
src/Main/FGManipulator.cxx src/Main/FGManipulator.hxx
src/Main/fg_os_osgviewer.cxx:
Tim Moore: Make use of osgViewer.
a report node in the submodels config:
<impact-reports>/sim/model/cow/impact</impact-reports>
When an impact happens, then the path of the submodel will be written to
this node. An attached listener function can evaluate the impact properties.
at all is that this method is meant to be deprecated. But if it doesn't
say that, and there's no generic replacement at all, then it's rather
pointless.
- simplify parameter initialization (The old code copied from Instrumentation/
but has been simplified there in the same manner a few months ago
The new method is less picky about additional nodes ane outputs less
pointless alerts. If there shall really be a check for that, then
this should be a separate function. But it's nowhere else done in fgfs.
recover instead
- it was apparently planned to run the updated loop only every 1000th
frame, but the counter isn't reset, so it runs every frame
- use SG_LOG instead of cerr
- don't add redundant slashes in SGPath::append()
throwing an instance of 'sg_io_exception'\nAbandon". And this is caused
by compiling fgfs/sg without exception support (unlikely) or linking
against a libSDL/libglut that was compiled/linked without execption
support. While we can't fix that, we can tell the users who's to blame. :-)
- handle const char * exceptions
"minor update for the rotor FDM. It results in a more realistic
calculation of the phase shift of rotor and therefor in a little bit
more realistic flight behavior.
(Additionally you can modify the initial position of the rotor and some
(not finished) modifications for the jet ranger rotor)."
show "secret" values, that is: values of nodes with children. These
can be used like all normal (leaf) properties, but their values were
until now only shown in writeProperties() dumps. Also show the
number of attached listeners. Example: foo = 'bar' (string, AU, L3).
dialog.cxx: add warning message for broken <format>s; cosmetics
- props is easy to mix up with the --prop option (for setting properties)
- the name is unspecific and inconsistent: other option names describe
the protocol -- the way to get the properties. How is, for example,
--httpd less about prop(ertie)s?
- two identical options easily confuse people, as can be seen in The
FlightGear Manual, where --telnet and --props were described differently
/sim/view[*] that it finds. It's not only unnecessary that view definitions
have subsequent indices, but aircraft are now *requested* to use indices
100++. /sim/view[0] .. /sim/view[99] are reserved for the system. (Not
that we'd ever need that many, This is just a convention, it's nowhere
hard-coded.)
- replace the string operations for property paths by method calls & other
improvements
because nasal's f_interpolate() may be called in Nasal at times when the
GENERAL subsystem group is being deconstructed; access it by addressing
the group directly, as using globals->get_subsystem() does then not
work any more then; yeah, it's all for a rare border case ... :-)
NasalSys.cxx more robust instead. The reason for the crash was that during
fgfs shutdown destroyed subsystems (GENERAL group) still need Nasal access
(for AI Model destruction listeners), but at that point globals->get_subsystem()
can't even deliver the "nasal" subsystem (INIT group). One way to solve that
problem would have been to replace globals->get_subsystem("nasal") by
globals->get_subsystem_mgr()->get_group(SGSubsystemMgr::INIT)->get_subsystem("nasal"),
but Andy decided to store a pointer to the active "nasal" subsysten in
NasalSys.cxx instead, as the "nasal" subsystem needs to be accessed in
every single Nasal extension function, and multiple "nasal" subsystems are
out of the question, anyway.
we need to explicitly destroy that here, too, so that it has guaranteed
access to the Nasal subsystem. Otherwise we get a segfault on exit. When
the next subsystem needs this special treatement (radar?), we should
introduce a new subsystem group (in addition to INIT and GENERAL)
"FATAL: PUI: No Live Interface! Forgot to call puInit ?"
We shouldn't use the splash progress message before guiInit().
Leave the "idle_state" step for now, to keep the similarity
with fg/plib as big as possible. This can be dropped later.
Patch to enable atc chatter (and any other arbitrary "message" audio file)
to be played at any specified volume. (Previously these messages were always
played at a hardcoded volume of 1.0)
- loop up file name in the cache at startup. If it's found, check if the
file exists and use it, otherwise scan $FG_ROOT/Aircraft/ as usual,
and create a new cache while doing that. Rebuild cache on FG_ROOT change.