1
0
Fork 0

Correction of the arrangement of controls for "Devel extensions" dialog

This commit is contained in:
Roman Ludwicki 2022-09-27 21:10:56 +02:00
parent 1a495a8ba9
commit fc60ae32c9

View file

@ -1,59 +1,62 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<PropertyList> <PropertyList>
<name>devel-extensions</name> <name>devel-extensions</name>
<modal>false</modal> <modal>false</modal>
<layout>vbox</layout> <layout>vbox</layout>
<nasal> <default-padding>5</default-padding>
<open>
<![CDATA[ <nasal>
var osg_debug = [ <open>
[0, "- Off"], <![CDATA[
[1, "- Show Frame Rate"], var osg_debug = [
[2, "+ Viewer Graph"], [0, "- Off"],
[3, "+ Camera"], [1, "- Show Frame Rate"],
[4, "+ Viewer Scene"], [2, "+ Viewer Graph"],
]; [3, "+ Camera"],
var osg_stats = cmdarg().getChildren("group")[1].getChildren("combo")[0]; [4, "+ Viewer Scene"],
var i = 0; ];
var osg_stats = cmdarg().getChildren("group")[1].getChildren("group")[0].getChildren("combo")[0];
foreach (var s; osg_debug) { var i = 0;
var nm = s[0] ~ " " ~ s[1];
#print("setting node to ",nm); foreach (var s; osg_debug) {
osg_stats.getNode("value[" ~ i ~ "]", 1).setValue(nm); var nm = s[0] ~ " " ~ s[1];
if (i == getprop("/sim/rendering/on-screen-statistics")) # print("setting node to ", nm);
setprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics",nm); osg_stats.getNode("value[" ~ i ~ "]", 1).setValue(nm);
i += 1; if (i == getprop("/sim/rendering/on-screen-statistics")) {
setprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics", nm);
} }
i += 1;
var updateOSG_stats = func(n) { }
var sel_mode = n.getValue();
if( sel_mode == nil ) return; var updateOSG_stats = func(n) {
print("\nupdate OSG debug ",sel_mode); var sel_mode = n.getValue();
if (sel_mode == nil) {
foreach (var s; osg_debug) return;
{ }
if(s[0] == sel_mode) print("\nupdate OSG debug ", sel_mode);
{
print(" >> ",s[1]); foreach (var s; osg_debug) {
setprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics", s[0] ~ " " ~ s[1]); if (s[0] == sel_mode) {
gui.dialog_update("devel-extensions", "OSGdebug"); print(" >> ", s[1]);
break; setprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics", s[0] ~ " " ~ s[1]);
gui.dialog_update("devel-extensions", "OSGdebug");
break;
} }
} }
# print("OSG Debug ",getprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics")); # print("OSG Debug ", getprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics"));
}; };
# listen for results arriving # listen for results arriving
setlistener("/sim/rendering/on-screen-statistics", updateOSG_stats); setlistener("/sim/rendering/on-screen-statistics", updateOSG_stats);
]]> ]]>
</open> </open>
<close> <close>
</close> </close>
</nasal> </nasal>
<!--new debug dialog <!--new debug dialog
multiplayer debug checkboxes multiplayer debug checkboxes
loopback loopback
@ -66,43 +69,66 @@
osg debug (0,1,2,3,4) osg debug (0,1,2,3,4)
reload shaders.--> reload shaders.-->
<text>
<label>Configure Development Extensions</label>
</text>
<hrule/> <!-- Title bar with close button -->
<group>
<layout>hbox</layout>
<default-padding>1</default-padding>
<group> <empty>
<layout>vbox</layout> <stretch>true</stretch>
<halign>left</halign> </empty>
<checkbox> <text>
<halign>left</halign> <label>Configure Development Extensions</label>
<label>Enable development dialog widgets (HUD and rendering dialog)</label> </text>
<property>/sim/gui/devel-widgets</property>
<binding> <empty>
<command>dialog-apply</command> <stretch>true</stretch>
</binding> </empty>
</checkbox>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<checkbox>
<halign>left</halign>
<label>Enable '/'-key property handler (see $FG_ROOT/Nasal/prop_key_handler.nas)</label>
<property>/sim/input/property-key-handler</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
</group>
<group> <group>
<layout>vbox</layout> <layout>vbox</layout>
<halign>left</halign>
<checkbox>
<halign>left</halign>
<label>Enable development dialog widgets (HUD and rendering dialog)</label>
<property>/sim/gui/devel-widgets</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Enable '/'-key property handler (see $FG_ROOT/Nasal/prop_key_handler.nas)</label>
<property>/sim/input/property-key-handler</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<!--muultiplayer debug checkboxes <!--muultiplayer debug checkboxes
loopback loopback
log outgoing properties 2 log outgoing properties 2
dump & 4 dump & 4
trace incoming properties.--> trace incoming properties.-->
<halign>center</halign> <halign>left</halign>
<checkbox> <checkbox>
<halign>left</halign> <halign>left</halign>
<label>Local loopback of model</label> <label>Local loopback of model</label>
@ -113,203 +139,256 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
<![CDATA[ <![CDATA[
setprop("/sim/multiplay/debug-level", (getprop("/sim/multiplay/debug-level") or 0) ^ 1); setprop("/sim/multiplay/debug-level", (getprop("/sim/multiplay/debug-level") or 0) ^ 1);
setprop("/sim/gui/debug/multiplayer-loopback", getprop("/sim/multiplay/debug-level") & 1); setprop("/sim/gui/debug/multiplayer-loopback", getprop("/sim/multiplay/debug-level") & 1);
]]> ]]>
</script> </script>
</binding> </binding>
</checkbox> </checkbox>
<combo> <group>
<row>5</row> <layout>table</layout>
<col>1</col> <halign>left</halign>
<pref-width>300</pref-width>
<halign>left</halign> <text>
<name>OSGdebug</name> <row>0</row>
<label>OSG statistics</label> <col>0</col>
<property>/sim/gui/dialogs/devel-extensions/on-screen-statistics</property> <label>OSG statistics</label>
<editable>false</editable> <halign>right</halign>
<binding> </text>
<command>dialog-apply</command> <combo>
</binding> <row>0</row>
<binding> <col>1</col>
<command>nasal</command> <pref-width>300</pref-width>
<script> <halign>left</halign>
<![CDATA[ <name>OSGdebug</name>
print("OSG Debug ",getprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics")); <property>/sim/gui/dialogs/devel-extensions/on-screen-statistics</property>
var selval = substr(getprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics"),0,1); <editable>false</editable>
print("Set osg debug ",selval); <binding>
setprop("/sim/rendering/on-screen-statistics", selval); <command>dialog-apply</command>
]]> </binding>
</script> <binding>
</binding> <command>nasal</command>
</combo> <script>
<combo> <![CDATA[
<row>5</row> print("OSG Debug ", getprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics"));
<col>2</col> var selval = substr(getprop("/sim/gui/dialogs/devel-extensions/on-screen-statistics"), 0, 1);
<pref-width>300</pref-width> print("Set osg debug ", selval);
<halign>left</halign> setprop("/sim/rendering/on-screen-statistics", selval);
<name>OSGLog</name> ]]>
<label>OSG log level</label> </script>
<property>/sim/rendering/osg-notify-level</property> </binding>
<value>DEBUG_FP</value> </combo>
<value>DEBUG_INFO</value>
<value>INFO</value> <text>
<value>NOTICE</value> <row>1</row>
<value>WARN</value> <col>0</col>
<value>FATAL</value> <label>OSG log level</label>
<editable>false</editable> <halign>right</halign>
<binding> </text>
<command>dialog-apply</command> <combo>
<object-name>OSGLog</object-name> <row>1</row>
</binding> <col>1</col>
</combo> <pref-width>300</pref-width>
<combo> <halign>left</halign>
<row>5</row> <name>OSGLog</name>
<col>3</col> <property>/sim/rendering/osg-notify-level</property>
<pref-width>300</pref-width> <value>DEBUG_FP</value>
<halign>left</halign> <value>DEBUG_INFO</value>
<name>SGLogging</name> <value>INFO</value>
<label>FG log</label> <value>NOTICE</value>
<property>/sim/logging/priority</property> <value>WARN</value>
<value>alert</value> <value>FATAL</value>
<value>warn</value> <editable>false</editable>
<value>info</value> <binding>
<value>debug</value> <command>dialog-apply</command>
<value>bulk</value> <object-name>OSGLog</object-name>
<editable>false</editable> </binding>
<binding> </combo>
<command>dialog-apply</command>
<object-name>SGLogging</object-name> <text>
</binding> <row>2</row>
</combo> <col>0</col>
<label>FG log level</label>
<halign>right</halign>
</text>
<combo>
<row>2</row>
<col>1</col>
<pref-width>300</pref-width>
<halign>left</halign>
<name>SGLogging</name>
<property>/sim/logging/priority</property>
<value>alert</value>
<value>warn</value>
<value>info</value>
<value>debug</value>
<value>bulk</value>
<editable>false</editable>
<binding>
<command>dialog-apply</command>
<object-name>SGLogging</object-name>
</binding>
</combo>
</group>
</group>
<group>
<layout>hbox</layout>
<halign>left</halign>
<button>
<legend>New Canvas Map</legend>
<binding>
<command>nasal</command>
<script>canvas.MapStructure_selfTest();</script>
</binding>
</button>
</group>
<group>
<layout>table</layout>
<halign>left</halign>
<button>
<row>0</row>
<col>0</col>
<halign>fill</halign>
<legend>Reload GUI</legend>
<name>reload-gui</name>
<binding>
<command>reinit</command>
<subsystem>gui</subsystem>
</binding>
</button>
<button>
<row>0</row>
<col>1</col>
<halign>fill</halign>
<name>reload-input</name>
<legend>Reload Input</legend>
<binding>
<command>reinit</command>
<subsystem>input</subsystem>
</binding>
</button>
<button>
<row>0</row>
<col>2</col>
<halign>fill</halign>
<name>reload-hud</name>
<legend>Reload Hud</legend>
<binding>
<command>reinit</command>
<subsystem>hud</subsystem>
</binding>
</button>
<button>
<row>0</row>
<col>3</col>
<halign>fill</halign>
<name>reload-panel</name>
<legend>Reload Panel</legend>
<binding>
<command>panel-load</command>
</binding>
</button>
<button>
<row>1</row>
<col>0</col>
<halign>fill</halign>
<name>reload-autopilot</name>
<legend>Reload Autopilot</legend>
<binding>
<command>reinit</command>
<subsystem>xml-autopilot</subsystem>
</binding>
</button>
<button>
<row>1</row>
<col>1</col>
<halign>fill</halign>
<name>reload-network</name>
<legend>Reload Network</legend>
<binding>
<command>reinit</command>
<subsystem>io</subsystem>
</binding>
</button>
<button>
<row>1</row>
<col>2</col>
<halign>fill</halign>
<name>reload-model</name>
<legend>Reload Aircraft Model</legend>
<binding>
<command>reinit</command>
<subsystem>aircraft-model</subsystem>
</binding>
</button>
<button>
<row>1</row>
<col>3</col>
<halign>fill</halign>
<name>reload-shaders</name>
<legend>Reload Shaders</legend>
<binding>
<command>reload-shaders</command>
</binding>
</button>
<button>
<row>2</row>
<col>0</col>
<halign>fill</halign>
<name>reload-materials</name>
<legend>Reload Materials</legend>
<binding>
<command>reload-materials</command>
</binding>
</button>
<button>
<row>2</row>
<col>1</col>
<halign>fill</halign>
<name>reload-scenery</name>
<legend>Reload Scenery</legend>
<binding>
<command>reinit</command>
<subsystem>scenery</subsystem>
</binding>
</button>
<button>
<row>2</row>
<col>2</col>
<halign>fill</halign>
<name>reload-compositor</name>
<legend>Reload Compositor</legend>
<binding>
<command>reload-compositor</command>
</binding>
</button>
</group> </group>
<group>
<layout>hbox</layout>
<halign>center</halign>
<button>
<legend>New Canvas Map</legend>
<binding>
<command>nasal</command>
<script>canvas.MapStructure_selfTest();</script>
</binding>
</button>
</group>
<group>
<layout>hbox</layout>
<halign>left</halign>
<button>
<legend>Reload GUI</legend>
<name>reload-gui</name>
<binding>
<command>reinit</command>
<subsystem>gui</subsystem>
</binding>
</button>
<button>
<name>reload-input</name>
<legend>Reload Input</legend>
<binding>
<command>reinit</command>
<subsystem>input</subsystem>
</binding>
</button>
<button> <button>
<name>reload-hud</name> <legend>Close</legend>
<legend>Reload Hud</legend> <default>true</default>
<binding> <key>Esc</key>
<command>reinit</command> <binding>
<subsystem>hud</subsystem> <command>dialog-apply</command>
</binding> </binding>
<binding>
<command>dialog-close</command>
</binding>
</button> </button>
<button>
<name>reload-panel</name>
<legend>Reload Panel</legend>
<binding>
<command>panel-load</command>
</binding>
</button>
</group>
<group>
<layout>hbox</layout>
<halign>let</halign>
<button>
<name>reload-autopilot</name>
<legend>Reload Autopilot</legend>
<binding>
<command>reinit</command>
<subsystem>xml-autopilot</subsystem>
</binding>
</button>
<button>
<name>reload-network</name>
<legend>Reload Network</legend>
<binding>
<command>reinit</command>
<subsystem>io</subsystem>
</binding>
</button>
<button>
<name>reload-model</name>
<legend>Reload Aircraft Model</legend>
<binding>
<command>reinit</command>
<subsystem>aircraft-model</subsystem>
</binding>
</button>
</group>
<group>
<layout>hbox</layout>
<halign>left</halign>
<button>
<name>reload-shaders</name>
<legend>Reload Shaders</legend>
<binding>
<command>reload-shaders</command>
</binding>
</button>
<button>
<name>reload-materials</name>
<legend>Reload Materials</legend>
<binding>
<command>reload-materials</command>
</binding>
</button>
<button>
<width>20</width>
<name>reload-scenery</name>
<legend>Reload Scenery</legend>
<binding>
<command>reinit</command>
<subsystem>scenery</subsystem>
</binding>
</button>
<button>
<name>reload-compositor</name>
<legend>Reload Compositor</legend>
<binding>
<command>reload-compositor</command>
</binding>
</button>
</group>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
</PropertyList> </PropertyList>