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_running=0;
|
||||||
m.et_elapsed=0;
|
m.et_elapsed=0;
|
||||||
m.ft_start_time=0;
|
m.ft_start_time=0;
|
||||||
|
m.ft_running=0;
|
||||||
m.modetext =["GMT","LT","FT","ET"];
|
m.modetext =["GMT","LT","FT","ET"];
|
||||||
m.M877 = props.globals.initNode(prop1);
|
m.M877 = props.globals.initNode(prop1);
|
||||||
m.fmeter_sec=m.M877.initNode("flight-meter-sec",0,"DOUBLE");
|
m.fmeter_sec=m.M877.initNode("flight-meter-sec",0,"DOUBLE");
|
||||||
|
@ -32,16 +33,22 @@
|
||||||
m.ET_MN=m.M877.initNode("ET-min",0,"INT");
|
m.ET_MN=m.M877.initNode("ET-min",0,"INT");
|
||||||
m.FT_HR=m.M877.initNode("FT-hr",0,"INT");
|
m.FT_HR=m.M877.initNode("FT-hr",0,"INT");
|
||||||
m.FT_MN=m.M877.initNode("FT-min",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;
|
return m;
|
||||||
},
|
},
|
||||||
#### flightmeter ####
|
#### flightmeter ####
|
||||||
fmeter_control : func(){
|
fmeter_control : func(){
|
||||||
if(!getprop("gear/gear/wow")){
|
var ias =getprop("velocities/airspeed-kt");
|
||||||
|
if(ias>30){
|
||||||
|
if(me.ft_running==0){
|
||||||
|
me.ft_running=1;
|
||||||
me.fmeter.start();
|
me.fmeter.start();
|
||||||
}else{
|
}
|
||||||
|
}elsif(ias<30){
|
||||||
|
if(me.ft_running==1){
|
||||||
|
me.ft_running=0;
|
||||||
me.fmeter.stop();
|
me.fmeter.stop();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
#### displayed mode ####
|
#### displayed mode ####
|
||||||
select_display : func(){
|
select_display : func(){
|
||||||
|
@ -137,19 +144,26 @@
|
||||||
var ftmin=(fthour-hr) * 60;
|
var ftmin=(fthour-hr) * 60;
|
||||||
var min = int(ftmin);
|
var min = int(ftmin);
|
||||||
var ftsec= (ftmin- min) *60;
|
var ftsec= (ftmin- min) *60;
|
||||||
|
if(fthour <1){
|
||||||
|
me.FT_HR.setValue(min);
|
||||||
|
me.FT_MN.setValue(ftsec);
|
||||||
|
}else{
|
||||||
me.FT_HR.setValue(hr);
|
me.FT_HR.setValue(hr);
|
||||||
me.FT_MN.setValue(min);
|
me.FT_MN.setValue(min);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
#### update clock ####
|
#### update clock ####
|
||||||
update_clock : func{
|
update_clock : func{
|
||||||
var pwr=me.power.getValue();
|
var pwr=me.power.getValue();
|
||||||
|
me.fmeter_control();
|
||||||
if(me.set_mode==0){
|
if(me.set_mode==0){
|
||||||
pwr=1-pwr;
|
pwr=1-pwr;
|
||||||
}else{
|
}else{
|
||||||
pwr=1;
|
pwr=1;
|
||||||
}
|
}
|
||||||
me.power.setValue(pwr);
|
me.power.setValue(pwr);
|
||||||
|
|
||||||
if(me.flip==0){
|
if(me.flip==0){
|
||||||
me.update_ET();
|
me.update_ET();
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in a new issue