Change to calculate the frame rate ourselves because /sim/frame-rate doesn't take into account freeze and has a transient ridiculous value after a pause. Instead we calculate the average rate over a period and then LP filter this.
This also removes the annoying frame rate update messages
Cofiguration now comes from /sim/emexec
* /sim/emexec/monitor-period is the period to reset the average; the LP filter isn't reset.
* /sim/emexec/max-rate-hz is the upper limit on the emexec update rate. defaults to 50 and a model can override this. It's probably not a user setting
output of
* current emexec rate into /sim/emexec/rate-hz
* smoothed / LP filtered frame rate into /sim/emexec/frame-rate
- ensure createItem returns the item
- add an accessor for text()
- don't do lazy view creation for now
- skip aboutToShow until item iteration works for me
This concerns a single character inside a comment, so won't change the
behavior of the Nasal code in any way. Beside using the favored encoding
in FlightGear, this little change allows scripts/python/nasal_api_doc.py
(from the FlightGear repository) to work again without having to teach
it to ignore encoding errors nor to play at guessing the encoding of the
files it reads.
Since commit e41c0f099b, the Tooltip class has performed string
interpolation (i.e., sprintf()-style formatting) regardless of whether a
<property> was specified for the tooltip. This broke the API of
gui.popupTip(): all '%' characters in the message had to be doubled to
work as before. This commit restores the normal behavior of
gui.popupTip() where '%' characters aren't interpreted in any special
way.
see also https://wiki.flightgear.org/Nasal_Optimisation#Emesary_real_time_executive
Using a scheduler to manage the invocation of Nasal modules provides a more predictable and efficient way to replace update loops and also optimises property tree access to one access per property per frame by using a hash that contains the property values.
There is a default global object created (emexec.ExecScheduler) that should be used in most circumstances.
Each Nasal object simply has to have an update(notification) method. This will be called on a schedule and the notification will contain any requested property values.
The exec will also adapt the rate to the frame rate; with a maximum of 50hz, but this will drop to as low as 4hz based on the frame rate to optimise workload.
The modules will be called in the order in which they were added; so it is possible to have modules in the right sequence (i.e. an earlier module calculates values that are used by a later module)
A simple example is below. The VSD_device has the update method
------
# list of prooperties to include in the notification hash
var properties_to_monitor = {
OrientationHeadingDeg : "orientation/heading-deg",
OrientationPitchDeg : "orientation/pitch-deg",
OrientationRollDeg : "orientation/roll-deg",
GroundspeedKts : "velocities/groundspeed-kt",
radar2_range : "instrumentation/radar/radar2-range",
target_display : "sim/model/f15/instrumentation/radar-awg-9/hud/target-display",
vc_kts : "instrumentation/airspeed-indicator/true-speed-kt",
};
# create Canvas based device (that has an update method)
VSD = VSD_Device.new(designation, textureImage, notification.Ident, root_node);
# register with the exec;
# - ident
# - proprties to include in notification hash
# - object (with an .update(notification) method
# - rate (4 = 1/4)
emexec.ExecModule.register("F15-VSD", properties_to_monitor, VSD, 4);
Spray density realism improved by using a curve for the density and permitting the trigger to be changed (default 0.2)
Touchdown smoke trigerred by WoW changing using the velocity as a factor and then using a low pass filter on this to fade out the smoke. This results in smoke for a brief period that appears to be more realistic. F-14 example: https://i.imgur.com/FkwgoYV.gifv
Uses new property /sim/controls/brake-cancels-parking-brake.
Default is true; it is expected that some aircraft (e.g. p51d) will set this to
false so they can implement their own brake/parking-brake interaction.
Should address bug 2589.
- All non-ALS Effects have been removed (except generic ones from model-default and terrain-default).
- The rendering dialog has been reworked to accomodate the changes.
- All necessary properties have been added to graphics-properties.xml
- Five graphics presets have been added: Minimal, Low, Medium, High and Ultra.
- Some unused properties have been removed from defaults.xml
This view is like Helicopter View except that it does not change the view
heading to match the aircraft, which makes it work much better for vertical
flight, e.g. with the shuttle.
The new view is disabled by default.
Nasal/view.nas
contains the new view config.
defaults.xml:
Added view 8 to list of views for which we default to Helicopter view's
target offsets (so that they look at the centre of the aircraft).