flight timer update:
activates at airspeed > 30 , shuts off at < 30 displays minutes:seconds up to 59:59 , then switches to hours:minutes
This commit is contained in:
parent
26aaab03fc
commit
90ac94548a
1 changed files with 21 additions and 7 deletions
|
@ -12,6 +12,7 @@
|
|||
m.et_running=0;
|
||||
m.et_elapsed=0;
|
||||
m.ft_start_time=0;
|
||||
m.ft_running=0;
|
||||
m.modetext =["GMT","LT","FT","ET"];
|
||||
m.M877 = props.globals.initNode(prop1);
|
||||
m.fmeter_sec=m.M877.initNode("flight-meter-sec",0,"DOUBLE");
|
||||
|
@ -32,15 +33,21 @@
|
|||
m.ET_MN=m.M877.initNode("ET-min",0,"INT");
|
||||
m.FT_HR=m.M877.initNode("FT-hr",0,"INT");
|
||||
m.FT_MN=m.M877.initNode("FT-min",0,"INT");
|
||||
m.FTlistener=setlistener("gear/gear/wow",func m.fmeter_control(),0);
|
||||
return m;
|
||||
},
|
||||
#### flightmeter ####
|
||||
fmeter_control : func(){
|
||||
if(!getprop("gear/gear/wow")){
|
||||
me.fmeter.start();
|
||||
}else{
|
||||
me.fmeter.stop();
|
||||
var ias =getprop("velocities/airspeed-kt");
|
||||
if(ias>30){
|
||||
if(me.ft_running==0){
|
||||
me.ft_running=1;
|
||||
me.fmeter.start();
|
||||
}
|
||||
}elsif(ias<30){
|
||||
if(me.ft_running==1){
|
||||
me.ft_running=0;
|
||||
me.fmeter.stop();
|
||||
}
|
||||
}
|
||||
},
|
||||
#### displayed mode ####
|
||||
|
@ -137,19 +144,26 @@
|
|||
var ftmin=(fthour-hr) * 60;
|
||||
var min = int(ftmin);
|
||||
var ftsec= (ftmin- min) *60;
|
||||
me.FT_HR.setValue(hr);
|
||||
me.FT_MN.setValue(min);
|
||||
if(fthour <1){
|
||||
me.FT_HR.setValue(min);
|
||||
me.FT_MN.setValue(ftsec);
|
||||
}else{
|
||||
me.FT_HR.setValue(hr);
|
||||
me.FT_MN.setValue(min);
|
||||
}
|
||||
},
|
||||
|
||||
#### update clock ####
|
||||
update_clock : func{
|
||||
var pwr=me.power.getValue();
|
||||
me.fmeter_control();
|
||||
if(me.set_mode==0){
|
||||
pwr=1-pwr;
|
||||
}else{
|
||||
pwr=1;
|
||||
}
|
||||
me.power.setValue(pwr);
|
||||
|
||||
if(me.flip==0){
|
||||
me.update_ET();
|
||||
}else{
|
||||
|
|
Loading…
Reference in a new issue