From 6d22da65518b07bf521c23874f5377120f546e67 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Sun, 10 Dec 2017 18:20:08 -0400 Subject: [PATCH] Improve elec.nas --- Nasal/electrical.nas | 12 ++++++------ Nasal/libraries.nas | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 1496eb88..b910b83e 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -187,12 +187,12 @@ var ELEC = { setprop("/systems/electrical/outputs/transponder", 0); setprop("/systems/electrical/outputs/turn-coordinator", 0); - screens = [screen.new("DU1","LCD",60,50,"/controls/lighting/DU/du1","/systems/electrical/bus/ac-ess"), - screen.new("DU2","LCD",60,50,"/controls/lighting/DU/du2","/systems/electrical/bus/ac-ess-shed"), - screen.new("DU3","LCD",60,50,"/controls/lighting/DU/du3","/systems/electrical/bus/ac-ess"), - screen.new("DU4","LCD",60,50,"/controls/lighting/DU/du4","/systems/electrical/bus/ac2"), - screen.new("DU5","LCD",60,50,"/controls/lighting/DU/du5","/systems/electrical/bus/ac2"), - screen.new("DU6","LCD",60,50,"/controls/lighting/DU/du6","/systems/electrical/bus/ac2")]; + screens = [screen.new(name: "DU1", type:"LCD", max_watts:60, dim_watts:50, dim_prop:"controls/lighting/DU/du1", elec_prop:"systems/electrical/bus/ac-ess"), + screen.new(name: "DU2", type:"LCD", max_watts:60, dim_watts:50, dim_prop:"controls/lighting/DU/du2", elec_prop:"systems/electrical/bus/ac-ess"), + screen.new(name: "DU3", type:"LCD", max_watts:60, dim_watts:50, dim_prop:"controls/lighting/DU/du3", elec_prop:"systems/electrical/bus/ac-ess"), + screen.new(name: "DU4", type:"LCD", max_watts:60, dim_watts:50, dim_prop:"controls/lighting/DU/du4", elec_prop:"systems/electrical/bus/ac-ess"), + screen.new(name: "DU5", type:"LCD", max_watts:60, dim_watts:50, dim_prop:"controls/lighting/DU/du5", elec_prop:"systems/electrical/bus/ac-ess"), + screen.new(name: "DU6", type:"LCD", max_watts:60, dim_watts:50, dim_prop:"controls/lighting/DU/du6", elec_prop:"systems/electrical/bus/ac-ess")]; }, loop: func() { diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 9ad5354f..e3635759 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -168,7 +168,7 @@ var triggerDoor = func(door, doorName, doorDesc) { # Various Other Stuff # ####################### -setlistener("/sim/signals/fdm-initialized", func { +var sl = setlistener("/sim/signals/fdm-initialized", func { fbw.fctlInit(); systems.ELEC.init(); systems.PNEU.init(); @@ -191,6 +191,7 @@ setlistener("/sim/signals/fdm-initialized", func { setprop("/it-autoflight/input/fd2", 1); libraries.ECAMinit(); libraries.variousReset(); + removelistener(sl); }); var systemsLoop = maketimer(0.1, func {