I have now also implemented a timer class that saves the
accumulated time to the aircraft data file in ~/.fgfs/aircraft-data/
and restores that next time (can be turned off).

Syntax:
   aircraft.timer.new(<property>, [<resolution:double> [, <save:bool>]]);

   <property>   ... property path or props.Node hash where timer value
                    should be maintained
   <resolution> ... timer update interval (not accuracy, which is always
                    at maximum);  (default: 1 s)
                    For most Hobbs meters 60 s or even more should be
                    good enough. 
   <save>       ... whether the value should be saved to the aircraft
                    data file; (default: true, as this is probably the
                    main use for the class)

Methods:
   start()
   stop()
   reset()

Examples:
   var turbine_timer = aircraft.timer.new("/sim/time/hobbs/turbine", 60);
   turbine_timer.start();
   ...
   turbine_timer.stop();

   aircraft.timer.new("/sim/time/hobbs/foo").start();  # anonymous timer

m.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to