1
0
Fork 0
Commit graph

1 commit

Author SHA1 Message Date
curt
6ab2bca4ef Add a variant of the high res c172 rpm gauge that includes a working
LCD hobbs meter (instead of the previous "static" hobbs meter that was pretty
but didn't ever change.)  This requires some aircraft specific nasal support
since the hobbs meter isn't implemented in the same way on every aircraft:

# initialize the hobbs meter and configure to save every 5 minutes
var hobbs = aircraft.timer.new("/instrumentation/clock/hobbs-meter-sec");
aircraft.data.save(5);
hobbs.stop();

setlistener( "/engines/engine[0]/running",
    func {
	var running = getprop("/engines/engine[0]/running");
	if ( running ) {
	    hobbs.start();
	} else {
	    hobbs.stop();
	}
    }
);
setlistener( "/instrumentation/clock/hobbs-meter-sec",
    func {
	var secs = getprop("/instrumentation/clock/hobbs-meter-sec");
	setprop("/instrumentation/clock/hobbs-meter-hours", secs / 3600);
    },
    1
);
2009-04-22 18:11:23 +00:00