FG1000: Difference between revisions

Jump to navigation Jump to search
917 bytes added ,  7 October 2020
Line 272: Line 272:
#  Display a GUI version of device 1 at 50% scale.
#  Display a GUI version of device 1 at 50% scale.
#fg1000system.displayGUI(index:1, scale:0.5);
#fg1000system.displayGUI(index:1, scale:0.5);
</syntaxhighlight>
You may also want to add some listeners to show/hide the FG1000 depending on electrical power, and also control the bezel backlighting:
<syntaxhighlight lang="nasal">
# Switch the FG1000 on/off depending on power.
setlistener("/systems/electrical/outputs/fg1000", func(n) {
    if (n.getValue() > 0) {
      fg1000system.show();
      setprop("/instrumentation/FG1000/Lightmap", getprop("/controls/lighting/avionics-lights-norm"));
    } else {
      fg1000system.hide();
      setprop("/instrumentation/FG1000/Lightmap", 0.0);
    }
}, 0, 0);
# Control the backlighting of the bezel based on the avionics light knob
setlistener("/controls/lighting/avionics-lights-norm", func(n) {
    if (getprop("/systems/electrical/outputs/fg1000") > 5.0) {
      setprop("/instrumentation/FG1000/Lightmap", n.getValue());
    } else {
      setprop("/instrumentation/FG1000/Lightmap", 0.0);
    }
}, 0, 0);
</syntaxhighlight>
</syntaxhighlight>


Navigation menu