Generic MFD: Nav display optimisation
Change the NavDisplay so that the updates are paused when not being displayed.
This commit is contained in:
parent
8fdffa16e6
commit
6431d36166
2 changed files with 10 additions and 1 deletions
|
@ -432,6 +432,14 @@ var PFD_NavDisplay =
|
|||
{
|
||||
if (!me.nd_initialised)
|
||||
me.nd_init();
|
||||
#2018.2 - manage the timer so that the nav display is only updated when visibile
|
||||
me.NDCpt.onDisplay();
|
||||
};
|
||||
obj.offdisplay = func
|
||||
{
|
||||
#2018.2 - manage the timer so that the nav display is only updated when visibile
|
||||
if (me.nd_initialised)
|
||||
me.NDCpt.offDisplay();
|
||||
};
|
||||
#
|
||||
# most updates performed by the canvas nav display directly.
|
||||
|
|
|
@ -175,7 +175,8 @@ var NavDisplay = {
|
|||
}, # of connectAI
|
||||
|
||||
setTimerInterval: func(update_time=0.05) me.update_timer.restart(update_time),
|
||||
|
||||
onDisplay: func {me.setTimerInterval();},
|
||||
offDisplay: func {me.update_timer.stop();},
|
||||
# TODO: the ctor should allow customization, for different aircraft
|
||||
# especially properties and SVG files/handles (747, 757, 777 etc)
|
||||
new : func(prop1, switches=default_switches, style='Boeing') {
|
||||
|
|
Loading…
Reference in a new issue