New option to display frame latency.
Better property to evaluate simulation performance than frame rate.
This commit is contained in:
parent
264996bb3c
commit
7299d07dab
5 changed files with 70 additions and 16 deletions
|
@ -138,6 +138,7 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
|
||||||
menuEnable("tutorial-start", size(props.globals.getNode("/sim/tutorials", 1).getChildren("tutorial")));
|
menuEnable("tutorial-start", size(props.globals.getNode("/sim/tutorials", 1).getChildren("tutorial")));
|
||||||
menuEnable("joystick-info", size(props.globals.getNode("/input/joysticks").getChildren("js")));
|
menuEnable("joystick-info", size(props.globals.getNode("/input/joysticks").getChildren("js")));
|
||||||
|
|
||||||
|
# frame-per-second display
|
||||||
var fps = props.globals.getNode("/sim/rendering/fps-display", 1);
|
var fps = props.globals.getNode("/sim/rendering/fps-display", 1);
|
||||||
setlistener(fps, fpsDisplay, 1);
|
setlistener(fps, fpsDisplay, 1);
|
||||||
setlistener("/sim/startup/xsize", func {
|
setlistener("/sim/startup/xsize", func {
|
||||||
|
@ -147,6 +148,16 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
# frame-latency display
|
||||||
|
var latency = props.globals.getNode("/sim/rendering/frame-latency-display", 1);
|
||||||
|
setlistener(latency, latencyDisplay, 1);
|
||||||
|
setlistener("/sim/startup/xsize", func {
|
||||||
|
if (latency.getValue()) {
|
||||||
|
latencyDisplay(0);
|
||||||
|
latencyDisplay(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
# only enable precipitation if gui *and* aircraft want it
|
# only enable precipitation if gui *and* aircraft want it
|
||||||
var p = "/sim/rendering/precipitation-";
|
var p = "/sim/rendering/precipitation-";
|
||||||
var precip_gui = getprop(p ~ "gui-enable");
|
var precip_gui = getprop(p ~ "gui-enable");
|
||||||
|
@ -197,7 +208,10 @@ var fpsDisplay = func(n) {
|
||||||
var w = isa(n, props.Node) ? n.getValue() : n;
|
var w = isa(n, props.Node) ? n.getValue() : n;
|
||||||
fgcommand(w ? "dialog-show" : "dialog-close", props.Node.new({"dialog-name": "fps"}));
|
fgcommand(w ? "dialog-show" : "dialog-close", props.Node.new({"dialog-name": "fps"}));
|
||||||
}
|
}
|
||||||
|
var latencyDisplay = func(n) {
|
||||||
|
var w = isa(n, props.Node) ? n.getValue() : n;
|
||||||
|
fgcommand(w ? "dialog-show" : "dialog-close", props.Node.new({"dialog-name": "frame-latency"}));
|
||||||
|
}
|
||||||
|
|
||||||
##
|
##
|
||||||
# How many seconds do we show the tip?
|
# How many seconds do we show the tip?
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
<empty><stretch>1</stretch></empty>
|
<empty><stretch>1</stretch></empty>
|
||||||
|
|
||||||
<text>
|
<text>
|
||||||
<label>Display Options</label>
|
<label>Display Options</label>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<empty><stretch>1</stretch></empty>
|
<empty><stretch>1</stretch></empty>
|
||||||
|
|
||||||
<button>
|
<button>
|
||||||
<pref-width>16</pref-width>
|
<pref-width>16</pref-width>
|
||||||
|
@ -43,6 +43,15 @@
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
|
<checkbox>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Show worst-case frame latency</label>
|
||||||
|
<property>/sim/rendering/frame-latency-display</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</checkbox>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label>Show chat messages</label>
|
<label>Show chat messages</label>
|
||||||
|
@ -79,10 +88,10 @@
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
|
|
||||||
<checkbox>
|
<checkbox>
|
||||||
<label>Autohide cursor in</label>
|
<label>Autohide cursor in</label>
|
||||||
<property>/sim/mouse/hide-cursor</property>
|
<property>/sim/mouse/hide-cursor</property>
|
||||||
<binding>
|
<binding>
|
||||||
|
@ -90,11 +99,11 @@
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
|
||||||
<input>
|
<input>
|
||||||
<live>true</live>
|
<live>true</live>
|
||||||
<pref-width>40</pref-width>
|
<pref-width>40</pref-width>
|
||||||
<pref-height>10</pref-height>
|
<pref-height>10</pref-height>
|
||||||
<enable>
|
<enable>
|
||||||
<property>/sim/mouse/hide-cursor</property>
|
<property>/sim/mouse/hide-cursor</property>
|
||||||
</enable>
|
</enable>
|
||||||
<property>/sim/mouse/cursor-timeout-sec</property>
|
<property>/sim/mouse/cursor-timeout-sec</property>
|
||||||
|
@ -102,12 +111,11 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</input>
|
</input>
|
||||||
|
|
||||||
<text>
|
|
||||||
<label>sec.</label>
|
|
||||||
</text>
|
|
||||||
|
|
||||||
</group>
|
<text>
|
||||||
|
<label>sec.</label>
|
||||||
|
</text>
|
||||||
|
</group>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<text>
|
<text>
|
||||||
<label>000</label>
|
<label>000</label>
|
||||||
<property>/sim/frame-rate</property>
|
<property>/sim/frame-rate</property>
|
||||||
|
<format>%3.0f</format>
|
||||||
<live>true</live>
|
<live>true</live>
|
||||||
<color>
|
<color>
|
||||||
<red>0.9</red>
|
<red>0.9</red>
|
||||||
|
|
30
gui/dialogs/frame-latency.xml
Normal file
30
gui/dialogs/frame-latency.xml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<PropertyList>
|
||||||
|
<name>frame-latency</name>
|
||||||
|
<x>2</x>
|
||||||
|
<y>2</y>
|
||||||
|
<layout>hbox</layout>
|
||||||
|
<default-padding>0</default-padding>
|
||||||
|
<font>
|
||||||
|
<name>HELVETICA_12</name>
|
||||||
|
</font>
|
||||||
|
<color>
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
<alpha>0</alpha>
|
||||||
|
</color>
|
||||||
|
<text>
|
||||||
|
<label>0000 ms</label>
|
||||||
|
<property>/sim/frame-latency-max-ms</property>
|
||||||
|
<format>%4.0f ms</format>
|
||||||
|
<live>true</live>
|
||||||
|
<color>
|
||||||
|
<red>0.9</red>
|
||||||
|
<green>0.4</green>
|
||||||
|
<blue>0.2</blue>
|
||||||
|
<alpha>1</alpha>
|
||||||
|
</color>
|
||||||
|
</text>
|
||||||
|
</PropertyList>
|
|
@ -131,6 +131,7 @@ Started September 2000 by David Megginson, david@megginson.com
|
||||||
<shader-experimental type="bool" userarchive="y">false</shader-experimental>
|
<shader-experimental type="bool" userarchive="y">false</shader-experimental>
|
||||||
<shader-effects type="bool" userarchive="y">true</shader-effects>
|
<shader-effects type="bool" userarchive="y">true</shader-effects>
|
||||||
<fps-display type="bool" userarchive="y">false</fps-display>
|
<fps-display type="bool" userarchive="y">false</fps-display>
|
||||||
|
<frame-latency-display type="bool" userarchive="y">false</frame-latency-display>
|
||||||
<on-screen-statistics type="int">0</on-screen-statistics>
|
<on-screen-statistics type="int">0</on-screen-statistics>
|
||||||
<glide-slope-tunnel type="bool" userarchive="y">false</glide-slope-tunnel>
|
<glide-slope-tunnel type="bool" userarchive="y">false</glide-slope-tunnel>
|
||||||
<redout>
|
<redout>
|
||||||
|
|
Loading…
Add table
Reference in a new issue