1
0
Fork 0

change from deprecated props.initNode() to props.Node.initNode()

This commit is contained in:
mfranz 2008-11-20 20:00:26 +00:00
parent c74d6ee75e
commit 6f6aef2fed
2 changed files with 14 additions and 15 deletions

View file

@ -164,7 +164,7 @@ setlistener("/sim/signals/fdm-initialized", func {
if (contains(globals, "fuel") and typeof(fuel) == "hash")
fuel.loop = func nil; # kill $FG_ROOT/Nasal/fuel.nas' loop
refuelingN = props.initNode("/systems/refuel/contact", 0, "BOOL");
refuelingN = props.globals.initNode("/systems/refuel/contact", 0, "BOOL");
aimodelsN = props.globals.getNode("ai/models", 1);
engines = props.globals.getNode("engines", 1).getChildren("engine");
@ -178,11 +178,11 @@ setlistener("/sim/signals/fdm-initialized", func {
continue; # skip native_fdm.cxx generated zombie tanks
append(tanks, t);
props.initNode(t.getNode("level-gal_us", 1), 0.0);
props.initNode(t.getNode("level-lbs", 1), 0.0);
props.initNode(t.getNode("capacity-gal_us", 1), 0.01); # not zero (div/zero issue)
props.initNode(t.getNode("density-ppg", 1), 6.0); # gasoline
props.initNode(t.getNode("selected", 1), 1, "BOOL");
t.initNode("level-gal_us", 0.0);
t.initNode("level-lbs", 0.0);
t.initNode("capacity-gal_us", 0.01); # not zero (div/zero issue)
t.initNode("density-ppg", 6.0); # gasoline
t.initNode("selected", 1, "BOOL");
}
foreach (var t; props.globals.getNode("systems/refuel", 1).getChildren("type"))

View file

@ -7,8 +7,7 @@ var OIL_PRESSURE_THRESHOLD = 20.0;
var ann = {
new : func(p) {
var m = { parents : [ann] };
m.node = props.globals.getNode(p, 1);
m.node.setBoolValue(0);
m.node = props.globals.initNode(p, 0, "BOOL");
m.stamp = nil;
m.state = 0;
return m;
@ -29,13 +28,13 @@ var ann = {
};
var volts = props.initNode("/systems/electrical/volts");
var vac_l = props.initNode("/systems/vacuum[0]/suction-inhg");
var vac_r = props.initNode("/systems/vacuum[1]/suction-inhg");
var fuel_l = props.initNode("/consumables/fuel/tank[0]/level-gal_us");
var fuel_r = props.initNode("/consumables/fuel/tank[1]/level-gal_us");
var oil_px = props.initNode("/engines/engine[0]/oil-pressure-psi");
var elapsed = props.initNode("/sim/time/elapsed-sec");
var volts = props.globals.initNode("/systems/electrical/volts");
var vac_l = props.globals.initNode("/systems/vacuum[0]/suction-inhg");
var vac_r = props.globals.initNode("/systems/vacuum[1]/suction-inhg");
var fuel_l = props.globals.initNode("/consumables/fuel/tank[0]/level-gal_us");
var fuel_r = props.globals.initNode("/consumables/fuel/tank[1]/level-gal_us");
var oil_px = props.globals.initNode("/engines/engine[0]/oil-pressure-psi");
var elapsed = props.globals.initNode("/sim/time/elapsed-sec");
var ann_volts = ann.new("/instrumentation/annunciator/volts");