1
0
Fork 0

- move all module initialization code into one-shot listener

- initialize /sim/time/delta-realtime-sec, so that the lowpass filter doesn't
  complain if it's starter eraly (of course the results won't be correct
  until the delta is real)
This commit is contained in:
mfranz 2007-02-08 18:42:02 +00:00
parent c7aace9926
commit 4ebd876c85

View file

@ -412,29 +412,6 @@ Data = {
};
var data = nil;
var L = _setlistener("/sim/signals/nasal-dir-initialized", func {
removelistener(L);
data = Data.new();
Data.new = nil;
if (getprop("/sim/startup/save-on-exit")) {
data.load();
var n = props.globals.getNode("/sim/aircraft-data");
if (n != nil) {
foreach (var c; n.getChildren("path")) {
if (c.getType() != "NONE") {
data.add(c.getValue());
}
}
}
} else {
Data._save_ = func {}
Data._loop_ = func {}
}
});
# timer
# ==============================================================================
# class that implements timer that can be started, stopped, reset, and can
@ -522,7 +499,8 @@ timer = {
# HUD control class to handle both HUD implementations.
# HUD control class to handle both HUD implementations
# ==============================================================================
#
HUDControl = {
new : func {
@ -574,8 +552,36 @@ HUDControl = {
oldinit2 : func { fgcommand("hud-init2", props.Node.new()) },
};
# module initialization
# ==============================================================================
#
var HUD = nil;
settimer(func { HUD = HUDControl.new() }, 0);
var data = nil;
var L = _setlistener("/sim/signals/nasal-dir-initialized", func {
removelistener(L);
props.globals.getNode("/sim/time/delta-realtime-sec", 1).setDoubleValue(0.00000001);
HUD = HUDControl.new();
data = Data.new();
Data.new = nil;
if (getprop("/sim/startup/save-on-exit")) {
data.load();
var n = props.globals.getNode("/sim/aircraft-data");
if (n != nil) {
foreach (var c; n.getChildren("path")) {
if (c.getType() != "NONE") {
data.add(c.getValue());
}
}
}
} else {
Data._save_ = func {}
Data._loop_ = func {}
}
});