From 381aeb918e440931d34e9f52de23707cb3b45042 Mon Sep 17 00:00:00 2001 From: Philosopher Date: Sat, 25 Jan 2014 21:13:49 -0600 Subject: [PATCH] Canvas ND: keep canvases through reinit Make fdm listener single-fire, don't listen to /sim/signals/reinit. This allows the Canvas to stay with the same placement through reinit, after both the 777 and 747 were having problems. I don't see any reason for having to recreate it all, and the cleanup function is still there (e.g. for independent windows, to have their .del() call the ND's .del()). renamed handle_reinit() -> del() --- Nasal/canvas/map/navdisplay.mfd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/canvas/map/navdisplay.mfd b/Nasal/canvas/map/navdisplay.mfd index 24d428dcd..7e4b63acd 100644 --- a/Nasal/canvas/map/navdisplay.mfd +++ b/Nasal/canvas/map/navdisplay.mfd @@ -385,7 +385,7 @@ update_apl_sym(); var NavDisplay = { # reset handler - handle_reinit: func { + del: func { print("Cleaning up NavDisplay"); # shut down all timers and other loops here me.update_timer.stop(); @@ -499,7 +499,7 @@ var NavDisplay = { { if (me.inited) die("MFD already was added to scene"); me.inited = 1; - me.listen("/sim/signals/reinit", func(n) me.handle_reinit() ); + #me.listen("/sim/signals/reinit", func(n) me.del() ); me.update_timer = maketimer(0.05, func me.update() ); # TODO: make interval configurable via ctor me.nd = canvas_group; me.canvas_handle = parent;