I have made a function in Nasal and it works, but there is a problem.
In the property browser, the property which I did setprop to flickers between 0 and the calculated number.
- Code: Select all
var FMGCinit = func {
setprop("/FMGC/internal/greendot-kts", 0);
greendot.start();
}
var greendot = maketimer(0.1, func {
var gwlb = getprop("fdm/jsbsim/inertia/weight-lbs");
var factor = 0.45359237;
var kg = (gwlb * factor);
var alt = getprop("position/altitude-ft");
var kg2= (kg / 1000);
var greendot = ((kg2 * 2) + 85);
setprop("/FMGC/internal/greendot-kts", greendot);
});
A video of the flickering can be found at:
https://files.fm/u/rhx8jemj
I have talked to Richard, and he suggested that repeated calling of FMGCinit(); could cause this problem.
In reply, this is the only place where FMGCinit is called:
- Code: Select all
setlistener("/sim/signals/fdm-initialized", func {
fmgc.FMGCinit();
});
Would anyone have any explanations as to the cause of this? Thanks,
lego