Tu-144-limits.nas 792 Bytes
Newer Older
1 2
var af_deform = 0;
var af_sys = 0;
3
var stop = 0;
4 5 6 7


var CheckLimits = func {

8 9 10
 var af_deform_new = getprop("/fdm/jsbsim/systems/airframe/damage/deform");
 var af_sys_new = getprop("/fdm/jsbsim/systems/airframe/damage/systems");
 var stop_new = getprop("/sim/crashed");
11 12

 if(af_deform_new > af_deform){
13
  gui.popupTip("Airframe: deformation G limit exceeded!");
14 15 16
 }

 if(af_sys_new > af_sys){
17
  gui.popupTip("Airframe: systems/passengers G limit exceeded!");
18 19
 }

20 21 22 23
 if(stop_new > stop){
  gui.popupTip("Flight model stopped.");
 }

24 25
 af_deform = af_deform_new;
 af_sys = af_sys_new;
26
 stop = stop_new;
27 28 29 30

}


31 32
var limtimer = maketimer(1.0, func{CheckLimits()});

33 34 35 36 37 38
setlistener("/sim/signals/fdm-initialized", func(p) {
 if(p.getValue() == 0){
  return;
 }
 settimer(func{limtimer.start();}, 10.125);
});